Error in rclone rc copyfile command

Hello. I am new to rclone and trying to use rclone rc commands.

While I was trying to figure it out from the document ( https://rclone.org/rc/ )

operation/copy functions seems not work.
when running copyfile command. new file is not copied to the remote destination but new file is created on my instance file system.

All commands are executed on the same linux vm using two terminal sessions, one to start rclone server and another for running rclone rc command.

Step 1) Run rclone server with rclone rcd command

ubuntu@aws-s3-data:~$ rclone -vv rcd  awsS3:dstg-test --rc-pass rpassword --rc-serve --rc-user ruser

Step 2) Run rclone rc operation/copyfile

ubuntu@aws-s3-data:~$ rclone -vv rc operations/copyfile srcFs=awsS3: srcRemote=/dstg-test/my-test/README.md dstFs=awsS3 dstRemote=/dstg-test/my-test/copyTest  --user ruser --pass rpassword 
2018/12/10 18:35:04 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vv" "rc" "operations/copyfile" "srcFs=awsS3:" "srcRemote=/dstg-test/my-test/README.md" "dstFs=awsS3" "dstRemote=/dstg-test/my-test/copyTest" "--user" "ruser" "--pass" "rpassword"]
{}
2018/12/10 18:35:05 DEBUG : 4 go routines active
2018/12/10 18:35:05 DEBUG : rclone: Version "v1.45" finishing with parameters ["rclone" "-vv" "rc" "operations/copyfile" "srcFs=awsS3:" "srcRemote=/dstg-test/my-test/README.md" "dstFs=awsS3" "dstRemote=/dstg-test/my-test/copyTest" "--user" "ruser" "--pass" "rpassword"]

Message from rclone server

2018/12/10 18:35:04 DEBUG : rc: "operations/copyfile": with parameters map[dstFs:awsS3 dstRemote:/dstg-test/my-test/copyTest srcFs:awsS3: srcRemote:/dstg-test/my-test/README.md]
2018/12/10 18:35:05 DEBUG : /dstg-test/my-test/README.md: Couldn't find file - need to transfer
2018/12/10 18:35:05 INFO  : /dstg-test/my-test/README.md: Copied (new)
2018/12/10 18:35:05 DEBUG : rc: "operations/copyfile": reply map[]: <nil>

Step 3) Check if file is copied from s3 ( fail… )

ubuntu@aws-s3-data:~$ rclone -vv ls awsS3:dstg-test/my-test/README.md
2018/12/10 18:35:59 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vv" "ls" "awsS3:dstg-test/my-test/README.md"]
2018/12/10 18:35:59 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2018/12/10 18:35:59 DEBUG : pacer: Reducing sleep to 0s
     4857 README.md
2018/12/10 18:35:59 DEBUG : 4 go routines active
2018/12/10 18:35:59 DEBUG : rclone: Version "v1.45" finishing with parameters ["rclone" "-vv" "ls" "awsS3:dstg-test/my-test/README.md"]

ubuntu@aws-s3-data:~$ rclone -vv ls awsS3:dstg-test/my-test/copyTest
2018/12/10 18:36:07 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vv" "ls" "awsS3:dstg-test/my-test/copyTest"]
2018/12/10 18:36:07 DEBUG : Using config file from "/home/ubuntu/.config/rclone/rclone.conf"
2018/12/10 18:36:07 DEBUG : pacer: Reducing sleep to 0s
2018/12/10 18:36:07 DEBUG : 4 go routines active
2018/12/10 18:36:07 DEBUG : rclone: Version "v1.45" finishing with parameters ["rclone" "-vv" "ls" "awsS3:dstg-test/my-test/copyTest"]

file is created on my instance, not the awsS3 bucket.

ubuntu@aws-s3-data:~$ ls -trl awsS3/
total 4
drwxrwxr-x 3 ubuntu ubuntu 4096 Dec 10 18:59 dstg-test
ubuntu@aws-s3-data:~$ tree awsS3/
awsS3/
└── dstg-test
    └── my-test
        └── copyTest

2 directories, 1 file
ubuntu@aws-s3-data:~$

This is missing a : on the end dstFs=awsS3 - I think that is the problem.

Thank you for your reply.
I’ve tried adding : on the end of dstFs=awsS3 . but still it failed to copy file.

