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

Fabric "needs to prompt" in parallel mode, but not in serial mode #1433

Open
nhooey opened this issue Feb 27, 2016 · 5 comments
Open

Fabric "needs to prompt" in parallel mode, but not in serial mode #1433

nhooey opened this issue Feb 27, 2016 · 5 comments

Comments

@nhooey
Copy link

nhooey commented Feb 27, 2016

I'm getting this error when running a Fabric task in parallel mode:

No handlers could be found for logger "paramiko.transport"

Fatal error: Needed to prompt for a connection or sudo password (host: node01 node02),
but input would be ambiguous in parallel mode

Aborting.
[node01 node02] run: sudo supervisorctl stop whatever

This is with the following code:

from fabric.api import execute, parallel, run, task

env.use_ssh_config = True
env.use_shell = False

@task
@parallel(pool_size=2)
def deploy():
    run('sudo supervisorctl stop %s' % supervisor_job)

deploy.hosts = ['node01', 'node02']
execute(deploy)

However, if I turn off parallel, I don't see any SSH password or sudo prompts, or any errors about them:

@parallel(pool_size=1)

I can also confirm that there are no prompts when SSHing to the node01 and node02 boxes manually, nor are there any sudo prompts when running the exact commands on the boxes.

This seems to only be an issue with parallel mode.

I've had so many issues with password prompts that I think it would be a good idea to have global settings for disabling both SSH password and sudo prompts. Fabric seems to guess that the prompts are necessary, and breaks when there is no standard input (when using Atlassian Bamboo, Jenkins, or some other build system).

I'd prefer to just manually tell Fabric never to prompt for anything, and fail if the operating system actually prompts.

@nhooey
Copy link
Author

nhooey commented Feb 27, 2016

Okay this issue is completely off.

Someone changed the list of hosts in some environment variable such that one of the hosts was called node01 node02 with a space in it, but it wasn't obvious.

Still, Fabric shouldn't say that it's prompting for a password when it couldn't possibly SSH to the host.

@v6
Copy link

v6 commented Feb 14, 2017

// , Fabric isn't really designed to run in Parallel mode, and is not thread safe in it. Consider a saner library if you need this sort of thing

@nhooey
Copy link
Author

nhooey commented Feb 14, 2017

Yeah, Fabric 1 is pretty sloppy with how it runs. Fabric 2 is supposed to fix a lot of these issues.

I actually had good success with using the Ansible Python API. The documentation sucked at the time, but I was able to write a concurrent build system with it.

What other libraries would you suggest?

@v6
Copy link

v6 commented Feb 17, 2017

@v6
Copy link

v6 commented Feb 17, 2017

// , Fabric was mostly intended as a faithful port of Capistrano.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants