Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

HDP Express upgrade failing with ImportError: cannot import name UPGRADE_TYPE_NON_ROLLING

avatar

Quite a few tasks are failing with errors similar to the following:

2016-03-31 15:29:48,526 - Task. Type: EXECUTE, Script: scripts/ru_set_all.py - Function: actionexecute
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/custom_actions/scripts/ru_set_all.py", line 26, in <module>
    from resource_management.libraries.script import Script
  File "/usr/lib/python2.6/site-packages/resource_management/__init__.py", line 23, in <module>
    from resource_management.libraries import *
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/__init__.py", line 23, in <module>
    from resource_management.libraries.functions import *
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/__init__.py", line 25, in <module>
    from resource_management.libraries.functions.default import *
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/default.py", line 24, in <module>
    from resource_management.libraries.script import Script
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/__init__.py", line 23, in <module>
    from resource_management.libraries.script.script import *
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 32, in <module>
    from ambari_commons.constants import UPGRADE_TYPE_NON_ROLLING, UPGRADE_TYPE_ROLLING 

ImportError: cannot import name UPGRADE_TYPE_NON_ROLLING

Any pointers? I'm upgrading from HDP 2.2.9 to HDP 2.4 using Ambari 2.2.1.1

1 ACCEPTED SOLUTION

avatar

@vpoornalingam can you check if on the host where it is failing you have a "ambari_commons" folder in the /var/lib/ambari-agent/tmp folder?

View solution in original post

2 REPLIES 2

avatar

@vpoornalingam can you check if on the host where it is failing you have a "ambari_commons" folder in the /var/lib/ambari-agent/tmp folder?

avatar
Super Collaborator

You're probably running into https://issues.apache.org/jira/browse/AMBARI-15617

Check to make sure that /var/lib/ambari-agent/tmp does not have "ambari_commons" as a directory/symlink inside of it. If it does, you should remove it. It's probably adding an older version of the common library to your python path.