rdiff-backup-users
[Top][All Lists]
Advanced

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

Using SSH : sys.stdin.read(n) non-blocking issue?


From: Simon Defayette
Subject: Using SSH : sys.stdin.read(n) non-blocking issue?
Date: Thu, 14 Oct 2021 20:02:04 -0400

Hi,
  I have a windows 2019 server where I want to backup files over a SSH link
to a Linux Ubuntu server and I get an error in Windows:

Couldn't start up the remote connection by executing

C:\Windows\system32\OpenSSH\ssh.exe -C my_user@[my_server_ip] rdiff-backup
--server

When I use -v9 option it says 'Fatal Error: Truncated header string
(problem probably originated remotely)'

I then downloaded python on the windows 2019 server and run commands that I
saw from Eric Zolf seen here:
https://github.com/rdiff-backup/rdiff-backup/issues/393

>>> import subprocess
>>> process = subprocess.Popen("ssh -C my_user@[my_server_ip] rdiff-backup
--server", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
>>> process.communicate()

and after some testing and some tweaks I may have seen that
self.inpipe.read in _get(self) located in connection.py is non-blocking.  I
think this is an issue since it will raise an exception right away if there
are no bytes available.

  def _get(self):
        """Read an object from the pipe and return (req_num, value)"""
        header_string = self.inpipe.read(9)
        if not len(header_string) == 9:
            raise ConnectionReadError("Truncated header string (problem "
                                      "probably originated remotely)")

Can someone confirm this?

Thanks,
Simon Defayette


reply via email to

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