Rclone tries to create tmp config when running copy and fails

What is the problem you are having with rclone?

I have a config file in a folder for which the user running rclone only as read access

What is your rclone version (output from rclone version)

rclone v1.53.3

  • os/arch: linux/arm
  • go version: go1.15.5

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

arch linux

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

irrelevant i think (onedrive)

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

/usr/bin/rclone copy /backup backuponedrive:/backup --immutable --min-age 30m --config=/confs/rclone.conf

The rclone config contents with secrets removed.

irrelevant i think

A log from the command with the -vv flag

2020/12/25 17:53:00 ERROR : error reading available plugins: Error creating : /home/rclonerun/.cache/rclone/webgui/plugins/config
2020/12/25 17:53:00 DEBUG : --min-age 30m0s to 2020-12-25 17:23:00.601393024 +0100 CET m=-1799.874637304
2020/12/25 17:53:00 DEBUG : rclone: Version "v1.53.3" starting with parameters ["rclone" "copy" "/storage/backup/msibackup" "backup onedrive:/mainbackup" "--immutable" "--min-age" "30m" "--config=/confs/rclone.conf" "-vv"]
2020/12/25 17:53:00 DEBUG : Creating backend with remote "/storage/backup/msibackup"
2020/12/25 17:53:00 DEBUG : Using config file from "/confs/rclone.conf"
2020/12/25 17:53:00 DEBUG : Creating backend with remote "backup onedrive:/mainbackup"
2020/12/25 17:53:00 DEBUG : One drive root 'mainbackup': Token expired but no uploads in progress - doing nothing
2020/12/25 17:53:00 DEBUG : backup onedrive: Loaded invalid token from config file - ignoring
2020/12/25 17:53:05 Failed to save config after 10 tries: Failed to create temp file for new config: open /confs/rclone.conf454082206: permission denied

when running exact same command with user that has write access in the config folder it works as expected

hello and welcome to the forum,

tokens expire, so when rclone is given a new token, it needs to save it to the config file.

That's not the problem when running the exact same command from a user with write acces in the config folder is works

This is the real problem

I don't understand, The problem is that rclone tries to create a temp config file in the same directory as the given config file but fails because it doesn't have write access. I don't understand how that is expected behavior and why id even needs to create a temp config file if the command is rsync copy

as to why rclone must save the token to the config file i do not know.
seems that if the config file is read-only, rclone should save the token to ram.

not sure if this helps:
i use service files, so in my config there are no tokens.

no worries, as we have many rclone experts, who should stop by soon.

https://github.com/rclone/rclone/issues/3655
Failed to save config file - #10 by jchwenger
Rclone config dir owned by root

Many programs write a temp file to replace the a file in use as it does this as it needs to make sure it doesn't mess up/corrupt the config file so it writes everything out to a temp file and replaces it.

You need to have write access to the location that the config is in if you want to use it.

1 Like

if rclone wants to change config file, don't be scared. it knows what it does :smiley:
copy your config file to a writable location and run rclone using the copy from now on:

cp /confs/rclone.conf /path/to/writable/

/usr/bin/rclone copy /backup backuponedrive:/backup --immutable --min-age 30m  --config /path/to/writable/rclone.conf 
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.