ubuntu@aws-s3-data:~$ rclone -vv rc operations/copyfile srcFs=awsS3: srcRemote=/dstg-test/my-test/README.md dstFs=awsS3: dstRemote=/dstg-test/my-test/copyTest  --user ruser --pass rpassword 
2018/12/11 08:53:32 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vv" "rc" "operations/copyfile" "srcFs=awsS3:" "srcRemote=/dstg-test/my-test/README.md" "dstFs=awsS3:" "dstRemote=/dstg-test/my-test/copyTest" "--user" "ruser" "--pass" "rpassword"]
2018/12/11 08:53:32 Failed to rc: Failed to read rc response: 500 Internal Server Error: {
	"error": "MethodNotAllowed: Method Not Allowed\n\tstatus code: 405, request id: B247AC1C211BDF1A, host id: Vq403xg3M/NA3O8LvrTusIvS9TaybNdzk0HTbibMzDmb9EWh2tQuKOFAoZ/TsGIVBfoDjXeRSUA=",
	"input": {
		"dstFs": "awsS3:",
		"dstRemote": "/dstg-test/my-test/copyTest",
		"srcFs": "awsS3:",
		"srcRemote": "/dstg-test/my-test/README.md"
	},
	"path": "operations/copyfile",
	"status": 500
}
ubuntu@aws-s3-data:~$ 2018/12/11 08:53:32 DEBUG : rc: "operations/copyfile": with parameters map[dstFs:awsS3: dstRemote:/dstg-test/my-test/copyTestsrcFs=awsS3:dstg-test/my-test srcRemote=README.md]
2018/12/11 08:53:32 DEBUG : pacer: Reducing sleep to 0s
2018/12/11 08:53:32 DEBUG : /dstg-test/my-test/README.md: Couldn't find file - need to transfer
2018/12/11 08:53:32 ERROR : /dstg-test/my-test/README.md: Failed to copy: MethodNotAllowed: Method Not Allowed
	status code: 405, request id: B247AC1C211BDF1A, host id: Vq403xg3M/NA3O8LvrTusIvS9TaybNdzk0HTbibMzDmb9EWh2tQuKOFAoZ/TsGIVBfoDjXeRSUA=
2018/12/11 08:53:32 ERROR : rc: "operations/copyfile": error: MethodNotAllowed: Method Not Allowed
	status code: 405, request id: B247AC1C211BDF1A, host id: Vq403xg3M/NA3O8LvrTusIvS9TaybNdzk0HTbibMzDmb9EWh2tQuKOFAoZ/TsGIVBfoDjXeRSUA=

instead, I’ve changed parameters.
adding directory path to the end of srcFS and using only filename for the srcRemote.

srcFs= awsS3 ==> awsS3:dstg-test/my-test
srcRemote=dstg-test/my-test/README.md ==> README.md

and this one is working. maybe I’ve got it wrong about using parameters.

ubuntu@aws-s3-data:~$ rclone -vv rc operations/copyfile srcFs=awsS3:dstg-test/my-test srcRemote=README.md dstFs=awsS3:dstg-test/my-test dstRemote=copyTest  --user ruser --pass rpassword 
2018/12/11 08:55:31 DEBUG : rclone: Version "v1.45" starting with parameters ["rclone" "-vv" "rc" "operations/copyfile" "srcFs=awsS3:dstg-test/my-test" "srcRemote=README.md" "dstFs=awsS3:dstg-test/my-test" "dstRemote=copyTest" "--user" "ruser" "--pass" "rpassword"]
{}
2018/12/11 08:55:31 DEBUG : 4 go routines active
2018/12/11 08:55:31 DEBUG : rclone: Version "v1.45" finishing with parameters ["rclone" "-vv" "rc" "operations/copyfile" "srcFs=awsS3:dstg-test/my-test" "srcRemote=README.md" "dstFs=awsS3:dstg-test/my-test" "dstRemote=copyTest" "--user" "ruser" "--pass" "rpassword"]
ubuntu@aws-s3-data:~/sr-ceph/dstg-bucket$ 

Yes you’ll need the bucket in the srcFs and dstFs otherwise you’ll get that MethodNotAllowed error.

I forgot about that - sorry!