What is the problem you are having with rclone?
rclone logs Failed to save config after 10 tries: failed to create temp file for new config: open /.rclone.conf4240129501: permission denied
as ERROR
while in my opinion it should log this as a WARNING
.
I am trying to use bitnami/rclone:1.69.1
to run rclone in a k8s cronjob.
Since I use the image in a Helm chart, I inject the whole config as environment variables e.g. RCLONE_CONFIG_<SOURCENAME>_URL
etc.
I think the problem is that in bitnami's rclone image, the user that the container uses does not have a home directory so its home directory is /
.
rclone tries to write the config temp file to /
and then (I think) moving it to its set config directory. I've seen though that even if it logs that as an error, rclone still copies/syncs the files between the sources, so it works as intended. I think that after trying to write the temp config file in /
, it tries to write it elsewhere, in a directory where the user can write.
I must say that this error does not occur when I am running the community rclone/rclone:1.69.1
image from Docker Hub, since it uses root.
Is there a way to set the rclone temp config file directory to another directory with write permissions? I've tried browsing the docs but besides Documentation, I didn't really found much.
I've tried setting RCLONE_CONFIG_DIR
and XDG_CONFIG_HOME
but nothing much happened. Setting HOME
to /tmp
worked but it seems more like a workaround than a fix.
Am I doing something wrong here? I think I'm missing something.
Run the command 'rclone version' and share the full output of the command.
rclone v1.69.1
- os/version: debian 12.10 (64 bit)
- os/kernel: 5.10.219-208.866.amzn2.x86_64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.23.7
- go/linking: dynamic
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
S3, SFTP, HTTP...
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
copy 'dest:' --filter='+ /**' --filter='- **' source:foo-bucket/baz --use-json-log
Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.
2025/03/17 19:59:50 NOTICE: Config file "/.rclone.conf" not found - using defaults
; empty config
Here's the config environment variables that have been set:
RCLONE_CONFIG_DIR=/tmp/rclone/config
RCLONE_CONFIG_SOURCE_ENV_AUTH=true
RCLONE_CONFIG_DEST_PASS=rclone_obscured_password
RCLONE_CONFIG_SOURCE_TYPE=s3
RCLONE_CONFIG_DEST_HOST=sftp.foo.com
RCLONE_CONFIG_DEST_USER=user
RCLONE_CONFIG_DEST_TYPE=sftp
RCLONE_CONFIG_SOURCE_REGION=aws-region
RCLONE_CONFIG_SOURCE_PROVIDER=AWS
A log from the command that you were trying to run
Config file "/config/rclone/rclone.conf" not found - using defaults
Failed to save config after 10 tries: failed to create temp file for new config: open /.rclone.conf4240129501: permission denied
< auth and files sync DEBUG and INFO logs>