Skip to content

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

@nhooey

Description

@nhooey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions