Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Install and Test Kerberos client failed on Ambari due to indentation error at ../stacks/HDP/2.6/services/stack_advisor.py, line 69

avatar

HDP 2.6.4.0 on RHEL 7

While enabling Kerberos the client install failed with the below error:

Error occured in stack advisor. Error details: unindent does not match any outer indentation level (stack_advisor.py, line 69) 21 Dec 2018 17:14:53,092 INFO [Server Action Executor Worker 3279] StackAdvisorRunner:71 - advisor script stderr: Traceback (most recent call last): File "/var/lib/ambari-server/resources/scripts/stack_advisor.py", line 173, in <module> main(sys.argv) File "/var/lib/ambari-server/resources/scripts/stack_advisor.py", line 103, in main stackAdvisor = instantiateStackAdvisor(stackName, stackVersion, parentVersions) File "/var/lib/ambari-server/resources/scripts/stack_advisor.py", line 154, in instantiateStackAdvisor stack_advisor = imp.load_module('stack_advisor_impl', fp, path, ('.py', 'rb', imp.PY_SOURCE)) File "/var/lib/ambari-server/resources/scripts/./../stacks/HDP/2.6/services/stack_advisor.py", line 69 if streamline_env: ^ IndentationError: unindent does not match any outer indentation level 21 Dec 2018 17:14:53,092 WARN [Server Action Executor Worker 3279] ServerActionExecutor:459 - Task #3279 failed to complete execution due to thrown exception: org.apache.ambari.server.AmbariException:Stack Advisor reported an error: IndentationError: unindent does not match any outer indentation level

Any help to resolve this issue is highly appreciated.

1 ACCEPTED SOLUTION

avatar

Hi @Rajeswaran Govindan ,

File "/var/lib/ambari-server/resources/scripts/./../stacks/HDP/2.6/services/stack_advisor.py", line 69 if streamline_env: ^ IndentationError: unindent does not match any outer indentation level

From the error it looks like someone has edited this python file and the python indentation was not kept correctly as it should be.

can you do a ls -lh on the folder /var/lib/ambari-server/resources/scripts/./../stacks/HDP/2.6/services/ and see the timestamp difference.

If my assumption is correct you are using ambari-2.6.2 and below is the apache ambari code of stack_advisor.py for this version . please compare it with yours and correct the mistake.

https://github.com/apache/ambari/blob/release-2.6.2/ambari-server/src/main/resources/stacks/HDP/2.6/...

Please accept this answer if its helpful

View solution in original post

5 REPLIES 5

avatar
Super Collaborator

Hi Rajeswaran,

I guess you are just using Ambari? Or have you implemented some own Python code anywhere? Can you perhaps post what some details on what action you are trying to execute?

Regards
Harald

avatar

Hi @Rajeswaran Govindan ,

File "/var/lib/ambari-server/resources/scripts/./../stacks/HDP/2.6/services/stack_advisor.py", line 69 if streamline_env: ^ IndentationError: unindent does not match any outer indentation level

From the error it looks like someone has edited this python file and the python indentation was not kept correctly as it should be.

can you do a ls -lh on the folder /var/lib/ambari-server/resources/scripts/./../stacks/HDP/2.6/services/ and see the timestamp difference.

If my assumption is correct you are using ambari-2.6.2 and below is the apache ambari code of stack_advisor.py for this version . please compare it with yours and correct the mistake.

https://github.com/apache/ambari/blob/release-2.6.2/ambari-server/src/main/resources/stacks/HDP/2.6/...

Please accept this answer if its helpful

avatar

Thank you Akil and Harald Berghoff,

I could resolve the indentation issues on stack_advisor.py and get past that error. No I face a permission issue at the "kerberise cluster" stage in Ambari. The error is:

Task #4945 failed to complete execution due to thrown exception: org.apache.ambari.server.AmbariException:chown: changing ownership of ‘/etc/security/keytabs/spnego.service.keytab’: Operation not permitted

Ambar is running as a non-root user and the owner of spnego.service.keytab is a ambari user and not a root user. Not sure o what user it is trying to change and what permission is required.

avatar

The keytab file, /etc/security/keytabs/spnego.service.keytab is created and is owned by non-root user. The .csv file shows it has to be owned by root:hadoop and the non-root user is not able to do chown due to OS restrictions. How to get around this limitation ?

Can the Ambari-server be changed to run as root user from non-root user at this point? If so, what are the steps? Any suggestion is welcome.

avatar

Hi @Rajeswaran Govindan ,

Can you please login and accept the best answer to resolve this thread.

and Create a new thread for this new issue you are facing.

Accepting the best answer helps other community users to figure out the answer correctly.