Support Questions
Find answers, ask questions, and share your expertise

TypeError: 'int' object has no attribute '__getitem__'

Contributor

After deploying through Install Wizard I get the error message

  • stderr: `/var/lib/ambari-agent/data/errors-91.txt`
Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-START/scripts/hook.py", line 39, in <module>
    BeforeStartHook().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 219, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-START/scripts/hook.py", line 28, in hook
    import params
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py", line 158, in <module>
    ambari_db_rca_password = config['hostLevelParams']['ambari_db_rca_password'][0]
TypeError: 'int' object has no attribute '__getitem__'
  • stdout: `/var/lib/ambari-agent/data/output-91.txt`
2016-06-15 19:06:59,609 - The hadoop conf dir /usr/hdp/current/hadoop-client/conf exists, will call conf-select on it for version 2.4.2.0-258
2016-06-15 19:06:59,609 - Checking if need to create versioned conf dir /etc/hadoop/2.4.2.0-258/0
2016-06-15 19:06:59,609 - call['conf-select create-conf-dir --package hadoop --stack-version 2.4.2.0-258 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False, 'stderr': -1}
2016-06-15 19:06:59,634 - call returned (1, '/etc/hadoop/2.4.2.0-258/0 exist already', '')
2016-06-15 19:06:59,634 - checked_call['conf-select set-conf-dir --package hadoop --stack-version 2.4.2.0-258 --conf-version 0'] {'logoutput': False, 'sudo': True, 'quiet': False}
2016-06-15 19:06:59,662 - checked_call returned (0, '')
2016-06-15 19:06:59,662 - Ensuring that hadoop has the correct symlink structure
2016-06-15 19:06:59,662 - Using hadoop conf dir: /usr/hdp/current/hadoop-client/conf

I ticked all packages and services that didn't start are: Atlas Metadata, DataNode, Metrics Monitor and Zookeper.

Thanks in advance!

2 REPLIES 2

New Contributor

I got stuck by this bug for several days, then finally slove it by google.

examine the stderr carefully, the problem lies in /var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py. It causes zookeeper fali to start. So other services also failed consequently.

SOLUTION:

change params.py from line 155-158 on all the hosts in your cluster to :

ambari_db_rca_url = config['hostLevelParams']['ambari_db_rca_url']
ambari_db_rca_driver = config['hostLevelParams']['ambari_db_rca_driver']
ambari_db_rca_username = config['hostLevelParams']['ambari_db_rca_username']
ambari_db_rca_password = config['hostLevelParams']['ambari_db_rca_password']

the original author post is here:

http://andersonjo.github.io/hadoop/2015/09/08/Hortonworks-Hadoop/

GOOD LUCK

Guru

Hello,

Which version of Ambari are you currently running? And was this was not an upgrade, correct (i.e. clean install from scratch)?

Thanks,

Jeff