Fabric could not get keys from ssh-agent

Problem :
File “/usr/local/lib/python2.7/dist-packages/fabric/tasks.py”, line 173, in run
return self.wrapped(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/fabric/decorators.py”, line 185, in inner
return func(*args, **kwargs)
File “/home/sushrut/scripts/fabfile.py”, line 52, in push_key
if not exists(‘~/.ssh’):
File “/usr/local/lib/python2.7/dist-packages/fabric/contrib/files.py”, line 33, in exists
cmd = ‘stat %s’ % _expand_path(path)
File “/usr/local/lib/python2.7/dist-packages/fabric/contrib/files.py”, line 466, in _expand_path
return path if is_win() else ‘”$(echo %s)”‘ % path
File “/usr/local/lib/python2.7/dist-packages/fabric/contrib/files.py”, line 453, in is_win
return ‘”‘ in run(‘echo “Will you echo quotation marks”‘)
File “/usr/local/lib/python2.7/dist-packages/fabric/network.py”, line 683, in host_prompting_wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/fabric/operations.py”, line 1090, in run
shell_escape=shell_escape, capture_buffer_size=capture_buffer_size,
File “/usr/local/lib/python2.7/dist-packages/fabric/operations.py”, line 930, in _run_command
channel=default_channel(), command=wrapped_command, pty=pty,
File “/usr/local/lib/python2.7/dist-packages/fabric/state.py”, line 424, in default_channel
chan = _open_session()
File “/usr/local/lib/python2.7/dist-packages/fabric/state.py”, line 416, in _open_session
return connections[env.host_string].get_transport().open_session()
File “/usr/local/lib/python2.7/dist-packages/fabric/network.py”, line 159, in __getitem__
File “/usr/local/lib/python2.7/dist-packages/fabric/network.py”, line 151, in connect
user, host, port, cache=self, seek_gateway=seek_gateway)
File “/usr/local/lib/python2.7/dist-packages/fabric/network.py”, line 532, in connect
raise NetworkError(msg, e)
NetworkError: could not get keys from ssh-agent

Fatal error: One or more hosts failed while executing task ‘push_key’

Underlying exception:
could not get keys from ssh-agent


Solution :

$ eval `ssh-agent -s`

$ ssh-add




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: