Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getpass error(s)

Tags:

python

fabric

The following fabric script is open source which I need to use, unfortunately I'm not familiar with this stuff. The fabric file starts with:

from fabric.api import *
import time

env.user = 'aegir'
env.shell = '/bin/bash -c'

# Download and import a platform using Drush Make
def build_platform(site, profile, webserver, dbserver, makefile, build):
  print "===> Building the platform..."
  run("drush make %s /var/aegir/platforms/%s" % (makefile, build))

The fabric file is run by a Jenkins server when a new build is triggered by a Git push. When this file is executed this first remote action (last line) results in the following error.

/usr/lib/python2.6/getpass.py:83: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Password for [email protected]: ===> Building the platform...
[o1.sub.aegir.local] run: drush make https://raw.github.com/mig5/builds/master/mig5_platform.build /var/aegir/platforms/20121011010955
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/fabric/main.py", line 435, in main
    commands[name](*args, **kwargs)
  File "/usr/local/bin/fabfile.py", line 11, in build_platform
    run("drush make %s /var/aegir/platforms/%s" % (makefile, build))
  File "/usr/lib/pymodules/python2.6/fabric/network.py", line 390, in host_prompting_wrapper
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/fabric/operations.py", line 414, in run
    channel = connections[env.host_string]._transport.open_session()
  File "/usr/lib/pymodules/python2.6/fabric/network.py", line 65, in __getitem__
    self[real_key] = connect(user, host, port)
  File "/usr/lib/pymodules/python2.6/fabric/network.py", line 219, in connect
    password = prompt_for_password(password, text)
  File "/usr/lib/pymodules/python2.6/fabric/network.py", line 279, in prompt_for_password
    new_password = getpass.getpass(password_prompt)
  File "/usr/lib/python2.6/getpass.py", line 83, in unix_getpass
    passwd = fallback_getpass(prompt, stream)
  File "/usr/lib/python2.6/getpass.py", line 118, in fallback_getpass
    return _raw_input(prompt, stream)
  File "/usr/lib/python2.6/getpass.py", line 135, in _raw_input
    raise EOFError
EOFError
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Do I have to specify a password for the aegir user or so? I tried to include env.password = '' (I deleted the Aegir's user password with passwd --delete aegir on my remote machine) under env.user = 'aegir', but that didn't solve anything.

like image 503
jroeleveld Avatar asked Mar 07 '26 22:03

jroeleveld


2 Answers

Ssh service forbid remote access for users without password. You can just set password for aegir user, on machine and in a fabfile.

like image 145
mechmind Avatar answered Mar 09 '26 12:03

mechmind


Login required. To avoid interactivity, you can copy the public key from the FABRIC machine and paste in the TARGET machine's ~/.ssh/authorized_keys

Make sure that: Not to include or exclude anything that's not the key (like introduce linefeeds), the key must be copied exactly as is.

and do this:

chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh/*
like image 43
Max Haase Avatar answered Mar 09 '26 12:03

Max Haase



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!