Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Contributor

While upgrading the Ambari server from 2.6.2 to Ambari 2.7.0.0-897 ,the ambari-server upgrade command fails with dependency unavailability.

[root@c2140-node4 yum.repos.d]#

ambari-server upgrade Using python /usr/bin/python

Upgrading ambari-server
Traceback (most recent call last):
  File "/usr/sbin/ambari-server.py", line 35, in <module>
    from ambari_commons.os_utils import remove_file
  File "/usr/lib/ambari-server/lib/ambari_commons/os_utils.py", line 39, in <module>
    from ambari_commons.os_linux import os_change_owner, os_getpass, os_is_root, os_run_os_command, \
  File "/usr/lib/ambari-server/lib/ambari_commons/os_linux.py", line 25, in <module>
    from ambari_commons import subprocess32
  File "/usr/lib/ambari-server/lib/ambari_commons/subprocess32.py", line 146, in <module>
    import importlib
ImportError: No module named importlib

Solution

The simple solution is to install the dependency python-importlib.noarch

[root@c2140-node4 yum.repos.d]# yum install python-importlib.noarch -y
Loaded plugins: fastestmirror, ovl
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package python-importlib.noarch 0:1.0.4-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================================================================
 Package                                              Arch                                       Version                                          Repository                                Size
=================================================================================================================================================================================================
Installing:
 python-importlib                                     noarch                                     1.0.4-1.el6                                      epel                                      11 k
Transaction Summary
=================================================================================================================================================================================================
Install       1 Package(s)
1,035 Views