Support Questions

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

Failed to install HDP 2.3 using ambari

Expert Contributor
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/", line 38, in <module>
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/", line 218, in execute
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/", line 34, in hook
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/", line 87, in install_packages
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 116, in __new__
    cls(name.pop(0), env, provider, **kwargs)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 157, in __init__
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 152, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/", line 118, in run_action
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/", line 45, in action_install
    self.install_package(package_name, self.resource.use_repos, self.resource.skip_repos)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/", line 41, in install_package
    if use_repos or not self._check_existence(name):
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/", line 84, in _check_existence
    return self.yum_check_package_available(name)
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/", line 69, in yum_check_package_available
    import yum # Python Yum API is much faster then other check methods. (even then "import rpm")
  File "/usr/lib/python2.6/site-packages/yum/", line 23, in <module>
    import rpm
ImportError: No module named rpm
stdout: /var/lib/ambari-agent/data/output-109.txt
2016-08-09 14:21:07,077 - Directory['/var/lib/ambari-agent/data/tmp/AMBARI-artifacts/'] {'recursive': True}
2016-08-09 14:21:07,079 - File['/var/lib/ambari-agent/data/tmp/AMBARI-artifacts//'] {'content': DownloadSource('http://Manager:8080/resources//')}
2016-08-09 14:21:07,079 - Not downloading the file from http://Manager:8080/resources//, because /var/lib/ambari-agent/data/tmp/ already exists
2016-08-09 14:21:07,080 - Group['hadoop'] {'ignore_failures': False}
2016-08-09 14:21:07,080 - Group['users'] {'ignore_failures': False}
2016-08-09 14:21:07,081 - User['zookeeper'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,082 - User['ams'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,083 - User['ambari-qa'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['users']}
2016-08-09 14:21:07,084 - User['hdfs'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,085 - User['yarn'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,086 - User['mapred'] {'gid': 'hadoop', 'ignore_failures': False, 'groups': ['hadoop']}
2016-08-09 14:21:07,087 - File['/var/lib/ambari-agent/data/tmp/'] {'content': StaticFile(''), 'mode': 0555}
2016-08-09 14:21:07,088 - Execute['/var/lib/ambari-agent/data/tmp/ ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2016-08-09 14:21:07,093 - Skipping Execute['/var/lib/ambari-agent/data/tmp/ ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa'] due to not_if
2016-08-09 14:21:07,094 - Group['hdfs'] {'ignore_failures': False}
2016-08-09 14:21:07,094 - User['hdfs'] {'ignore_failures': False, 'groups': ['hadoop', 'hdfs']}
2016-08-09 14:21:07,095 - Directory['/etc/hadoop'] {'mode': 0755}
2016-08-09 14:21:07,096 - Creating directory Directory['/etc/hadoop']
2016-08-09 14:21:07,158 - Repository['HDP-2.3'] {'base_url': 'http://manager/REDHAT/HDP/HDP/centos6/2.x/updates/', 'action': ['create'], 'components': ['HDP', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP', 'mirror_list': None}
2016-08-09 14:21:07,170 - File['/etc/yum.repos.d/HDP.repo'] {'content': InlineTemplate(...)}
2016-08-09 14:21:07,171 - Writing File['/etc/yum.repos.d/HDP.repo'] because it doesn't exist
2016-08-09 14:21:07,172 - Repository['HDP-UTILS-'] {'base_url': 'http://manager/REDHAT/HDP/HDP-UTILS-', 'action': ['create'], 'components': ['HDP-UTILS', 'main'], 'repo_template': '[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0', 'repo_file_name': 'HDP-UTILS', 'mirror_list': None}
2016-08-09 14:21:07,176 - File['/etc/yum.repos.d/HDP-UTILS.repo'] {'content': InlineTemplate(...)}
2016-08-09 14:21:07,176 - Writing File['/etc/yum.repos.d/HDP-UTILS.repo'] because contents don't match
2016-08-09 14:21:07,177 - Package['unzip'] {}

Expert Contributor

i found the solution , using redhat without register is the problem its limit you to install yum utilities package so i change de OS and install the yum utilities needed by python 2.6 and its work .

View solution in original post


Master Mentor

what is the version of Ambari are you using?

Expert Contributor

Please help me


The error you're getting (ImportError: No module named rpm) is usually due to not having rpm-python installed. See the thread here for instructions on how to check and see if it is installed, and how to force a re-installation if necessary.

Expert Contributor

i didnt find any answer here please give me a correct answer or ssh command to do this


Looks like you are missing the rpm-python package. If yum is working you can try re-installing rpm-python with yum. Alternatively, depending on the version of CentOS or RHEL that you are using, you can find the appropriate RPM in the OS archives. For example, CentOS 6 RPMs are here. Ctrl-f and search for rpm-python to find the package.

Expert Contributor

im using REDHAT 6.8 can you give me from where can i download this package ?

Master Mentor

@Mourad Chahri can you run the following command

repoquery --requires --resolve ambari-agent | grep rpm-python

and also provide the version of ambari-agent and server you're running

rpm -qa | grep ambari

if you're missing rpm-python module then you can install it using

yum install rpm-python

I am curious though how you have agent running and missing this module?

Expert Contributor

ok @Artem Ervits i will try tomorrow on the office

Expert Contributor

when i execute :

repoquery --requires --resolve ambari-agent | grep rpm-python

i have this :

[root@Manager ~]# repoquery --requires --resolve ambari-agent | grep rpm-python Traceback (most recent call last): File "/usr/bin/repoquery", line 34, in <module> import yum ImportError: No module named yum

[root@Manager ~]# rpm -qa | grep ambari ambari-agent-2.1.0-1470.x86_64 ambari-server-2.1.0-1470.x86_64 [root@Manager ~]# yum install rpm-python bash: /usr/bin/yum: /usr/bin/python2.6: bad interpreter: No such file or directory