This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unexpected socket exception on SFTP 'STOR' command
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: open Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: blanquier, eric.smith, larsschellhas, r.david.murray
Priority: normal Keywords:

Created on 2015-09-30 13:20 by blanquier, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
ftp_client.jpg blanquier, 2015-09-30 14:15
ftp_server.jpg blanquier, 2015-09-30 14:15
gui_ftp.py blanquier, 2015-09-30 15:10
Messages (10)
msg251933 - (view) Author: Blanquier (blanquier) Date: 2015-09-30 13:20
With Filezilla Server 0.9.53, SFTP activated (force SSL on login, allow explicit FTP over TLS). From the FTP client point of view: when I use ftp_id.storbinary( 'STOR file_name'...), a socket.error exception arrive sometime. It's a socket.error exception and the errno record value is 0 (zero). The full message is b'[Errno 0] Error'. If I want to obtain the real server answer, I MUST call ftp_id.getresp().
It looks like a desynchronisation between the command and the answer.

Could you correct it please ?

Best regards.
msg251938 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-30 13:33
Does this have anything to do with python itself and its standard library?  From your description this sounds like a problem with filezilla and should be reported to them.
msg251939 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-30 13:35
(Note: issue 25278 with a small amount of additional info closed as a duplicate of this one).
msg251941 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2015-09-30 13:45
From the info in issue 25279, I'd say it's an error in your code.

But to make sure it's not an error in the stdlib, can you show us your code? Without that, it's not possible to diagnose this any further.
msg251942 - (view) Author: Blanquier (blanquier) Date: 2015-09-30 14:15
Hi,

If I use the Python FTP instead of Python SFTP, there is no problem. The 
Python library works fine as well as the Filezilla server.
The exception occures inside ssl.py file (line 791) when running 
self.sslobj.shutdown() instruction.

I understand that the problem could be due to Filezilla server as well 
as Python ftplib code and it's difficult to say who is wrong.

I have done 2 snapshots: one on the client side and the second on the 
sever side (see attached document).
On the client side, we can see that the problem occure with the 
/tnr_nemo_dico.pyc/ file.
On the server size, the last line indicates that the transfert is 
succesfull.
It's the reason why I think that the Python FTP lib could have a bug 
when SFTP is in usage. It's a random problem because previous uploads 
have been OK.
Are you agree with me or do I make a mistake ?

Best regards,

Philippe Blanquier

Le 30/09/2015 15:33, R. David Murray a écrit :
> R. David Murray added the comment:
>
> Does this have anything to do with python itself and its standard library?  From your description this sounds like a problem with filezilla and should be reported to them.
>
> ----------
> nosy: +r.david.murray
> resolution:  -> third party
> stage:  -> resolved
> status: open -> pending
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue25278>
> _______________________________________
>
msg251944 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-30 14:43
As Eric said, we really can't diagnose this unless you show is your python code (as code, not as a partial screenshot).
msg251948 - (view) Author: Blanquier (blanquier) Date: 2015-09-30 15:10
Hi,

I send you the file as attached document.
I use the test_sftp_upload() as entry point.

Le 30/09/2015 16:43, R. David Murray a écrit :
> R. David Murray added the comment:
>
> As Eric said, we really can't diagnose this unless you show is your python code (as code, not as a partial screenshot).
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue25278>
> _______________________________________
>
msg252107 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2015-10-02 11:27
You'll need to reproduce this in a smaller piece of code that demonstrates the problem. The code you've included is very large, and imports libraries we don't have access to.

Otherwise, we can't reproduce it and we can't help.
msg252222 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-10-03 15:51
I wonder if this has any relationship to issue 19500.
msg377409 - (view) Author: Lars Schellhas (larsschellhas) Date: 2020-09-23 16:55
I am pretty sure that it is connected to issue 19500. And somehow that issue still isn't resolved although there are already solutions provided.
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69465
2020-09-23 16:55:42larsschellhassetnosy: + larsschellhas
messages: + msg377409
2015-10-03 15:51:13r.david.murraysetmessages: + msg252222
2015-10-02 11:27:12eric.smithsetmessages: + msg252107
2015-09-30 15:10:36blanquiersetfiles: + gui_ftp.py

messages: + msg251948
2015-09-30 14:43:34r.david.murraysetmessages: + msg251944
2015-09-30 14:15:13blanquiersetfiles: + ftp_client.jpg, ftp_server.jpg
status: pending -> open
messages: + msg251942
2015-09-30 13:45:48eric.smithsetstatus: open -> pending
2015-09-30 13:45:42eric.smithsetstatus: pending -> open
nosy: + eric.smith
messages: + msg251941

2015-09-30 13:36:00r.david.murraysetstatus: open -> pending
2015-09-30 13:35:49r.david.murraysetstatus: pending -> open

messages: + msg251939
2015-09-30 13:34:27r.david.murraylinkissue25279 superseder
2015-09-30 13:33:24r.david.murraysetstatus: open -> pending

nosy: + r.david.murray
messages: + msg251938

resolution: third party
stage: resolved
2015-09-30 13:20:44blanquiercreate