Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy leaks paramiko exception #5

Open
LourensVeen opened this issue Jan 2, 2019 · 1 comment
Open

Copy leaks paramiko exception #5

LourensVeen opened this issue Jan 2, 2019 · 1 comment

Comments

@LourensVeen
Copy link
Contributor

If the connection drops during a file copy operation, then a paramiko.ssh_exception.SSHConnectionError is raised. It would probably be better if you got an ordinary Python ConnectionError, or a Cerulean-specific exception type, as the fact that we use paramiko is really an implementation detail that should not affect the public API.

Backtrace:

  File "/usr/local/lib/python3.5/dist-packages/cerulean/copy_files.py", line 82, in copy
    copy_permissions, source_path, callback, 0, size)
  File "/usr/local/lib/python3.5/dist-packages/cerulean/copy_files.py", line 124, in _copy
    already_written, size)
  File "/usr/local/lib/python3.5/dist-packages/cerulean/copy_files.py", line 258, in _copy_dir
    permission, source_path.has_permission(permission))
  File "/usr/local/lib/python3.5/dist-packages/cerulean/path.py", line 516, in set_permission
    self.filesystem._set_permission(self.__path, permission, value)
  File "/usr/local/lib/python3.5/dist-packages/cerulean/sftp_file_system.py", line 283, in _set_permission
    self._chmod(lpath, mode)
  File "/usr/local/lib/python3.5/dist-packages/cerulean/sftp_file_system.py", line 288, in _chmod
    self.__sftp.chmod(str(lpath), mode)
  File "/usr/local/lib/python3.5/dist-packages/paramiko/sftp_client.py", line 541, in chmod
    self._request(CMD_SETSTAT, path, attr)
  File "/usr/local/lib/python3.5/dist-packages/paramiko/sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "/usr/local/lib/python3.5/dist-packages/paramiko/sftp_client.py", line 845, in _read_response
    raise SSHException("Server connection dropped: {}".format(e))
paramiko.ssh_exception.SSHException: Server connection dropped: 
@LourensVeen
Copy link
Contributor Author

Actually, we should probably also retry first, and only raise if we cannot reconnect...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant