Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

HostCleanup.py failing

Solved Go to solution

HostCleanup.py failing

Master Collaborator

i am trying to cleanup the existing cluster for new install but this script fails with the following error:

[root@hadoop1 ambari_agent]# python HostCleanup.py --help
  File "HostCleanup.py", line 111
    except Exception, err:
                    ^
SyntaxError: invalid syntax
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: HostCleanup.py failing

Super Mentor

@Sami Ahmad Which exact version of ambari are you using?

I do not see any matching line at 111 on that script of Ambari 2.2.2 / 2.4.0/ 2.4.2/ 2.5.0 versions of API.

https://github.com/apache/ambari/blob/release-2.5.0/ambari-agent/src/main/python/ambari_agent/HostCl...

https://github.com/apache/ambari/blob/release-2.4.2/ambari-agent/src/main/python/ambari_agent/HostCl...

https://github.com/apache/ambari/blob/release-2.2.2/ambari-agent/src/main/python/ambari_agent/HostCl...

- I see line 111 is empty. (So i am suspecting that the script that you are using might be slightly changed/edited).

16409-line-111.png

So by any chance have you made any modification to this script?

# /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py

.

- What is your python version?

- If you continue to face this issue then it will be quick to "Uninstall ambari-agent" and then install it back after manually cleaning up the agent directories.

# yum remove ambari-agent 
# yum install ambari-agent

.

View solution in original post

2 REPLIES 2
Highlighted

Re: HostCleanup.py failing

Super Mentor

@Sami Ahmad Which exact version of ambari are you using?

I do not see any matching line at 111 on that script of Ambari 2.2.2 / 2.4.0/ 2.4.2/ 2.5.0 versions of API.

https://github.com/apache/ambari/blob/release-2.5.0/ambari-agent/src/main/python/ambari_agent/HostCl...

https://github.com/apache/ambari/blob/release-2.4.2/ambari-agent/src/main/python/ambari_agent/HostCl...

https://github.com/apache/ambari/blob/release-2.2.2/ambari-agent/src/main/python/ambari_agent/HostCl...

- I see line 111 is empty. (So i am suspecting that the script that you are using might be slightly changed/edited).

16409-line-111.png

So by any chance have you made any modification to this script?

# /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py

.

- What is your python version?

- If you continue to face this issue then it will be quick to "Uninstall ambari-agent" and then install it back after manually cleaning up the agent directories.

# yum remove ambari-agent 
# yum install ambari-agent

.

View solution in original post

Highlighted

Re: HostCleanup.py failing

Master Collaborator

thanks Jay , reinstalling agent fixed this script.

I will go ahead and deinstall the cluster using this script and then try to reinstall again.

my cluster was running f ine until I deinstalled it and since then I am unable to get it up and running .

Don't have an account?
Coming from Hortonworks? Activate your account here