Rclone config gets owned by root on self-overwrite

What is the problem you are having with rclone?

Rclone is attempting to overwrite the config, even when simply using lsf, and this is becoming a problem when rclone is run as superuser (mount) in which case config file gets owned by root. Only choices I have is making the config file immutable with chattr, or appending a chown execution to every operation I make as root. Is there another option besides these two?
Judging by the debug log, cause is an "invalid token", but still works anyway. What should I do?

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

rclone v1.66.0-termux

  • os/version: unknown
  • os/kernel: 4.14.256-Cuh-v1.7-KSU/ed3c033d (aarch64)
  • os/type: android
  • os/arch: arm64 (ARMv8 compatible)
  • go/version: go1.21.6
  • go/linking: dynamic
  • go/tags: noselfupdate

Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
--> Latest Termux release, yes.

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

Dropbox

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

Not relevant.

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

Not necessary.

A log from the command that you were trying to run with the -vv flag

2024/06/09 20:42:08 DEBUG : Setting --config "/data/data/com.termux/files/usr/etc/rclone.conf" from environment variable RCLONE_CONFIG="/data/data/com.termux/files/usr/etc/rclone.conf"
2024/06/09 20:42:08 DEBUG : rclone: Version "v1.66.0-termux" starting with parameters ["rclone" "lsf" "dropbox:sdcard" "-vv"]
2024/06/09 20:42:08 DEBUG : Creating backend with remote "dropbox:sdcard"   2024/06/09 20:42:08 DEBUG : Using config file from "/data/data/com.termux/files/usr/etc/rclone.conf"                                                    2024/06/09 20:42:08 DEBUG : dropbox: Loaded invalid token from config file - ignoring
2024/06/09 20:42:09 DEBUG : Saving config "token" in section "dropbox" of the config file
2024/06/09 20:42:14 ERROR : Failed to save config after 10 tries: failed to move previous config to backup location: rename /data/data/com.termux/files/usr/etc/rclone.conf /data/data/com.termux/files/usr/etc/rclone.conf.old2098118998: operation not permitted
2024/06/09 20:42:14 DEBUG : dropbox: Saved new token in config file
Pictures/
2024/06/09 20:42:14 DEBUG : 7 go routines active
2024/06/09 20:42:14 INFO  : Dropbox root 'sdcard': Committing uploads - please wait...

welcome to the forum,

can simply ignore the error

Thank you.
Kind of difficult to ignore when it is screaming like this. And there is a possibility of another error coming up with different commands and it would be easily missed it if I am to ignore. Shouldn't rclone preserve file attributes like owner and permissions?

2024/06/09 20:11:03 ERROR : Failed to save config after 10 tries: failed to move previous config to backup location: rename /data/data/com.termux/files/usr/etc/rclone.conf /data/data/com.termux/files/usr/etc/rclone.conf.old1927048341: operation not permitted
2024/06/09 20:11:03 ERROR : Failed to save config after 10 tries: failed to move previous config to backup location: rename /data/data/com.termux/files/usr/etc/rclone.conf /data/data/com.termux/files/usr/etc/rclone.conf.old4062869478: operation not permitted