Skip to content

SFTP uploads fail on SFTP Server freeFTPd #61

Description

Hi,

I encountered a compatibility issue while using sftpretty against a legacy SFTP server freeFTPd 1.0. Needing your support here.
NOTE: The same issue doesn't appear when using pysftp with the same underlying paramiko

Code snippet that caused this issue.

        upload_folder_path = posixpath.dirname(upload_path)
        self.conn.mkdir_p(remotedir=upload_folder_path)
        self.conn.put(
            localfile=local_path,
            remotepath=upload_path,
            confirm=self.config.confirm
        )

Error snapshot

[chan 0] Opened sftp connection (server version 3)
Channel Name: [636641c1aee34537b02f02f8a89107ac]
Current Working Directory: [In]
Secsh channel 1 open FAILED: : Connect failed
Traceback (most recent call last):
  File "xxx", line 20, in _upload_single_file
    self.conn.put(
  File "/usr/local/lib/python3.10/site-packages/sftpretty/__init__.py", line 804, in put
    return _put(self, localfile, remotepath=remotepath, callback=callback,
  File "/usr/local/lib/python3.10/site-packages/sftpretty/__init__.py", line 765, in _put
    with self._sftp_channel() as channel:
  File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.10/site-packages/sftpretty/__init__.py", line 306, in _sftp_channel
    raise err
  File "/usr/local/lib/python3.10/site-packages/sftpretty/__init__.py", line 292, in _sftp_channel
    _channel = SFTPClient.from_transport(self._transport)
  File "/usr/local/lib/python3.10/site-packages/paramiko/sftp_client.py", line 164, in from_transport
    chan = t.open_session(
  File "/usr/local/lib/python3.10/site-packages/paramiko/transport.py", line 875, in open_session
    return self.open_channel(
  File "/usr/local/lib/python3.10/site-packages/paramiko/transport.py", line 1006, in open_channel
    raise e
  File "/usr/local/lib/python3.10/site-packages/paramiko/transport.py", line 2055, in run
    ptype, m = self.packetizer.read_message()
  File "/usr/local/lib/python3.10/site-packages/paramiko/packet.py", line 459, in read_message
    header = self.read_all(self.__block_size_in, check_rekey=True)
  File "/usr/local/lib/python3.10/site-packages/paramiko/packet.py", line 303, in read_all
    raise EOFError()
EOFError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions