Strange "failed to set permission" errors in Log

What is the problem you are having with rclone?

rclone log shows

rclone[27561]: Failed to set permissions on config file: chmod /root/config/.rclone.conf2795095508: no such file or directory

every hour. Apart from that everything seems to work. It started after upgrading to FreeBSD 13.1. It is quite consistent app. 15 minutes after the hour. The PID corresponds to an overrunning rclone mount (same happens with cmount).

Run the command 'rclone version' and share the full output of the command.

Happened with 1.59.0 and now with this as well:

  • os/version: freebsd 13.1-release-p1 (64 bit)
  • os/kernel: 13.1-release-p1 (amd64)
  • os/type: freebsd
  • os/arch: amd64
  • go/version: go1.19
  • go/linking: dynamic
  • go/tags: cmount

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

Google Drive

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

/usr/local/bin/rclone --config=/root/config/.rclone.conf cmount TEST: /data/test --allow-other --dir-cache-time 1000h --syslog --syslog-facility LOCAL5 --log-level INFO --poll-interval 15s --umask 002 --user-agent="TMount" --rc --cache-dir=/mnt/vfscache --vfs-cache-mode full --vfs-cache-max-size 820G --vfs-cache-max-age 9999h --vfs-read-ahead 1G --buffer-size 100M --disable-http2 --tpslimit 10 --tpslimit-burst 10 --drive-pacer-burst 200 --drive-pacer-min-sleep 10ms --bind

A log from the command with the -vv flag

rclone[27561]: Failed to set permissions on config file: chmod /root/config/.rclone.conf2795095508: no such file or directory

Any idea where to look? Where are the strange .rclone.confxxxxx (x being a number) things coming from?

hello and welcome to the forum,

gdrive tokens expire after one hour.
when that happens, rclone requests a new token from gdrive.

now rclone has to save that token in the config file.
as i understand it, rclone
--- copies the rclone.conf to a temp config file with a random name.
--- writes that token to the temp config file.
--- renames the temp config file back to rclone.conf

so it could be a simple file/dir permissions issue.
which type of user is running rclone mount, root or non-root?

and this is the rclone source code


and thanks for the answer!

rclone mount runs as root. And the strange thing is: Nothing on the setup changed. No permissions I am aware of. No other user running. Only a FreeBSD upgrade. The contents of rclone.conf seems to change (and the new tokens are written to the file). Will verify this though. Should happen again in appr. 20 minutes.

So there seems to be no functional impact. But the error messages are "new".

If it is a permissions error: Why is the new token successfully written to the rclone.conf?

not an expert, but i would just check all the permissions and ownership of the rclone.conf and the directory that rclone.conf is located.

did you see the source code link i shared?

rclone asks the OS to chmod the file to 0600, the OS returns an error.

err = os.Chmod(f.Name(), fileMode)
	if err != nil {
		fs.Errorf(nil, "Failed to set permissions on config file: %v", err)


verified. The token was just updated successfully (as expected).

Just looked at the source code. The 1 Mio $ question then is: Why does the chmod fail for the process even though it is running as root?

It is trying a chmod 0600 (which is what the file permissions are at). The directory settings are "drwxr-xr-x". And again: root should be able to chmod all the time. A manual "chmod 0600 .rclone.conf" also produces no error. Only thing I can think of is that the config file is within an encrypted filesystem (PEFS) which is mounted. But once more: All of this did not change in the past year. Maybe FreeBSD 13.1 introduced "something new" here which throws an error.

However: The error states "no such file or directory". So the question is: Why is the temp file not there?

good question...

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