Support Questions

Find answers, ask questions, and share your expertise

Python errors or script does not Exist while installing Cluster Services in Ambari

avatar

I'm getting below issue while installing services using Ambari2.1.2

File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 87, in action_create

raise Fail("Applying %s failed, parent directory %s doesn't exist" % (self.resource, dirname))

resource_management.core.exceptions.Fail: Applying File['/var/lib/ambari-agent/tmp/changeUid.sh'] failed, parent directory /var/lib/ambari-agent/tmp doesn't exist

Error: Error: Unable to run the custom hook script ['/usr/bin/python2.6', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/command-992.json', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/structured-out-992.json', 'INFO', '/var/lib/ambari-agent/tmp']

/var/lib/ambari-agent/tmp does exist
1 ACCEPTED SOLUTION

avatar

This is usually a case when an old repo was installed first and was not cleaned before trying to install Ambari 2.1.2.

You need to clean everything and reinstall. Because of the old repos that exist, some python scripts would be old and others missing.

Clean the repos.

yum repolist | grep ambari

yum clean all

yum clean dbcache

yum clean metadata

yum makecache

rpm —rebuilddb

yum history new

If there are other repos beside Ambari 2.1.2 or the version you desire, remove it.

ambari-server stop

ambari-server reset

ambari-agent stop

rm -rf /etc/yum.repos.d/ambari.repo

yum erase ambari-server and/or yum erase ambari-agent

Then get the right repos and download on all nodes. Go to doc for your OS. Ambari 2.1.2

wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.2/ambari.repo -O /etc/yum.repos.d/ambari.repo

Then follow these instructions to complete cleanup

Completely Clean and Reinstall Ambari

View solution in original post

7 REPLIES 7

avatar

Which HDP stack is this on?

What operation was it trying to perform?

Is this location present and writeable, /var/lib/ambari-agent/tmp ? If running ambari agent as root, it should have 777 and owned by root:root

avatar

@afernandez@hortonworks.com Its HDP stack: HDP2.3.2, Ambari2.1.2 fresh install. Ambari is running with non-root user.

/var/lib/ambari-agent/tmp has ownership 777 root:root

Operation I am performing to setup HDP cluster and it fails with issues during services install - Ambari cluster install wizard Step9.

avatar

This is usually a case when an old repo was installed first and was not cleaned before trying to install Ambari 2.1.2.

You need to clean everything and reinstall. Because of the old repos that exist, some python scripts would be old and others missing.

Clean the repos.

yum repolist | grep ambari

yum clean all

yum clean dbcache

yum clean metadata

yum makecache

rpm —rebuilddb

yum history new

If there are other repos beside Ambari 2.1.2 or the version you desire, remove it.

ambari-server stop

ambari-server reset

ambari-agent stop

rm -rf /etc/yum.repos.d/ambari.repo

yum erase ambari-server and/or yum erase ambari-agent

Then get the right repos and download on all nodes. Go to doc for your OS. Ambari 2.1.2

wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.2/ambari.repo -O /etc/yum.repos.d/ambari.repo

Then follow these instructions to complete cleanup

Completely Clean and Reinstall Ambari

avatar
Master Mentor

I would also clean /usr/lib/python2.6/site-packages/ for any residual ambari-specific python files, specifically symlinks. It's a common problem, though, error is different.

avatar
New Contributor

I ran into a very similar issue with the same error message. I could only diagnose it by diving into the python scripts of the resource_management module, and let it dump more information to stdout.

In our case, it was not due to stale versions. Our cluster uses a non-root installation of Ambari, but somehow, the node where a service failed to start ended up having an incorrect sudoers configuration (in particular: the "Defaults: ambari !requiretty" line was missing). This caused the directory existence test to fail with the message "sudo: sorry, you must have a tty to run sudo", but the script does not distinguish between the nonzero exit status of 'test' and the nonzero exit status of 'sudo'.

The solution was to properly configure sudo. After doing so, the service could start.

avatar
New Contributor

Error: Error: Unable to run the custom hook script ['/usr/bin/python', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/command-247.json', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/structured-out-247.json', 'INFO', '/var/lib/ambari-agent/tmp', 'PROTOCOL_TLSv1', '']

Please some one help me for the above error message and suggest . Thanks in advance , kishore Jannu

,

I m Experiencing the same issues kindly suggest what did you change . Im getting the below error . Please some assist me

Error: Error: Unable to run the custom hook script ['/usr/bin/python', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py', 'ANY', '/var/lib/ambari-agent/data/command-247.json', '/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY', '/var/lib/ambari-agent/data/structured-out-247.json', 'INFO', '/var/lib/ambari-agent/tmp', 'PROTOCOL_TLSv1', '']

avatar

Hi @Kishore Jannu,

Its better to create a new thread on this one.

this original question used to be for very old ambari version.

When you are raising a new thread Please post the exception in code format

I am code format