Support Questions

Find answers, ask questions, and share your expertise

HostCleanup.py failing

avatar
Super 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

avatar
Master 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

avatar
Master 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

.

avatar
Super 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 .