Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

ambari-server setup error 'cannot import name parse_log4j_file'

avatar
Visitor

I am installing HDP-2.5.0.0

When I setup the ambari-server, i have an error as follows:

Using python /usr/bin/python Setup ambari-server Traceback (most recent call last): File "/usr/sbin/ambari-server.py", line 33, in <module> from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 28, in <module> from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 36, in <module> from ambari_commons.os_utils import run_os_command, search_file, set_file_permissions, parse_log4j_file ImportError: cannot import name parse_log4j_file

The command is : ambari-server setup -j /usr/local/cloud/java/jdk1.8.0_65 --jdbc-driver=/usr/share/java/mysql-connector-java.jar --jdbc-db=mysql -v -g

9603-3error.png

My ambari-server's version is 2.4.1.0,installed from http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.4.1.0

9602-1error.png

My python is 2.6.6

9604-2error.png

So why does it show "ImportError: cannot import name parse_log4j_file", i haven't met it in previous hdp version

Wait for your reply, thanks

1 ACCEPTED SOLUTION

avatar
Master Mentor

try to reinstall Ambari after you uninstall it, delete any ambari-server directories and especially remove the following directory /usr/lib/python2.6/site-packages/ambari_server

View solution in original post

8 REPLIES 8

avatar
Master Mentor

try to reinstall Ambari after you uninstall it, delete any ambari-server directories and especially remove the following directory /usr/lib/python2.6/site-packages/ambari_server

avatar
Visitor

ok, i will try it

appreciate reply

avatar
Visitor

thank you Artem

It worked

avatar
New Member

in my case, version of Ambari and Python mismatched, I installed a lower version of Ambari and it started to work

avatar
Rising Star

Hi @Artem Ervits, I am facing similar issue while setting up ambari server v2.4.1.0 and python 2.6.6. I tried to uninstall and made sure /usr/lib/python2.6/site-packages/ambari_server is cleaned but still issue exists. Can you please let me know what else can be done to resolve this issue.

Traceback (most recent call last): File "/usr/sbin/ambari-server.py", line 33, in <module> from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST File "/usr/lib/python2.6/site-packages/ambari_server/dbConfiguration.py", line 28, in <module> from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, \ File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", line 36, in <module> from ambari_commons.os_utils import run_os_command, search_file, set_file_permissions, parse_log4j_file ImportError: cannot import name parse_log4j_file

avatar
Rising Star

I also tried deploying ambari version 2.4.2.0 and also in different environement, still seeing the same issue.

avatar
Master Mentor
@Saikiran Parepally

please open this as a new HCC question not to hijack the current thread.

avatar
Rising Star