Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 09-12-2016 01:24 AM
Environmennt: CentOS7
I manually installed the ambari-agent older version (2.2.2.0) and found out it's the wrong version I needed. Then I ran yum to remove it. I updated the repo so I now downloaded and installed the correct version 2.4.0.1.
However, when I ran "ambari-agent start", it showed the following error:
Verifying Python version compatibility... Using python /usr/bin/pythonChecking for previously running Ambari Agent... Starting ambari-agentVerifying ambari-agent process status... ERROR: ambari-agent start failed. For more details, see /var/log/ambari-agent/ambari-agent.out: ==================== Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/ambari_agent/AmbariAgent.py", line 24, in <module> from Controller import AGENT_AUTO_RESTART_EXIT_CODE File "/usr/lib/python2.6/site-packages/ambari_agent/Controller.py", line 41, in <module> from ambari_agent.ActionQueue import ActionQueue File "/usr/lib/python2.6/site-packages/ambari_agent/ActionQueue.py", line 37, in <module> from ambari_commons.str_utils import split_on_chunks ImportError: cannot import name split_on_chunks ====================
The /var/log/ambari-agent/ambari-agent.out shows the same error above.
Seems that I can't cleanly remove the dependencies that installed with the previous version. Even when I tried ambari-agent reset, the same error happened and said "ImportError: cannot import name split on chunks".
How to resolve this problem?
Many thanks!
Created 09-12-2016 04:02 AM
I did one more thing to
rm -rf /usr/lib/python2.6/site-packages yum remove ambari-agent yum install ambari-agent -y
It worked. The ambari-agent start completed successfully.
Created 09-12-2016 01:33 AM
@William Li do the following, review the errors in /var/log/ambari-agent then if nothing is obvious go with next steps below
yum erase ambari-agent rm -rf /var/lib/ambari-agent rm -rf /var/log/ambari-agent rm -rf /usr/lib/python2.6/site-packages/ambari_agent yum install -y ambari-agent
there may be other residual directories to remove but once you clean all, reinstall and try again.
Created 09-12-2016 02:20 AM
Thanks a lot Artem for the quick response. Tried your steps and still has the exact error above. However, this time it has one extract line of error message:
File "/usr/lib/python2.6/site-packages/ambari_agent/HeartbeatHandlers.py", line 21, in <module>
from ambari_commons.exceptions import FatalException
ImportError: No module named ambari_commons.exceptionsChecked the logs and there are nothing else other than this above error.
Created 09-12-2016 04:03 AM
Please see my comment below to remove the entire site-packages. After that, it worked!
Created 09-12-2016 04:02 AM
I did one more thing to
rm -rf /usr/lib/python2.6/site-packages yum remove ambari-agent yum install ambari-agent -y
It worked. The ambari-agent start completed successfully.
Created 09-12-2016 11:37 AM
Great job!
Created 09-22-2016 11:31 PM
You should not do "rm -rf /usr/lib/python2.6/site-packages" as this affects to other python scripts, such as "yum"
This issue would be caused if you install ambari-server or /usr/lib/python2.6/site-packages/ambari_commons/str_utils.py is not a right one.
Please make sure "/usr/lib/python2.6/site-packages/ambari_commons" is a symlink to /usr/lib/ambari-agent/lib/ambari_commons
Created 02-22-2017 08:49 AM
I had same problem on other than master nodes, you have to update ambari-server on each node even if you are not running server on each one.