Paramiko throws EOFError rather than returning a 0 length file or ENOENT
Robey Pointer
robey at lag.net
Mon Sep 11 18:55:14 BST 2006
On 10 Sep 2006, at 14:31, Robert Collins wrote:
> On Wed, 2006-08-23 at 17:10 +0200, Tollef Fog Heen wrote:
>> My network was slow today and I got this not-so-nice traceback whe
>> doing bzr push:
>>
>> : tfheen at thosu ..sper/trunk/ubiquity-hooks > bzr push
>> Using saved location: sftp://bazaar.launchpad.net/~ubuntu-core-dev/
>> casper/trunk
>> Disconnecting: Timeout, server not responding.
>> bzr: ERROR: exceptions.EOFError:
>>
>> Traceback (most recent call last):
>> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line
>> 697, in run_bzr_catch_errors
>> return run_bzr(argv)
>> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line
>> 659, in run_bzr
>> ret = run(*run_argv)
>> File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line
>> 281, in run_argv_aliases
>> return self.run(**all_cmd_args)
>> File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line
>> 547, in run
>> dir_to = bzrdir.BzrDir.open(location_url)
>> File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line
>> 464, in open
>> format = BzrDirFormat.find_format(t)
>> File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line
>> 962, in find_format
>> return format.probe_transport(transport)
>> File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line
>> 972, in probe_transport
>> format_string = transport.get(".bzr/branch-format").read()
>> File "/usr/lib/python2.4/site-packages/bzrlib/transport/
>> sftp.py", line 438, in get
>> f = self._sftp.file(path, mode='rb')
>> File "/usr/lib/python2.4/site-packages/paramiko/sftp_client.py",
>> line 204, in file
>> t, msg = self._request(CMD_OPEN, filename, imode, attrblock)
>> File "/usr/lib/python2.4/site-packages/paramiko/sftp_client.py",
>> line 526, in _request
>> return self._read_response(num)
>> File "/usr/lib/python2.4/site-packages/paramiko/sftp_client.py",
>> line 555, in _read_response
>> t, data = self._read_packet()
>> File "/usr/lib/python2.4/site-packages/paramiko/sftp.py", line
>> 162, in _read_packet
>> size = struct.unpack('>I', self._read_all(4))[0]
>> File "/usr/lib/python2.4/site-packages/paramiko/sftp.py", line
>> 150, in _read_all
>> raise EOFError()
>> EOFError
>>
>> bzr 0.9.0 on python 2.4.4.candidate.0 (linux2)
>> arguments: ['/usr/bin/bzr', 'push']
>>
>> ** please send this report to bazaar-ng at lists.ubuntu.com
>>
>> bzr is 0.9-0ubuntu2, the rest of the system is up-to-date edgy.
>
> Looks to me like paramiko is being unfriendly here. We should probably
> catch this and turn it into either ENOENT or a 0 length file,
> depending
> on what Robey says is happening.
>
> affects /products/bzr
It looks like the underlying server connection vanished. I should
translate that into an SSHException for the next version, but I'm not
sure if that should be treated as ENOENT or an empty file. It
probably should just be treated as a "fail" error and let the user
retry. (In other words, same as now, but without the stack trace.) ;)
robey
More information about the bazaar
mailing list