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

ERROR! Timeout (12s) waiting for privilege escalation prompt: #14426

Closed
chrisweaver opened this issue Feb 10, 2016 · 73 comments
Closed

ERROR! Timeout (12s) waiting for privilege escalation prompt: #14426

chrisweaver opened this issue Feb 10, 2016 · 73 comments
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release

Comments

@chrisweaver
Copy link
Contributor

Issue Type: Bug Report

Ansible Version: Ansible 2.0.0.2
Boto Version: 2.38.0
Python Version: 2.7.5
Environment: RHEL 7.2

Summary:
I am seeing the following error, at random times, on one really long playbook:

FAILED! => {"failed": true, "msg": "ERROR! Timeout (12s) waiting for privilege escalation prompt: "}

Running the same playbook under Ansible 1.9.4 I never saw this problem. It started happening when I upgraded to Ansible 2.0 RC1. Now we see it maybe one time out of three so I'm 90% sure it's related to Ansible 2.0.

It generally happens about 10 minutes into the play and rarely happens at the same task. The task itself doesn't matter -- it could be in a loop, not a loop, file copy, lineinefile, etc.

Failure means starting over so it would be really really nice to know what's going on. Can I at least increase that 12 sec timeout somehow?

I tried enabling SSH pipelining, thinking it would speed things up and skip over the issue, but it made no difference. It also didn't reduce the time of the playbook either, so I don't think it's actually working. I tried debug -vvvv and I didn't see anything obvious. How to tell if pipelining is active?

@J-Mx
Copy link

J-Mx commented Feb 11, 2016

Exactly the same problem for me 😟.

Ansible version : 2.0.0.2
Python Version : 2.7.6
Environment : Ubuntu 14.04

@diarworld
Copy link

I have same problem with:
Ansible version : 2.0.0.2
Environment : Ubuntu 14.04

@nitzmahone nitzmahone added bug_report P2 Priority 2 - Issue Blocks Release labels Feb 11, 2016
@bbyhuy
Copy link
Contributor

bbyhuy commented Feb 13, 2016

Same. Running into this during the very beginning at Setup Phase.
Ansible version : 2.0.0.2
Python Version : 2.7.6
Environment : Ubuntu 14.04

@bbyhuy
Copy link
Contributor

bbyhuy commented Feb 13, 2016

Just as a note, I switched the connection over to paramiko and the issue went away and the playbook ran fine. Seems to be an issue with the default OpenSSH implementation.

So for those who are having this issue, try using -c paramiko for now, until they fix this.

@bcoca
Copy link
Member

bcoca commented Feb 13, 2016

dupe of #14020

@bcoca bcoca closed this as completed Feb 13, 2016
@chrisweaver
Copy link
Contributor Author

The error message is not the same as #14020 and the circumstances I describe here are a lot more broad. But if you say they are the same, I won't argue.

@bcoca bcoca reopened this Feb 13, 2016
@bcoca
Copy link
Member

bcoca commented Feb 13, 2016

it is not exactly the same as this is on 'ssh' and the other using 'local' connection but i believe they are related to the rewritten 'prompt detection', still, will reopen this.

@amenonsen
Copy link
Contributor

Could someone please post an excerpt of a playbook where the problem occurs (I understand it occurs unpredictably; I'm not asking for a way to reproduce it, just some context), as well as output of a failing run with ANSIBLE_DEBUG=y and -vvvvv?

@nghnam
Copy link

nghnam commented Mar 4, 2016

I have the same problem with:
Ansible: 2.0.1.0-1ppa~precise
Ubuntu 12.04

# ansible 'web01' -m shell -a 'dmesg | tail -20' --become -vvvvv
Using /etc/ansible/ansible.cfg as config file
Loaded callback minimal of type stdout, v2.0
<web01> ESTABLISH SSH CONNECTION FOR USER: ansible
<web01> SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<web01> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<web01> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ansible)
<web01> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<web01> SSH: PlayContext set ssh_common_args: ()
<web01> SSH: PlayContext set ssh_extra_args: ()
<web01> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/user01/.ansible/cp/ansible-ssh-%h-%p-%r)
<web01> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/user01/.ansible/cp/ansible-ssh-%h-%p-%r web01 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-shpsnlhxruskuujwzskohueoshfyifah; /bin/sh -c '"'"'"'"'"'"'"'"'

web01 | FAILED | rc=0 >>
Timeout (12s) waiting for privilege escalation prompt:

Sometime it worked, but the most was FAILED.

@amenonsen
Copy link
Contributor

@nghnam Could you please paste output of a failing run with ANSIBLE_DEBUG=1 set in the environment?

@pauricthelodger
Copy link

# ansible-playbook playbooks/test.yaml -vvvv  
TASK [setup] *******************************************************************
<my.ip.address.com> ESTABLISH SSH CONNECTION FOR USER: my_remote_user
<my.ip.address.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r -o IdentitiesOnly=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o 'IdentityFile="/home/padraic/.ssh/my_totally_secure_identity_file"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=my_remote_user -o ConnectTimeout=10 my.ip.address.com '/bin/sh -c '"'"'sudo
 -i -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-jpxmltbgxmgjairqscynmjxlxpgbtotc; /bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python'"'"'"
'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''
fatal: [my.ip.address.com]: FAILED! => {"failed": true, "msg": "Timeout (12s) waiting for privilege escalation prompt: "}

Hey folks, similar error here on v2.0.1.0. -c paramiko suggested by @bbyhuy works every time but the @vutoff's disabling multiplexing suggestion in #13278 doesn't I'm afraid. Either way, I think one of these should be marked as a dupe of the other?

@oliver
Copy link

oliver commented Mar 19, 2016

Here's a debug log of ANSIBLE_DEBUG=y ansible all -m ping -vvvvv where the problem occurs: https://gist.github.com/oliver/e5a24a5b37c0006bb220

This is with Ansible 2.0.1.0-1ppaprecise on Ubuntu 12.04, connecting to a Debian 8.2 VM running on the local host (so network problems are unlikely). I'm using become=True and become_method=su, and have added the root password in the hostsfile with ansible_sudo_pass='pass'. This setup worked fine with Ansible 1.9.4-1ppaprecise.

Not sure if this report should go at #14426 or #13278, but since this error doesn't seem to be related to with_items at all (it happens with any simple playbook and even with -m ping), I posted it here.

@bcoca
Copy link
Member

bcoca commented Mar 20, 2016

@oliver in your case it seems a mismatch on expected output, Passwort: is not getting matched with the su i18n prompt handler.

@oliver
Copy link

oliver commented Mar 20, 2016

@bcoca Good catch (and a good argument against using i18n on a server)!
Unfortunately it still doesn't work if I set $LANG to an empty string and set the default locale on target system to None. I have updated the Gist and it now shows the "Password:" prompt which should be recognized but still leads to a timeout.

@bcoca
Copy link
Member

bcoca commented Mar 20, 2016

I believe the issues is on the 'su' prompt handling side (though it works for me in my tests).

@umesh936
Copy link

Still having the same issue (2.0.1.0), msg is

FAILED! => {"failed": true, "msg": "Timeout (12s) waiting for privilege escalation prompt: "}


My play book Configuration

  • hosts: dev-server

    become: yes

    become_user: root

    become_method: su

    *****************************************************************

    ouput of -vvvvv

ESTABLISH SSH CONNECTION FOR USER: ubuntu
SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ubuntu)
SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
SSH: PlayContext set ssh_common_args: ()
SSH: PlayContext set ssh_extra_args: ()
SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r)
SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt 52.76.16.117 '/bin/sh -c '"'"'( umask 22 && mkdir -p "echo $HOME/.ansible/tmp/ansible-tmp-1459250484.21-51977895368027" && echo "echo $HOME/.ansible/tmp/ansible-tmp-1459250484.21-51977895368027" )'"'"''
PUT /tmp/tmpMYXpV0 TO /home/ubuntu/.ansible/tmp/ansible-tmp-1459250484.21-51977895368027/setup
SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ubuntu)
SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
SSH: PlayContext set ssh_common_args: ()
SSH: PlayContext set sftp_extra_args: ()
SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r)
SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[machine1]'
ESTABLISH SSH CONNECTION FOR USER: ubuntu
SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
SSH: ANSIBLE_HOST_KEY_CHECKING/host_key_checking disabled: (-o)(StrictHostKeyChecking=no)
SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User=ubuntu)
SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
SSH: PlayContext set ssh_common_args: ()
SSH: PlayContext set ssh_extra_args: ()
SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r)
SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt machine1 '/bin/sh -c '"'"'su root -c /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-lubjqfumkxawkkgetezusnctthxkfpju; /bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1459250484.21-51977895368027/setup; rm -rf "/home/ubuntu/.ansible/tmp/ansible-tmp-1459250484.21-51977895368027/" > /dev/null 2>&1'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''


If i use sudo:yes , every thing working fine.

@Lowess
Copy link
Contributor

Lowess commented Apr 4, 2016

Running into this while running the setup phase against a freshly started Ubuntu 14.04 EC2 server.

When I run a second time the automation against the same server it works fine. It happens all the time when I first run an Ansible automation against a fresh server

Ansible version : 2.0.1.0
Python Version : 2.7.6
Environment : Ubuntu 14.04

I run the following command:

ANSIBLE_DEBUG=y ansible-playbook test.yaml -t configure -l <EC2_ID> -vvvvv

please see the following gist for the output: https://gist.github.com/Lowess/77442cf0533629e80b55faa7d6d91eb0

@somechris
Copy link

Can I at least increase that 12 sec timeout somehow?

The "12 sec timeout" is the timeout configuration setting + 2s (See ssh.py).

It's not a fix, but setting the timeout to 30 gave us a 32s escalation timeout which up to now was good enough (even for our slower AWS EC2 instances) to work around the bug.

@Lowess
Copy link
Contributor

Lowess commented Apr 6, 2016

@somechris I just tried your setting and it worked!

For some reason the setup phase takes around 20 - 25 secs. That is the first time I face this kind of issue while running Ansible against AWS. I still think there is an issue somewhere because with Ansible V1 I did not need to increase that timeout value.

Thanks again!

@amenonsen
Copy link
Contributor

I suspect the timeout just didn't work as intended in v1.

@Lowess
Copy link
Contributor

Lowess commented Apr 6, 2016

@amenonsen In that case all make sense to me now. Thanks for the precision.

@szhem
Copy link

szhem commented Apr 7, 2016

Same issue.

Ansible Host: Ubuntu 14.04
Managed Hosts: CentOS 7.2

Workaround described here has helped

pre_tasks:
  - name: disable fingerprint checking that may be enabled; when enabled, causes ssh issues
    command: authconfig --disablefingerprint --update
    become: yes

Symptoms were exactly the same (here is the syslog from centos hosts)

Apr  7 22:44:12 srv-01 python: ansible-file Invoked with directory_mode=None force=False remote_src=None path=/etc/connector owner=connector follow=False group=connector state=directory content=NOT_LOGGING_PARAMETER serole=None diff_peek=None setype=None selevel=None original_basename=None regexp=None validate=None src=None seuser=None recurse=False delimiter=None mode=None backup=None 
Apr  7 22:44:13 srv-01 dbus[703]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service'
Apr  7 22:44:13 srv-01 dbus-daemon: dbus[703]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service'
Apr  7 22:44:13 srv-01 systemd: start request repeated too quickly for fprintd.service
Apr  7 22:44:13 srv-01 systemd: Failed to start Fingerprint Authentication Daemon.
Apr  7 22:44:13 srv-01 systemd: fprintd.service failed.
Apr  7 22:44:38 srv-01 dbus[703]: [system] Failed to activate service 'net.reactivated.Fprint': timed out
Apr  7 22:44:38 srv-01 dbus-daemon: dbus[703]: [system] Failed to activate service 'net.reactivated.Fprint': timed out

@tomstaijen
Copy link

@szhem awesome, that fixed it for me!

authconfig --disablefingerprint --update

@JohanTan
Copy link

JohanTan commented May 9, 2016

Is there an equivalent command on ubnutu 14.04? Happening to us as well

@paulcalabro
Copy link

I needed to remove the -n flag, which was causing an issue with sudo'ing with no password.
Once I did that, this error then started to occur.
Per @davidmoshal 's comment, I changed become: yes to become: root and my issue went away.

@bcoca
Copy link
Member

bcoca commented Jul 19, 2017

become: root is incorrect, it does not set the user, but it ends up being a True value for become so it is really no change.

@travisdetert
Copy link

I can confirm that rolling back to ansible1.9 resolves all of my weird SSH connection issues. I don't know what is wrong with ansible2.x but I will not be upgrading any time soon since this seems to continue to persist. I've seen comments that this is not an ansible bug, and I firmly disagree. The only variable I've changed is an ansible upgrade. I manage over 70 servers with no issues with ansible1.9, ansible 2.0 fails with every instance I have. This is an ansible bug. Not ssh, or any other layer.

leseb added a commit to ceph/ceph-ansible that referenced this issue Sep 6, 2017
CI slaves are slow so by setting a higher value we can avoid the following error:
Timeout (12s) waiting for privilege escalation prompt:

Now we wait for 32 sec...

More info here: ansible/ansible#14426

Signed-off-by: Sébastien Han <seb@redhat.com>
@Alex2357
Copy link

Alex2357 commented Nov 9, 2017

Just had this problem for me it was happening 4-5 times in a row. Ansible 2.3, Ubuntu 16.04.1.
But as I have not had any issues today in the area where it started happening and I did not do any changes there I just started to think that something goes wrong with the controlling node itself.
I decided to restart controlling node and try again and it worked for me with no issues. The problem gone.

@bartmeuris
Copy link

bartmeuris commented Nov 15, 2017

Also have this same issue with 2.3.0.0 and 2.4.1.0 with pipelining. Due to a mis-configuration on our end, pipelining had been disabled by accident for a while now (not sure how long, I suspect pre-2.0 switch), but enabling it again resulted in the privilege escalation prompt timeout mentioned here.

I use simply become = True and become_method = sudo. The only 'special' thing really I do is set the ANSIBLE_SSH_ARGS so it writes it's UserKnownHostsFile to a specific custom location - but I doubt this would affect anything?

I've tried switching to paramiko, but that crashed & burned completely in my test setup and increasing the timeouts also didn't work, it failed both in my test-setup as on our production environment.

@danowar2k
Copy link
Contributor

Setup:

  • Ansible 2.4.0 Ubuntu 16.04 control machine VirtualBox 5.1.30 VM (Vagrantbox: bento/ubuntu-16.04)
  • Solaris 11.3 VirtualBox 5.1.30 VM (Vagrantbox: heavybeans/solaris11-small-server)

Randomly get this error when testing a playbook, last time it was during a file action (the folder already existed). The two VMs have the same user "vagrant" and the Solaris box has no root password.

I used --ask-become-pass and pressed ENTER. Still, the error happened...

@Apteryks
Copy link

In my case, it was a real problem (not a bug) on my server where DNS would not resolve. sudo apparently uses DNS to resolve the hostname of the machine, and if this fails, it will timeout. I fixed it by correcting the DNS entry in my /etc/resolv.conf.

@sdigit
Copy link

sdigit commented Dec 15, 2017

Having this problem often in GCE with Ansible 2.5 from git as well. So far using paramiko seems to be a viable workaround.

@krisleech
Copy link

I had to killall ssh, maybe a stale ssh connection if you are using ControlPersist.

@bl4ckb1rd
Copy link

Hi, i have the same trouble with deploying to ubuntu 16.04 with ansible 2.4.2.0, the --paramiko option solve the problem, but in same case dont read my ~/.ssh/config, so instead of --paramiko option I solve disabling the option pipelining (by default is False) in the ansible.cfg add:

[ssh_connection]
pipelining = False

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@il-davidlurth
Copy link

il-davidlurth commented Mar 13, 2018

I experienced the same issue when trying to run a playbook on a LXD Ubuntu 16.04 container. I could ssh into the container just fine, but it would take a long time to sudo su and it would error sudo: unable to resolve host ingest0: Connection timed out.

I added the hostname to /etc/hosts and the problem went away - I could run the playbook without it timing out on escalation and I could sudo su immediately.

root@ingest0:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ingest0

I'm using ansible 2.4.3.0 and python 2.7.12.

@salah93
Copy link

salah93 commented Jul 25, 2018

my issue was resolved by changing the hosts file from

[sandbox]
fedora@ip

to

[sandbox]
ip

where ip is the ip address of the machine.

@john-999
Copy link

john-999 commented Aug 7, 2018

Why is this closed?
I have just set up a brand new Ubuntu server with latest Ansible and Python and the bug is still there.
None of the workarounds work.

@krisleech
Copy link

Why is this closed?

Probably because it isn't possible to ask every user if the solution(s) work. Incidentally there are probably multiple different causes of the error. The person made a judgment call to close the issue.

@Shinerrs
Copy link

Shinerrs commented Sep 4, 2018

I agree,

I am having the same issue, I have given the user sudoers root.... I have forced change of users.

Nothing works and reasonable error to investigate. Maybe better exception handling is required here?

My playbook looks like this:

  • hosts: localhost

