tomerfiliba-org / rpyc

RPyC (Remote Python Call) - A transparent and symmetric RPC library for python
http://rpyc.readthedocs.org
Other
1.57k stars 243 forks source link

zerodeploy example fails at file copy step - No such file or directory #401

Open JeremyKarst opened 4 years ago

JeremyKarst commented 4 years ago

Running rpyc zerodeploy example from a windows 10 client to a remote ubuntu machine fails at the ssh file copy step:

Example code from https://rpyc.readthedocs.io/en/latest/docs/zerodeploy.html#zerodeploy: from rpyc.utils.zerodeploy import DeployedServer from plumbum import SshMachine

mach = SshMachine("somehost", user="***", keyfile="/path/to/keyfile") server = DeployedServer(mach)

conn1 = server.classic_connect() print conn1.modules.sys.platform

server.close()

Running this code fails at the server = DeployedServer(mach) step with the following traceback:

PS C:\Users\jerem\NextCloud\Desktop\rpyc> py -3 rpyc_test.py Traceback (most recent call last): File "rpyc_test.py", line 7, in server = DeployedServer(mach) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\rpyc\utils\zerodeploy.py", line 100, in init copy(rpyc_root, tmp / "rpyc") File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\path\utils.py", line 96, in copy dst.remote.upload(src, dst) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\machines\ssh_machine.py", line 299, in upload self._scp_command(src, "%s:%s" % (self._fqhost, shquote(dst))) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\commands\base.py", line 96, in call return self.run(args, **kwargs)[1] File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\commands\base.py", line 232, in run return p.run() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\commands\base.py", line 193, in runner return run_proc(p, retcode, timeout) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\commands\processes.py", line 302, in run_proc return _check_process(proc, retcode, timeout, stdout, stderr) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\commands\processes.py", line 22, in _check_process proc.verify(retcode, timeout, stdout, stderr) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\plumbum\machines\base.py", line 24, in verify raise ProcessExecutionError( plumbum.commands.processes.ProcessExecutionError: Unexpected exit code: 1 Command line: | 'C:\Windows\System32\OpenSSH\scp.exe' -r /C/Users/user/AppData/Local/Programs/Python/Python38/lib/site-packages/rpyc user@172.16.25.12:/home/user/tmp.zwkRbBQoLA/rpyc Stderr: | /C/Users/user/AppData/Local/Programs/Python/Python38/lib/site-packages/rpyc: No such file or directory

I can verify that the file copy completed correctly and the directory /home/user/tmp.zwkRbBQoLA/rpyc is available on the remote machine.

Environment
Minimal example

from rpyc.utils.zerodeploy import DeployedServer from plumbum import SshMachine mach = SshMachine("somehost", user="***", keyfile="/path/to/keyfile") server = DeployedServer(mach)

tddschn commented 5 months ago

Got the same error on Python 3.11 when trying to deploy on a Linux host