-
Notifications
You must be signed in to change notification settings - Fork 199
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
sudo fails intermittently #726
Comments
Do you have a minimal playbook that I can use to reproduce the error? Also, which Python and OS are you running for both host and target node? |
I can reproduce it even by running setup module via ansible command: |
Does it work with Ansible 2.9.6? Also, does it work with vanilla Ansible 2.9.6? |
I work in the same environment as @yhal003 but with different playbooks and I see the same with Ansible 2.9.9
I enable the mitogen strategies in my
And specify strategy and python interpreter in my plays:
So when it tries to run on the client we see (this task is just comparing
|
The main thing I notice is that mitogen is still using
I fixed the previous example to represent this 😸 |
@Aethylred which version of Mitogen are you using? If you're using latest |
I'm using |
I think Confirmed from my bash history:
|
Can you try |
I've updated to master as requested, and it seems more reliable, however I've also extended timeout to 60s and set retries to 3.
|
Adding this sudo rule makes it intermittent (sudo rules with wildcards are very bad):
So does adding the following sudo rule to our IPA server
However, we consider this to be a terrible idea and would rather that mitogen properly uses become passwords. |
I've done some tests with v0.3.0rc1 and this issue persists. |
A less risky sudo rule is:
Though you probably want to create a command group with all the Python executables you would like Ansible to use. |
I can confirm the issue. I encountered it with:
Reverting to mitogen 0.3.3 resolved the issue. |
Which version of Ansible are you running? ansible 2.9.9
Is your version of Ansible patched in any way? no
Are you running with any custom modules, or
module_utils
loaded? noHave you tried the latest master version from Git? yes
ansible playbook, when run with mitogen, fails with incorrect sudo password about half the time. There is no apparent pattern in failures, but if I use --become-ask-pass instead of passing the password in ansible_become_pass it always works. ansible without mitogen always works.
fatal: hostname]: FAILED! => {"msg": "error occurred on host hostname: sudo password is incorrect"}
When it fails, I see the following in the logs:
[mux 14109] 04:42:19.919785 D mitogen.parent.[ssh.hostname]: command line for Connection(None): sudo -u root -H -- /usr/bin/python -c "import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqFkc1OwzAQhO95itxsqyZ1UhA0kiVQD4gDQooQOUCF8uO0htS2nKSmfXq2KaJJOXDztzv2jDwJTbluAiONwMSz1A1IVj5Ape0nJrF3OJediTCjIWPkxAkdkoVteOS i1o3AyRDsENIhOAAwbHZgX2ctuG58zn1UZtZJhfxMlf1SfImia7O8Fv162jV2mks1Nbt2rRWCnOeyCe8nW2EbqdVrPFv2tkJtpQVGd8n9C0NLPr521ADWeLygY5wgvJGtXgkVf3QQQth1l19oI+zt2hTuNGOzAAZVoEQjA21 XgdrH0fwyuiGIeODlrGwFDil6fHh+Yoy9KQQZC11CFcRb8Hd8KKOElxVUgGyOSGBFVuLwml3NCUV7aeClyvCTLqXI5ejQT2V+DBb9+fjnZ2r3n/pvynCc8rfNiHwDNPLAOw==\".encode(),\"base64\"),\"zip\"))" [mux 14109] 04:42:19.924882 D mitogen.parent.[ssh.hostname]: child for Connection(None) started: pid:29457 stdin:18 stdout:18 stderr:16 [mux 14109] 04:42:20.280717 D mitogen.parent.[ssh.hostname]: sudo.root: (partial): [sudo] password for username: [mux 14109] 04:42:20.280924 D mitogen.sudo.[ssh.hostname]: sudo.root: (password prompt): [sudo] password for username: [mux 14109] 04:42:20.281058 D mitogen.parent.[ssh.hostname]: sudo.root: (partial): [sudo] password for username: * [mux 14109] 04:42:20.281206 D mitogen.sudo.[ssh.hostname]: sudo.root: (password prompt): [sudo] password for username: * [mux 14109] 04:42:20.281328 D mitogen.parent.[ssh.hostname]: failing connection sudo.root due to PasswordError(u'sudo password is incorrect',) [mux 14109] 04:42:20.281445 D mitogen.[ssh.hostname]: BootstrapProtocol(sudo.root): disconnecting [mux 14109] 04:42:20.281581 D mitogen.parent.[ssh.hostname]: failing connection sudo.root due to EofError(u'EOF on stream; last 100 lines rece ived:\n',) [mux 14109] 04:42:20.281728 D mitogen.parent.[ssh.hostname]: PopenProcess sudo.root pid 29457 still running after IO disconnect, recheck in 0. 050s [mux 14109] 04:42:20.281839 D mitogen.[ssh.hostname]: SetupProtocol(sudo.root): disconnecting [mux 14109] 04:42:20.281968 D mitogen.[ssh.hostname]: SetupProtocol(sudo.root): disconnecting [mux 14109] 04:42:20.282231 D mitogen.[ssh.hostname]: Dispatcher: Message(1004, 0, 0, 101, 1003, '\x80\x02(NX\x0e\x00\x00\x00mitogen.parentq\x 00NX\x0e\x00\x00\x00_proxy_connectq\x01)cm'..465) -> {u'msg': 'error occurred on host hostname: sudo password is incorrect', u'id': None, u'nam e': None}
When it succeeds I see:
[mux 15321] 04:48:10.238979 D mitogen.parent.[ssh.hostname]: command line for Connection(None): sudo -u root -H -- /usr/bin/python -c "import codecs,os,sys;_=codecs.decode;exec(_(_(\"eNqFkc1OwzAQhO95itzWVk3qtKKISJZAPSAOCClC9FAqlB+nNaS25SQN7dOzTRFNyoGbv92xZ+SJ2UKYKrDKSkI9x9oeqcJHKIz7JDTyjue8sRPCWcg5PXPM+uRwG544K00lSdwH14dFH1oENKz2aF8mNbpufSF8yBPXKg1+ovNuKb9k1tRJWspuPW4qN06VHtt9vTEaMOelbCS6yU66Shm9jKarzlbqnXLIcB8/vHJYieG1kwaxJMMFG+IIyFbVZi119NFgCOk2TXplrHR3G5u15xmfBjgoAi0rFRi3DvQhmvLZZEaBeujVOlVLEjJ4enx55py/acCMmcmxCurNxTs5lpHjyxorAJcCDZxMchLe8OtbyuCgLL5UWHHWLRi0KRz7KeyPwbw7n/78Qt3+p/6bMhym/G1zQr8BLifAMw==\".encode(),\"base64\"),\"zip\"))" [mux 15321] 04:48:10.243668 D mitogen.parent.[ssh.hostname]: child for Connection(None) started: pid:30655 stdin:18 stdout:18 stderr:16 [mux 15321] 04:48:10.506317 D mitogen.parent.[ssh.hostname]: sudo.root: (partial): [sudo] password for username: [mux 15321] 04:48:10.506610 D mitogen.sudo.[ssh.hostname]: sudo.root: (password prompt): [sudo] password for username: [mux 15321] 04:48:10.506774 D mitogen.parent.[ssh.hostname]: sudo.root: (unrecognized): [sudo] password for username: *****************
The text was updated successfully, but these errors were encountered: