Error running remote control

What is the problem you are having with rclone?

Cannot run a remote control rc command against a rclone server. I am trying a simple ls command against rclone container local files

What is your rclone version (output from rclone version)

1.53.2

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Linux 64bit docker

Which cloud storage system are you using? (eg Google Drive)

Local files

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Server:

$ docker run -it --rm --name=rclone  --volume ~/.config/rclone:/config/rclone     --volume ~/data:/data:shared  -v ~/.ssh/mykey:/keys/mykey -v ~/.ssh/other:/keys/otherkey -v /tmp/rclone:/.cache -p 5572:5572 --user $(id -u):$(id -g)  rclone/rclone:1.53.2 rcd -vvv --rc-addr :5572 --rc-user admin --rc-pass admin
Unable to find image 'rclone/rclone:1.53.2' locally
1.53.2: Pulling from rclone/rclone
Digest: sha256:308f3e39436ef56803e1e38ccce91b95181fd937548687ce5281d65a4749676e
Status: Downloaded newer image for rclone/rclone:1.53.2
2020/11/13 11:18:40 DEBUG : rclone: Version "v1.53.2" starting with parameters ["rclone" "rcd" "-vvv" "--rc-addr" ":5572" "--rc-user" "admin" "--rc-pass" "admin"]
2020/11/13 11:18:40 INFO  : Using --user admin --pass XXXX as authenticated user
2020/11/13 11:18:40 NOTICE: Serving remote control on http://[::]:5572/

Rc client:

docker run -it --rm rclone/rclone:1.53.2 rc --url=http://my-local-ip:5572 --user admin --pass admin core/command command=ls -a /.cache/
2020/11/13 11:20:57 Failed to rc: Failed to read rc response: 500 Internal Server Error:

The rclone config contents with secrets removed.

[sftp1]                                                                                                                                                                                                          
type = sftp                                                                                                                                                                                                                
host = sftp1                                                                                                                                                                                                         
user = sftpuser1                                                                                                                                                                                                       
key_file = /keys/mykey                                                                                                                                                                                     
key_use_agent = false                                                                                                                                                                                                      
md5sum_command = none               
sha1sum_command = none

[sftp2]
type = sftp
host = sftp2
user = sftpuser2
key_file = /keys/anotherkey
key_use_agent = false
md5sum_command = none
sha1sum_command = none

A log from the command with the -vv flag

Server logs:

Unable to find image 'rclone/rclone:1.53.2' locally
1.53.2: Pulling from rclone/rclone
Digest: sha256:308f3e39436ef56803e1e38ccce91b95181fd937548687ce5281d65a4749676e
Status: Downloaded newer image for rclone/rclone:1.53.2
2020/11/13 11:18:40 DEBUG : rclone: Version "v1.53.2" starting with parameters ["rclone" "rcd" "-vvv" "--rc-addr" ":5572" "--rc-user" "admin" "--rc-pass" "admin"]
2020/11/13 11:18:40 INFO  : Using --user admin --pass XXXX as authenticated user
2020/11/13 11:18:40 NOTICE: Serving remote control on http://[::]:5572/
2020/11/13 11:30:03 DEBUG : rc: "core/command": with parameters map[_request:0xc000222500 _response:0xc0001b0000 arg:[/.cache/] command:ls]
2020/11/13 11:30:03 ERROR : rc: "core/command": error: response object is required
expecting *http.ResponseWriter value for key "_response" (was *http.response)
2020/11/13 11:30:03 ERROR : rc: failed to write JSON output: json: unsupported type: func() (io.ReadCloser, error)

hello and welcome to the forum,

not an expert in docket.
perhaps use quotes to surround the command
command="ls -a /.cache/"

I think @asdffdsa is right: you need the quotes.

I am also using docker and have a few tips.

  • If you start the container with docker run --name=rclone <your-settings>, you can play around with rclone commands in a prompt with docker exec -it rclone /bin/sh. Makes playing a lot easier.
  • For the 2nd command you run, it might be more practical to use docker exec instead of docker run (exec uses an existing container and run starts a new container). So, the port 5572 is local (and not in another container). It is also faster and uses less resources.

Yes, running exec inside rclone server it works as expected. But I need to launch remote control from a different container

@asdffdsa In this case it is rc syntax you have to use command=yourcommand and -a commandparams, as it is in the documentation https://rclone.org/rc/#core-command

Came across to test core/command today, but it failed. My rclone is native, not with a docker container. Other than that, everything seems pretty much the same as @juanramb.

Here are the results when I run example commands in doc.

$ rclone rc core/command command=ls -a myremote:/ -o max-depth=1 --rc-addr=127.0.0.1:5599 -vv
2020/11/14 05:54:57 DEBUG : rclone: Version "v1.53.2" starting with parameters ["rclone" "rc" "core/command" "command=ls" "-a" "myremote:/" "-o" "max-depth=1" "--rc-addr=127.0.0.1:5599" "-vv"]
2020/11/14 05:54:57 DEBUG : 4 go routines active
2020/11/14 05:54:57 Failed to rc: Failed to read rc response: 500 Internal Server Error:
2020/11/14 05:54:57 DEBUG : rc: "core/command": with parameters map[_request:0xc0001b8600 _response:0xc00071a0e0 arg:[myremote:/] command:ls opt:map[max-depth:1]]
2020/11/14 05:54:57 ERROR : rc: "core/command": error: response object is required
expecting *http.ResponseWriter value for key "_response" (was *http.response)
2020/11/14 05:54:57 ERROR : rc: failed to write JSON output: json: unsupported type: func() (io.ReadCloser, error)

Different representation with command/arg/opt gets the same result.

rclone rc core/command -a ls -a myremote:/ -o max-depth=1 --rc-addr=127.0.0.1:5599

According to debug log, it seems nothing to do with quotes as args are successfully parsed.

Could someone test and give working examples? Thanks!

1 Like

Still experiencing the same failure in v1.53.3.

Experiencing the same issue when trying to use the official docker image and using rclone to rc to it to execute commands.

1 Like

Issue is filed and fixing now? https://github.com/rclone/rclone/issues/4914