I'm pretty new to Fabric and am trying to write a simple fab utility that uploads a zip file to a remote machine and unzips it. Unfortunately I am getting inconsistent errors when I run.
I have tried a couple of different options and get two different errors as a result. However, in either case if I comment out the put() operation then everything else works okay. In additional tests it seems I can call run() as many times as I want, so long as there isn't a put() in the chain.
If I add an additional line before the put() operation to remove an existing scripts.zip on the remote host...
Then I get the following error (I've turned on debug logging for additional information).
[localhost] Executing task 'uploadScripts'
Removing old scripts...
[localhost] run: rm -f scripts.zip
DEBUG:paramiko.transport:starting thread (client mode): 0x3556e48L
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_6.6.1)
DEBUG:paramiko.transport:kex algos:[u'address@hidden', u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa', u'ssh-dss', u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'address@hidden', u'address@hidden', u'address@hidden', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'address@hidden'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'address@hidden', u'address@hidden', u'address@hidden', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'address@hidden'] client mac:[u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'hmac-md5', u'hmac-sha1', u'address@hidden', u'address@hidden', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'address@hidden', u'hmac-sha1-96', u'hmac-md5-96'] server mac:[u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'hmac-md5', u'hmac-sha1', u'address@hidden', u'address@hidden', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'address@hidden', u'hmac-sha1-96', u'hmac-md5-96'] client compress:[u'none', u'address@hidden'] server compress:[u'none', u'address@hidden'] client lang:[u''] server lang:[u''] kex follows?False
DEBUG:paramiko.transport:Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
DEBUG:paramiko.transport:using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-s
ha1, remote hmac-sha1; compression: local none, remote none
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:Adding ssh-rsa host key for localhost: 493071a6f3998a5536c903aeb86ab7b8
[localhost] Login password for 'jpsteinmetz':
DEBUG:paramiko.transport:starting thread (client mode): 0x35f8a90L
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_6.6.1)
DEBUG:paramiko.transport:kex algos:[u'address@hidden', u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa', u'ssh-dss', u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'address@hidden', u'address@hidden', u'address@hidden', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'address@hidden'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256', u'arcfour128', u'address@hidden', u'address@hidden', u'address@hidden', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc', u'aes192-cbc', u'aes256-cbc', u'arcfour', u'address@hidden'] client mac:[u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'hmac-md5', u'hmac-sha1', u'address@hidden', u'address@hidden', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'address@hidden', u'hmac-sha1-96', u'hmac-md5-96'] server mac:[u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'address@hidden', u'hmac-md5', u'hmac-sha1', u'address@hidden', u'address@hidden', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-ripemd160', u'address@hidden', u'hmac-sha1-96', u'hmac-md5-96'] client compress:[u'none', u'address@hidden'] server compress:[u'none', u'address@hidden'] client lang:[u''] server lang:[u''] kex follows?False
DEBUG:paramiko.transport:Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
DEBUG:paramiko.transport:using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Authentication (password) successful!
DEBUG:paramiko.transport:[chan 1] Max packet in: 34816 bytes
DEBUG:paramiko.transport:[chan 1] Max packet out: 32768 bytes
INFO:paramiko.transport:Secsh channel 1 opened.
DEBUG:paramiko.transport:[chan 1] Sesch channel 1 request ok
DEBUG:paramiko.transport:[chan 1] Sesch channel 1 request ok
DEBUG:paramiko.transport:[chan 1] EOF received (1)
DEBUG:paramiko.transport:[chan 1] EOF sent (1)
Packing up scripts...
Uploading scripts to remote host...
DEBUG:paramiko.transport:[chan 2] Max packet in: 34816 bytes
DEBUG:paramiko.transport:[chan 2] Max packet out: 32768 bytes
INFO:paramiko.transport:Secsh channel 2 opened.
DEBUG:paramiko.transport:[chan 2] Sesch channel 2 request ok
Traceback (most recent call last):
DEBUG:paramiko.transport:[chan 2] EOF received (2)
File "C:\Python27\lib\site-packages\fabric\main.py", line 743, in main
*args, **kwargs
File "C:\Python27\lib\site-packages\fabric\tasks.py", line 372, in execute
multiprocessing
File "C:\Python27\lib\site-packages\fabric\tasks.py", line 267, in _execute
return task.run(*args, **kwargs)
File "C:\Python27\lib\site-packages\fabric\tasks.py", line 174, in run
return self.wrapped(*args, **kwargs)
File "D:\tools\python\fabfile.py", line 40, in uploadScripts
if (put(os.path.join(tempDir, 'scripts.zip')).succeeded == False):
File "C:\Python27\lib\site-packages\fabric\network.py", line 639, in host_prompting_wrapper
DEBUG:paramiko.transport:[chan 2] EOF sent (2)
return func(*args, **kwargs)
File "C:\Python27\lib\site-packages\fabric\operations.py", line 346, in put
ftp = SFTP(env.host_string)
File "C:\Python27\lib\site-packages\fabric\sftp.py", line 30, in __init__
self.ftp = connections[host_string].open_sftp()
File "C:\Python27\lib\site-packages\paramiko\client.py", line 345, in open_sftp
return self._transport.open_sftp_client()
File "C:\Python27\lib\site-packages\paramiko\transport.py", line 717, in open_sftp_client
return SFTPClient.from_transport(self)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 114, in from_transport
return cls(chan)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 98, in __init__
raise SSHException('EOF during negotiation')
paramiko.ssh_exception.SSHException: EOF during negotiation
Disconnecting from localhost... DEBUG:paramiko.transport:EOF in transport thread
done.
DEBUG:paramiko.transport:EOF in transport thread
The SSH server is OpenSSH 6.6.1p1-3 running through cygwin (64-bit). SSH itself seems to run just fine as I can putty into it without any problems and can also use psftp to upload the same zip file.
Any insight into why this might be happening is greatly appreciated.