Roots Discourse

Error : "waiting for privilege escalation prompt" when provisioning remote server


#1

here is the error in detail -

TASK [Install Python 2.x] ***********************************************************************************************
task path: /home/myuser/Sites/wp/trellis/server.yml:17
<mycomain.co.uk> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<mydomain.co.uk> SSH: EXEC ssh -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/home/myuser/.ansible/cp/4c72f00a62 -tt mydomain.co.uk 'sudo -H -S  -p "[sudo via ansible, key=nwbscpezlilromdpzdwncnobkanrunoi] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-nwbscpezlilromdpzdwncnobkanrunoi; which python || sudo apt-get update && sudo apt-get install -qq -y python-simplejson'"'"''
<mydomain.co.uk> ssh_retry: attempt: 0, caught exception(Timeout (12s) waiting for privilege escalation prompt: ) from cmd (['ssh', '-o', 'ForwardAgent=yes', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=ubuntu', '-o', 'ConnectTimeout=10', '-o', 'ControlPath=/home/myuser/.ansible/cp/4c72f00a62', '-tt', 'mydomain.co.uk', 'sudo -H -S  -p "[sudo via ansible, key=nwbscpezlilromdpzdwncnobkanrunoi] password: " -u root /bin/sh -c \'echo BECOME-SUCCESS-nwbscpezlilromdpzdwncnobkanrunoi; which python || sudo apt-get update && sudo apt-get install -qq -y python-simplejson\'']...), pausing for 0 seconds
<mydomain.co.uk> SSH: EXEC ssh -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 -o ControlPath=/home/myuser/.ansible/cp/4c72f00a62 -tt mydomain.co.uk 'sudo -H -S  -p "[sudo via ansible, key=nwbscpezlilromdpzdwncnobkanrunoi] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-nwbscpezlilromdpzdwncnobkanrunoi; which python || sudo apt-get update && sudo apt-get install -qq -y python-simplejson'"'"''
System info:
  Ansible 2.4.2.0; Linux
  Trellis at "Update wp-cli to 1.5.1"
---------------------------------------------------
Timeout (12s) waiting for privilege escalation prompt:
fatal: [mydomain.co.uk]: FAILED! => {}

here is my ansible / python version information:

➜  trellis git:(master) ansible --version
ansible 2.4.2.0
  config file = /home/myuser/Sites/wp/trellis/ansible.cfg
  configured module search path = [u'/home/myuser/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]

I have updated trellis to the latest commit (Update wp-cli to 1.5.1 (#982)), the error persists


#2

fixed!!

the problem started when cloudflare was added. the hosts file needs to contain the server ip not the domain


#3

I have this same issue, my hosts file contains the IP address but I am getting this error


#4

Compare your ansible.cfg with the one in GitHub. Does yours have these lines?

pipelining = True
retries = 1

#5

Yes it does have that


#6

@thommeredith I’m getting this error as well now, even though I’m using my server IP address in my hosts file like you. The reprovisioning of my Production server is failing.

I’m using up to date Trellis, Ansible 2.5.3 and the most recent ansible.cfg mod mentioned above.

I searched on Github Ansible, and found a hack for this issue, which is to add to add “transport=paramiko” in ansible.cfg:

Link to Ansible Github issue 14426

Paramiko seems to be a Python implementation of SSHv2 (http://www.paramiko.org/)

Did you find a better solution? I saw some suggestions to simply increase the timeout value in ansible.cfg (
timeout = 30)…