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
rpyc version 4.1.5 (latest)
python 3.8.5 (latest)
operating system: Windows 10 local, Ubuntu LTS 18.04.5 remote
Minimal example
from rpyc.utils.zerodeploy import DeployedServer
from plumbum import SshMachine
mach = SshMachine("somehost", user="***", keyfile="/path/to/keyfile")
server = DeployedServer(mach)
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)