Re: [Fab-user] SSHException with Ubuntu 9.04
We had this same issue and we narrowed it down to paramiko 1.7.5 We were getting exceptions like: Traceback (most recent call last): File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/main.py, line 454, in main commands[name](*args, **kwargs) File /home/christian/work_devel/policystat/pstat/pstat_deploy/configure.py, line 201, in deploy _push_source() File /home/christian/work_devel/policystat/pstat/pstat_deploy/utils.py, line 117, in _push_source run('ln -s /var/www/%(pstat_url)s_%(timestamp)s /var/www/%(pstat_url)s' % env) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/network.py, line 371, in host_prompting_wrapper return func(*args, **kwargs) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/operations.py, line 413, in run channel.exec_command(real_command) File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 212, in exec_command self._wait_for_event() File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 1077, in _wait_for_event raise e paramiko.SSHException: Channel closed. They would occur absolutely randomly (usually between the 5th and 25th run() or sudo() call for some reason), but I always got that exception before the script finished (a successful run has about 60 sudo/run calls). This only started happening after I upgraded from paramiko 1.7.4 installed via the python-paramiko package on Ubuntu 9.04 to paramiko 1.7.5 installed via pip in my virtualenv. I had also upgraded from fabric 0.9a3 to 0.9b1 at the same time, but I was able to narrow it down to the paramiko change by going back to 0.9a with the problem continuing. The annoying part is that 1.7.4 isn't hosted anywhere on pypi, so we're having to go back to paramiko 1.7.2. Good news is that everything is working again at least. Hope this helps. -Wes Offhand that doesn't look like a config issue, especially if it's intermittent. Are you saying that sometimes that exact command below will work, or does it always bail out? What other commands have you successfully run with run() or sudo(), and what other commands have died -- or is it truly random? What version of Fabric are you using, a git clone or 0.9b1 or what? :) What version of Paramiko do you have installed? IIRC some older versions of Paramiko can cause problems, you'll want 1.7.4 or newer. (In fact, 1.7.5 came out recently, and looks like it may fix those Python 2.6 warnings, hooray!) Finally, it looks like you're using Python 2.6 on...OS X 10.3 Panther? Is that accurate or is your egg path leading me astray? Don't know of any specific issues on 10.3, just want to make sure I know what your platform is for the record. Sorry for the interrogation but that's tech support for you :) Best, Jeff On Sat, Aug 8, 2009 at 7:27 PM, Ted Carrollted.a.carr...@gmail.com wrote: I'm trying out fabric for the first time so this is probably a silly config problem on my part, but I'm running ubuntu 9.04 in a vmware vm and having a lot of problems getting SSHExceptions. Here's a fabfile that reproduces the problem: from fabric.api import * def production(): env.hosts = ['192.168.1.228'] env.user = 'deployment' env.password = 'password' def test_sudo(): require('hosts', provided_by=[production]) put('apache-website-config', 'apache-website-config') sudo('rm -f apache-website-config') sudo('rm -f bad_file_name2') The output is: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Hash/SHA.py:6: DeprecationWarning: the sha module is deprecated; use the hashlib module instead from sha import * /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Hash/MD5.py:6: DeprecationWarning: the md5 module is deprecated; use hashlib instead from md5 import * [192.168.1.228] put: apache-website-config - apache-website-config [192.168.1.228] sudo: rm -f apache-website-config Traceback (most recent call last): File build/bdist.macosx-10.3-i386/egg/fabric/main.py, line 481, in main File /Users/tedc/project_46062/deployment/fabfile.py, line 11, in test_sudo sudo('rm -f apache-website-config') File build/bdist.macosx-10.3-i386/egg/fabric/network.py, line 369, in host_prompting_wrapper File build/bdist.macosx-10.3-i386/egg/fabric/operations.py, line 517, in sudo File build/bdist.macosx-10.3-i386/egg/paramiko/channel.py, line 212, in exec_command File build/bdist.macosx-10.3-i386/egg/paramiko/channel.py, line 1077, in _wait_for_event paramiko.SSHException: Channel closed. Disconnecting from 192.168.1.228... done. It seams to be intermittent -- occasionally it will work but mostly it fails. Any ideas? Thanks, Ted C ___
Re: [Fab-user] SSHException with Ubuntu 9.04
That's fantastic news! At least I can get going while we try to work out what is going on. Thanks, Ted C. On Aug 14, 2009, at 9:06 AM, Wes Winham wrote: We had this same issue and we narrowed it down to paramiko 1.7.5 We were getting exceptions like: Traceback (most recent call last): File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/ main.py, line 454, in main commands[name](*args, **kwargs) File /home/christian/work_devel/policystat/pstat/pstat_deploy/ configure.py, line 201, in deploy _push_source() File /home/christian/work_devel/policystat/pstat/pstat_deploy/ utils.py, line 117, in _push_source run('ln -s /var/www/%(pstat_url)s_%(timestamp)s /var/www/% (pstat_url)s' % env) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/ network.py, line 371, in host_prompting_wrapper return func(*args, **kwargs) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/ operations.py, line 413, in run channel.exec_command(real_command) File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site- packages/paramiko/channel.py, line 212, in exec_command self._wait_for_event() File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site- packages/paramiko/channel.py, line 1077, in _wait_for_event raise e paramiko.SSHException: Channel closed. They would occur absolutely randomly (usually between the 5th and 25th run() or sudo() call for some reason), but I always got that exception before the script finished (a successful run has about 60 sudo/run calls). This only started happening after I upgraded from paramiko 1.7.4 installed via the python-paramiko package on Ubuntu 9.04 to paramiko 1.7.5 installed via pip in my virtualenv. I had also upgraded from fabric 0.9a3 to 0.9b1 at the same time, but I was able to narrow it down to the paramiko change by going back to 0.9a with the problem continuing. The annoying part is that 1.7.4 isn't hosted anywhere on pypi, so we're having to go back to paramiko 1.7.2. Good news is that everything is working again at least. Hope this helps. -Wes Offhand that doesn't look like a config issue, especially if it's intermittent. Are you saying that sometimes that exact command below will work, or does it always bail out? What other commands have you successfully run with run() or sudo(), and what other commands have died -- or is it truly random? What version of Fabric are you using, a git clone or 0.9b1 or what? :) What version of Paramiko do you have installed? IIRC some older versions of Paramiko can cause problems, you'll want 1.7.4 or newer. (In fact, 1.7.5 came out recently, and looks like it may fix those Python 2.6 warnings, hooray!) Finally, it looks like you're using Python 2.6 on...OS X 10.3 Panther? Is that accurate or is your egg path leading me astray? Don't know of any specific issues on 10.3, just want to make sure I know what your platform is for the record. Sorry for the interrogation but that's tech support for you :) Best, Jeff On Sat, Aug 8, 2009 at 7:27 PM, Ted Carrollted.a.carr...@gmail.com wrote: I'm trying out fabric for the first time so this is probably a silly config problem on my part, but I'm running ubuntu 9.04 in a vmware vm and having a lot of problems getting SSHExceptions. Here's a fabfile that reproduces the problem: from fabric.api import * def production(): env.hosts = ['192.168.1.228'] env.user = 'deployment' env.password = 'password' def test_sudo(): require('hosts', provided_by=[production]) put('apache-website-config', 'apache-website-config') sudo('rm -f apache-website-config') sudo('rm -f bad_file_name2') The output is: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ site-packages/Crypto/Hash/SHA.py:6: DeprecationWarning: the sha module is deprecated; use the hashlib module instead from sha import * /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ site-packages/Crypto/Hash/MD5.py:6: DeprecationWarning: the md5 module is deprecated; use hashlib instead from md5 import * [192.168.1.228] put: apache-website-config - apache-website-config [192.168.1.228] sudo: rm -f apache-website-config Traceback (most recent call last): File build/bdist.macosx-10.3-i386/egg/fabric/main.py, line 481, in main File /Users/tedc/project_46062/deployment/fabfile.py, line 11, in test_sudo sudo('rm -f apache-website-config') File build/bdist.macosx-10.3-i386/egg/fabric/network.py, line 369, in host_prompting_wrapper File build/bdist.macosx-10.3-i386/egg/fabric/operations.py, line 517, in sudo File build/bdist.macosx-10.3-i386/egg/paramiko/channel.py, line 212, in exec_command File build/bdist.macosx-10.3-i386/egg/paramiko/channel.py, line 1077, in _wait_for_event paramiko.SSHException: Channel closed. Disconnecting from 192.168.1.228... done. It seams to be intermittent -- occasionally it will work but mostly it fails. Any ideas? Thanks, Ted C
Re: [Fab-user] SSHException with Ubuntu 9.04
Thanks for confirming this, both of you. I also note that Pat McNerthney just (as in 10 minutes ago) actually investigated this and put a nice, detailed comment on Robey's Paramiko Github page outlining what's going on: http://github.com/robey/paramiko/commit/f573017a1d56c0ef9fdb08598bf4a43f40c01952 It's unfortunate that 1.7.4 is no longer available on PyPI either; if Robey isn't able to push out a 1.7.6 or 1.7.5.1 soon I can't think of much else to do for new users other than to direct them to the Paramiko site to download a .tgz of 1.7.4. In the meantime, hopefully it's obvious to anyone reading this that they should hold off on upgrading to Paramiko 1.7.5 until this is resolved :) -Jeff On Fri, Aug 14, 2009 at 7:24 PM, Ted Carrollted.a.carr...@gmail.com wrote: I had a chance to confirm this. paramiko 1.7.5 is broken and paramiko 1.7.4 works. Thanks, Ted C. On Aug 14, 2009, at 9:06 AM, Wes Winham wrote: We had this same issue and we narrowed it down to paramiko 1.7.5 We were getting exceptions like: Traceback (most recent call last): File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/main.py, line 454, in main commands[name](*args, **kwargs) File /home/christian/work_devel/policystat/pstat/pstat_deploy/configure.py, line 201, in deploy _push_source() File /home/christian/work_devel/policystat/pstat/pstat_deploy/utils.py, line 117, in _push_source run('ln -s /var/www/%(pstat_url)s_%(timestamp)s /var/www/%(pstat_url)s' % env) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/network.py, line 371, in host_prompting_wrapper return func(*args, **kwargs) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/operations.py, line 413, in run channel.exec_command(real_command) File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 212, in exec_command self._wait_for_event() File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 1077, in _wait_for_event raise e paramiko.SSHException: Channel closed. They would occur absolutely randomly (usually between the 5th and 25th run() or sudo() call for some reason), but I always got that exception before the script finished (a successful run has about 60 sudo/run calls). This only started happening after I upgraded from paramiko 1.7.4 installed via the python-paramiko package on Ubuntu 9.04 to paramiko 1.7.5 installed via pip in my virtualenv. I had also upgraded from fabric 0.9a3 to 0.9b1 at the same time, but I was able to narrow it down to the paramiko change by going back to 0.9a with the problem continuing. The annoying part is that 1.7.4 isn't hosted anywhere on pypi, so we're having to go back to paramiko 1.7.2. Good news is that everything is working again at least. Hope this helps. -Wes Offhand that doesn't look like a config issue, especially if it's intermittent. Are you saying that sometimes that exact command below will work, or does it always bail out? What other commands have you successfully run with run() or sudo(), and what other commands have died -- or is it truly random? What version of Fabric are you using, a git clone or 0.9b1 or what? :) What version of Paramiko do you have installed? IIRC some older versions of Paramiko can cause problems, you'll want 1.7.4 or newer. (In fact, 1.7.5 came out recently, and looks like it may fix those Python 2.6 warnings, hooray!) Finally, it looks like you're using Python 2.6 on...OS X 10.3 Panther? Is that accurate or is your egg path leading me astray? Don't know of any specific issues on 10.3, just want to make sure I know what your platform is for the record. Sorry for the interrogation but that's tech support for you :) Best, Jeff On Sat, Aug 8, 2009 at 7:27 PM, Ted Carrollted.a.carr...@gmail.com wrote: I'm trying out fabric for the first time so this is probably a silly config problem on my part, but I'm running ubuntu 9.04 in a vmware vm and having a lot of problems getting SSHExceptions. Here's a fabfile that reproduces the problem: from fabric.api import * def production(): env.hosts = ['192.168.1.228'] env.user = 'deployment' env.password = 'password' def test_sudo(): require('hosts', provided_by=[production]) put('apache-website-config', 'apache-website-config') sudo('rm -f apache-website-config') sudo('rm -f bad_file_name2') The output is: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Hash/SHA.py:6: DeprecationWarning: the sha module is deprecated; use the hashlib module instead from sha import * /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Hash/MD5.py:6: DeprecationWarning: the md5 module is deprecated; use hashlib instead from md5 import * [192.168.1.228] put: apache-website-config - apache-website-config [192.168.1.228] sudo: rm
Re: [Fab-user] SSHException with Ubuntu 9.04
I was just going to send a message here about this, but you beat me to it! I just today starting using Fabric again and bumped into this very issue. This thread helped a lot in pointing me to the right direction. I submitted a patch that resolves this problem in 1.7.5 here: https://bugs.launchpad.net/paramiko/+bug/413850 Cheers! Pat Jeff Forcier wrote: Thanks for confirming this, both of you. I also note that Pat McNerthney just (as in 10 minutes ago) actually investigated this and put a nice, detailed comment on Robey's Paramiko Github page outlining what's going on: http://github.com/robey/paramiko/commit/f573017a1d56c0ef9fdb08598bf4a43f40c01952 It's unfortunate that 1.7.4 is no longer available on PyPI either; if Robey isn't able to push out a 1.7.6 or 1.7.5.1 soon I can't think of much else to do for new users other than to direct them to the Paramiko site to download a .tgz of 1.7.4. In the meantime, hopefully it's obvious to anyone reading this that they should hold off on upgrading to Paramiko 1.7.5 until this is resolved :) -Jeff On Fri, Aug 14, 2009 at 7:24 PM, Ted Carrollted.a.carr...@gmail.com wrote: I had a chance to confirm this. paramiko 1.7.5 is broken and paramiko 1.7.4 works. Thanks, Ted C. On Aug 14, 2009, at 9:06 AM, Wes Winham wrote: We had this same issue and we narrowed it down to paramiko 1.7.5 We were getting exceptions like: Traceback (most recent call last): File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/main.py, line 454, in main commands[name](*args, **kwargs) File /home/christian/work_devel/policystat/pstat/pstat_deploy/configure.py, line 201, in deploy _push_source() File /home/christian/work_devel/policystat/pstat/pstat_deploy/utils.py, line 117, in _push_source run('ln -s /var/www/%(pstat_url)s_%(timestamp)s /var/www/%(pstat_url)s' % env) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/network.py, line 371, in host_prompting_wrapper return func(*args, **kwargs) File /home/christian/.virtualenvs/pstat_dev/src/fabric/fabric/operations.py, line 413, in run channel.exec_command(real_command) File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 212, in exec_command self._wait_for_event() File /home/christian/.virtualenvs/pstat_dev/lib/python2.5/site-packages/paramiko/channel.py, line 1077, in _wait_for_event raise e paramiko.SSHException: Channel closed. They would occur absolutely randomly (usually between the 5th and 25th run() or sudo() call for some reason), but I always got that exception before the script finished (a successful run has about 60 sudo/run calls). This only started happening after I upgraded from paramiko 1.7.4 installed via the python-paramiko package on Ubuntu 9.04 to paramiko 1.7.5 installed via pip in my virtualenv. I had also upgraded from fabric 0.9a3 to 0.9b1 at the same time, but I was able to narrow it down to the paramiko change by going back to 0.9a with the problem continuing. The annoying part is that 1.7.4 isn't hosted anywhere on pypi, so we're having to go back to paramiko 1.7.2. Good news is that everything is working again at least. Hope this helps. -Wes Offhand that doesn't look like a config issue, especially if it's intermittent. Are you saying that sometimes that exact command below will work, or does it always bail out? What other commands have you successfully run with run() or sudo(), and what other commands have died -- or is it truly random? What version of Fabric are you using, a git clone or 0.9b1 or what? :) What version of Paramiko do you have installed? IIRC some older versions of Paramiko can cause problems, you'll want 1.7.4 or newer. (In fact, 1.7.5 came out recently, and looks like it may fix those Python 2.6 warnings, hooray!) Finally, it looks like you're using Python 2.6 on...OS X 10.3 Panther? Is that accurate or is your egg path leading me astray? Don't know of any specific issues on 10.3, just want to make sure I know what your platform is for the record. Sorry for the interrogation but that's tech support for you :) Best, Jeff On Sat, Aug 8, 2009 at 7:27 PM, Ted Carrollted.a.carr...@gmail.com wrote: I'm trying out fabric for the first time so this is probably a silly config problem on my part, but I'm running ubuntu 9.04 in a vmware vm and having a lot of problems getting SSHExceptions. Here's a fabfile that reproduces the problem: from fabric.api import * def production(): env.hosts = ['192.168.1.228'] env.user = 'deployment' env.password = 'password' def test_sudo(): require('hosts', provided_by=[production]) put('apache-website-config', 'apache-website-config') sudo('rm -f apache-website-config') sudo('rm -f bad_file_name2') The output is: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto/Hash/SHA.py:6: DeprecationWarning: the sha module is deprecated; use the hashlib