fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] [PATCH] BUG: SFTP exception with strerror = None


From: Jeff Forcier
Subject: Re: [Fab-user] [PATCH] BUG: SFTP exception with strerror = None
Date: Mon, 25 May 2009 14:36:24 -0400

Hi Evan,

Thanks for catching this, pushed as commit c7d4d19 :)

Out of curiosity, is the problem simply that SFTP won't allow you to
overwrite an open file, or is there something else going on? Looks
like it's an SFTP-level error, so not much we can do on our end to
prevent or fix it, but I'm still curious.

Regards,
Jeff

On Mon, May 25, 2009 at 11:29 AM, Evan Jones <address@hidden> wrote:
> I ran into a case where paramiko's SFTP client throws an exception with
> .strerror set to None. I am uploading a file to the remote server. The file
> is in use on the remote server, as it is a binary being executed. The GIT
> version of Fabric raises the following exception:
>
> Traceback (most recent call last):
>  File "/home/evanj/fabric/fabric/main.py", line 428, in main
>    commands[name](*args, **kwargs)
>  File "/home/evanj/fabric/fabric/decorators.py", line 26, in inner_decorator
>    return func(*args, **kwargs)
>  File "/home/evanj/fabtest/fabfile.py", line 51, in deploy
>    startBackups(0)
>  File "/home/evanj/fabtest/fabfile.py", line 44, in startBackups
>    put("./htableserver", "htableserver")
>  File "/home/evanj/fabric/fabric/network.py", line 364, in
> host_prompting_wrapper
>    return func(*args, **kwargs)
>  File "/home/evanj/fabric/fabric/operations.py", line 292, in put
>    _handle_failure(message=msg % lpath, exception=e)
>  File "/home/evanj/fabric/fabric/operations.py", line 42, in _handle_failure
>    indent(underlying_msg)
>  File "/home/evanj/fabric/fabric/utils.py", line 48, in indent
>    text = '\n'.join(text)
> TypeError
>
>
> The attached patch changes the output to the following:
>
> Fatal error: put() encountered an exception while uploading './htableserver'
>
> Underlying exception message:
>    Failure
>
> Aborting.
>
>
> For more information, in this situation the OpenSSH SFTP client reports:
>
> sftp> put htableserver
> Uploading htableserver to /home/evanj/htableserver
> Couldn't get handle: Failure
>
>
> Using the GIT version of paramiko directly, the exception is:
>
> Traceback (most recent call last):
>  File "../fabtest/bug.py", line 24, in <module>
>    sftp.put(local_path, remote_path)
>  File "/home/evanj/paramiko/paramiko/sftp_client.py", line 549, in put
>    fr = self.file(remotepath, 'wb')
>  File "/home/evanj/paramiko/paramiko/sftp_client.py", line 240, in open
>    t, msg = self._request(CMD_OPEN, filename, imode, attrblock)
>  File "/home/evanj/paramiko/paramiko/sftp_client.py", line 609, in _request
>    return self._read_response(num)
>  File "/home/evanj/paramiko/paramiko/sftp_client.py", line 656, in
> _read_response
>    self._convert_status(msg)
>  File "/home/evanj/paramiko/paramiko/sftp_client.py", line 686, in
> _convert_status
>    raise IOError(text)
> IOError: Failure
>
>
> Evan Jones
>
> --
> Evan Jones
> http://evanjones.ca/
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]