Rclone mount can't read the realtime ak/sk/session_token when set "env_auth=true"

What is the problem you are having with rclone?

The "env_auth=true" parameter does not appear to have the "mount" process read the latest ak/sk/session_token in the environment in real time.

After my ak/sk/session_token credentials expired, I tried to modify the credentials in the credentials file and then make the mount process aware of the new credentials, but failed.

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

rclone v1.67.0

  • os/version: ubuntu 18.04 (64 bit)
  • os/kernel: 3.10.0-862.14.1.5.h687.eulerosv2r7.x86_64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.4
  • go/linking: static
  • go/tags: none

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

s3

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

#This command is used to read the ak/sk/session_token in the credentials file in real time..
rclone lsd remote:/ --s3-shared-credentials-file=/data/credentials 

# the "mount" process is not loading the latest environment variables or credentials files.
rclone mount remote:/xxx/ /data/mount_point --vfs-cache-mode=full --daemon --s3-shared-credentials-file=/data/credentials -vv

The rclone config contents with secrets removed.

[obs-mount]
type = s3
provider = HuaweiOBS
env_auth = true
region = xxx
endpoint = xxx
acl = bucket-owner-full-control

A log from the command with the -vv flag

# After the credential expires, and update the "/data/credentials" file, then run the "ls /data/mount_point" command on the mount point. The log is as follows:
2024/07/23 11:33:24 DEBUG : : Readdir:
2024/07/23 11:33:24 DEBUG : : Dir.ReadDirAll error: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
        status code: 403, request id: 00000190DDA6A6DC4019612B38DD854, host id: MOCKQjIxQTYxQzZDMDAwMDAxMzQwMzFCRTgwMDUyOTNBQUFBQUFBQWJiYmJiYmJ
2024/07/23 11:33:24 ERROR : IO error: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
        status code: 403, request id: 00000190DDA6A6DC4019612B38DD854, host id: MOCKQjIxQTYxQzZDMDAwMDAxMzQwMzFCRTgwMDUyOTNBQUFBQUFBQWJiYmJiYmJ
2024/07/23 11:33:24 DEBUG : : >Readdir: ds=<nil>, errno=input/output error
2024/07/23 11:33:27 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)

# but the "rclone lsd" command can works well, like this:
2024/07/23 11:44:59 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "lsd" "remote:/dir-test" "-vv" "--s3-shared-credentials-file=/data/credentials"]
2024/07/23 11:44:59 DEBUG : Creating backend with remote "remote:/dir-test"
2024/07/23 11:44:59 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2024/07/23 11:44:59 DEBUG : obs-mount: detected overridden config - adding "{5seX6}" suffix to name
2024/07/23 11:44:59 DEBUG : Resolving service "s3" region "xxxx"
2024/07/23 11:44:59 DEBUG : fs cache: renaming cache item "remote:/dir-test" to be canonical "obs-mount{5seX6}:vscode-test"
           0 2000-01-01 08:00:00        -1 MJJJJJ
           0 2000-01-01 08:00:00        -1 MJJJJJdir-test

I noticed a similar issue in the rclone repository, but no one has responded so far:

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