Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.