Member since
12-13-2017
1
Post
3
Kudos Received
0
Solutions
12-13-2017
01:05 PM
3 Kudos
Hi, Rahul Narayanan Have you resolved your problem? I met the same appearance with you when I was installing Ambari 2.6 on Centos7.1; my OS information is listing below : CentOS Linux release 7.1.1503 (Core) Linux edgeserver 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux when step 3 was running, I got an error on ambari agent node in file /var/lib/ambari-agent/data/output-107.txt, 2017-12-12 15:05:42,610 - Host checks started. 2017-12-12 15:05:42,610 - Check execute list: last_agent_env_check,installed_packages,existing_repos,transparentHugePage
2017-12-12 15:05:42,610 - Last Agent Env check started. 2017-12-12 15:05:42,699 - Last Agent Env check completed successfully. 2017-12-12 15:05:42,699 - Installed packages and existing repos checks started. 2017-12-12 15:05:45,881 - There was an unknown error while checking installed packages and existing repositories: list index out of range
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 170, in actionexecute
installed_packages, repos = self.execute_existing_repos_and_installed_packages_check(config)
File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 234, in execute_existing_repos_and_installed_packages_check
availablePackages = self.pkg_provider.all_available_packages()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 210, in all_available_packages
return self._get_available_packages(None)
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 146, in _get_available_packages
return self._lookup_packages(cmd, 'Available Packages')
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py", line 191, in _lookup_packages
if items[i + 2].find('@') == 0:
IndexError: list index out of range 2017-12-12 15:05:45,882 - Transparent huge page check started.
2017-12-12 15:05:45,884 - Transparent huge page check completed.
2017-12-12 15:05:45,885 - Host checks completed. I fixed this issue by modifying code, '/usr/lib/python2.6/site-packages/resource_management/core/providers/package/yumrpm.py'; original code : def _lookup_packages(self, command, skip_till):
"""
:type command list[str]
:type skip_till str|None
"""
packages = []
result = self._call_with_timeout(command)
if result and 0 == result['retCode']:
lines = result['out'].split('\n')
lines = [line.strip() for line in lines]
items = []
if skip_till:
skip_index = 3
for index in range(len(lines)):
if skip_till in lines[index]:
skip_index = index + 1
break
else:
skip_index = 0
for line in lines[skip_index:]:
items = items + line.strip(' \t\n\r').split()
for i in range(0, len(items), 3):
if '.' in items[i]:
items[i] = items[i][:items[i].rindex('.')]
if items[i + 2].find('@') == 0:
items[i + 2] = items[i + 2][1:]
packages.append(items[i:i + 3])
return packages modified code : def _lookup_packages(self, command, skip_till):
"""
:type command list[str]
:type skip_till str|None
"""
packages = []
result = self._call_with_timeout(command)
if result and 0 == result['retCode']:
lines = result['out'].split('\n')
lines = [line.strip() for line in lines]
items = []
if skip_till:
skip_index = 3
for index in range(len(lines)):
if skip_till in lines[index]:
skip_index = index + 1
break
else:
skip_index = 0
for line in lines[skip_index:]:
items = items + line.strip(' \t\n\r').split()
for i in range(0, len(items), 3):
if '.' in items[i]:
items[i] = items[i][:items[i].rindex('.')]
if i + 2 < len(items) :
if items[i + 2].find('@') == 0:
items[i + 2] = items[i + 2][1:]
packages.append(items[i:i + 3])
return packages Wish this will be helpful for you! Thanks!
... View more