become_user: jenkins
gather_facts: true
roles:
- { role: bareos, tags: local}

  • hosts: dev-cluster
    remote_user: centos
    gather_facts: true
    roles:

    • { role: bareos, tags: client}
  • hosts: backup
    remote_user: centos
    become_user: root
    gather_facts: true
    roles:

    • { role: bareos, tags: server}

All other hosts work but the hosts: backup.

-vvv Shows

Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<backup.infra.com> ESTABLISH SSH CONNECTION FOR USER: centos
<backup.infra.com> SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o 'IdentityFile="/var/jenkins_home/.ssh/demo.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=centos -o ConnectTimeout=10 -o ControlPath=/var/jenkins_home/.ansible/cp/cd7d91cc23 backup.infra.com '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-uywjmsrvdxhojzxfiqjygdwdsmbvvfzn; /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''

Sever is in AWS.
I have in my ansible command

ansible-playbook -vvv -i inventory/hosts bareos.yml --key-file "~/.ssh/demo.pem" -b -e

@guwang139
Copy link

i just have this problem,this accur become user and model copy . however when i use root direct run playbook that's ok.
error msg :

SSH: EXEC sshpass -d13 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=vmuser -o ConnectTimeout=20 -o ControlPath=/root/.ansible/cp/48d4a08c2f -tt 192.168.202.105 '/bin/sh -c '"'"'su root -c '"'"'"'"'"'"'"'"'/bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-fkekucjxphrobughycoiecflsoiptmkg; /usr/bin/python /home/vmuser/.ansible/tmp/ansible-tmp-1536311364.58-186480404230053/file.py'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"' && sleep 0'"'"''
fatal: [192.168.202.105]: FAILED! => {
"msg": "Timeout (22s) waiting for privilege escalation prompt: "

@Shinerrs
Copy link

I agree,

I am having the same issue, I have given the user sudoers root.... I have forced change of users.

Nothing works and reasonable error to investigate. Maybe better exception handling is required here?

My playbook looks like this:

  • hosts: localhost

become_user: jenkins
gather_facts: true
roles:

  • { role: bareos, tags: local}
  • hosts: dev-cluster
    remote_user: centos
    gather_facts: true
    roles:

    • { role: bareos, tags: client}
  • hosts: backup
    remote_user: centos
    become_user: root
    gather_facts: true
    roles:

    • { role: bareos, tags: server}

All other hosts work but the hosts: backup.

-vvv Shows

Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<backup.infra.com> ESTABLISH SSH CONNECTION FOR USER: centos
<backup.infra.com> SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o 'IdentityFile="/var/jenkins_home/.ssh/demo.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=centos -o ConnectTimeout=10 -o ControlPath=/var/jenkins_home/.ansible/cp/cd7d91cc23 backup.infra.com '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-uywjmsrvdxhojzxfiqjygdwdsmbvvfzn; /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''

Sever is in AWS.
I have in my ansible command

ansible-playbook -vvv -i inventory/hosts bareos.yml --key-file "~/.ssh/demo.pem" -b -e

My issue was firewall related. For me this is resolved.

@rishiloyola
Copy link

For me, it was because of the bad internet connection.

@sedulam
Copy link

sedulam commented Mar 13, 2019

I'm getting this issue as well:
Playbook:

- name: Configure cassandra.yaml common settings
  become: yes
  become_user: cassandra
  become_method: su
  become_flags: '-s /bin/sh'
  lineinfile:
    path: /usr/local/cassandra/conf/cassandra.yaml
    regexp: '{{ item.beginning }}'
    line: '{{ item.beginning }}{{ item.value }}{{ item.end }}'
  with_items: "{{ cassandra_yaml }}"

Which gives the error:

TASK [install-cassandra : Configure cassandra.yaml common settings] *************************************************
fatal: [10.142.0.3]: FAILED! => {"msg": "Timeout (32s) waiting for privilege escalation prompt: "}

The playbook has lots of other tasks which get done without issues. Just this one with the different "become" options, fails.

@rjsocha
Copy link

rjsocha commented Apr 3, 2019

My 3 cents:
Similar issue here. Same error. I had no time to debug but what I spotted:

  1. This is network related (my connection is via HE6 tunnel to Ubunut 18.04->LXD containter). With one tunnel setup same error as above. With other tunnel setup works ok (I'm guessing here but this is propably MTU issue of some kind).
  1. ANSIBLE_SSH_ARGS="-o ControlMaster=no" helps a little - connection stuck on diffrent task when used.

@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

Successfully merging a pull request may close this issue.