paramiko / paramiko/paramiko

Duplicity hangs trying to upload files to remote server

Open
#331 30 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs investigation SFTP Stream behavior
Dominant language
Python
Stars
9.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

[Maintainer note: this thread kinda got hijacked by the maybe-related, maybe-not-related Duplicity problem mentioned in comments below. This OP is left as an archeological site. Sorry OP.]

I can connect to the host without issues but command execution doesn't work as expected:

In [13]: ssh.get_transport().is_alive()
Out[13]: True

In [14]: stdin, stdout, stderr = ssh.exec_command('ls')
DEBUG:paramiko.transport:[chan 2] Max packet in: 34816 bytes
DEBUG:paramiko.transport:[chan 2] Max packet out: 32768 bytes
INFO:paramiko.transport:Secsh channel 2 opened.
DEBUG:paramiko.transport:[chan 2] Sesch channel 2 request ok

In [15]: stdout.channel.recv_ready()
Out[15]: False

In [16]: stdout.channel.exit_status_ready()
Out[16]: False

On the other hand:
In [5]: chan = ssh.invoke_shell()

In [6]: chan.send('uname')
Out[6]: 5

In [7]: chan.recv_ready()
Out[7]: True

In [8]: chan.exit_status_ready()
Out[8]: False

In [9]: chan.send('\n')
Out[9]: 1

In [10]: chan.exit_status_ready()
Out[10]: False

In [11]:

In [11]: chan.recv_ready()
Out[11]: True

In [13]: chan.recv(1024)
Out[13]: 'Last login: Sat Apr 26 04:58:23 2014 from XXX\r\r\n[USER@XXX ~]# uname\r\nLinux\r\n[USER@XXX ~]# '

So command was executed successfully but paramiko doesn't know about it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ssh.exec_command and ssh.invoke_shell entry points shown in the report, then inspect stdout.channel behavior for the ls example. Reproduce the difference between command execution and the interactive shell, and compare recv_ready() and exit_status_ready(). Done means the reported remote command behavior is understood and corrected or clearly reproduced with a focused regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.