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.

ambari-server setup error 'cannot import name parse_log4j_file'

Solved Go to solution

ambari-server setup error 'cannot import name parse_log4j_file'

New Contributor

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

Accepted Solutions

Re: ambari-server setup error 'cannot import name parse_log4j_file'

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

8 REPLIES 8

Re: ambari-server setup error 'cannot import name parse_log4j_file'

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

Re: ambari-server setup error 'cannot import name parse_log4j_file'

New Contributor

ok, i will try it

appreciate reply

Re: ambari-server setup error 'cannot import name parse_log4j_file'

New Contributor

thank you Artem

It worked

Re: ambari-server setup error 'cannot import name parse_log4j_file'

New Contributor

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

Highlighted

Re: ambari-server setup error 'cannot import name parse_log4j_file'

Contributor

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

Re: ambari-server setup error 'cannot import name parse_log4j_file'

Contributor

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

Re: ambari-server setup error 'cannot import name parse_log4j_file'

Mentor
@Saikiran Parepally

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

Re: ambari-server setup error 'cannot import name parse_log4j_file'

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