Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMBARI-22966] ambari-agent fails to start (dgrinenko) #330

Merged

Conversation

hapylestat
Copy link
Contributor

What changes were proposed in this pull request?

RM wildcard module resolving cased sudo module to be imported twice, causing circular import issue. Moving sudo import inside function will help to broke circular import chain.

How was this patch tested?

Before:

# ambari-agent start
Verifying Python version compatibility...
Using python  /usr/bin/python
Checking for previously running Ambari Agent...
Checking ambari-common dir...
Starting ambari-agent
Verifying ambari-agent process status...
ERROR: ambari-agent start failed. For more details, see /var/log/ambari-agent/ambari-agent.out:
====================
  File "/usr/lib/ambari-agent/lib/resource_management/__init__.py", line 23, in <module>
    from resource_management.libraries import *
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/__init__.py", line 23, in <module>
    from resource_management.libraries.functions import *
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/__init__.py", line 48, in <module>
    from resource_management.libraries.functions.log_process_information import *
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/log_process_information.py", line 22, in <module>
    from ambari_commons.shell import shellRunner
ImportError: cannot import name shellRunner
====================
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log

After:

# ambari-agent start
Verifying Python version compatibility...
Using python  /usr/bin/python
Checking for previously running Ambari Agent...
Checking ambari-common dir...
Starting ambari-agent
Verifying ambari-agent process status...
Ambari Agent successfully started
Agent PID at: /var/run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log

@hapylestat hapylestat self-assigned this Feb 12, 2018
@hapylestat hapylestat added the ambari-commons Ambari Common & Resource manager python libraries label Feb 12, 2018
@hapylestat hapylestat changed the title AMBARI-22966 ambari-agent fails to start (dgrinenko) [AMBARI-22966] ambari-agent fails to start (dgrinenko) Feb 12, 2018
@asfgit
Copy link

asfgit commented Feb 12, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/546/
Test FAILed.
Test FAILured.

@hapylestat
Copy link
Contributor Author

retest this please

@asfgit
Copy link

asfgit commented Feb 13, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/552/
Test FAILed.
Test FAILured.

@hapylestat
Copy link
Contributor Author

Ignoring test result as python tests passed. Java deadlock test have no relation to this patch

@hapylestat hapylestat merged commit 7f9a9b4 into apache:branch-2.6 Feb 13, 2018
@hapylestat hapylestat deleted the in-work/branch-2.6/AMBARI-22966 branch February 13, 2018 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ambari-commons Ambari Common & Resource manager python libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants