Rclone not able to get the updated credentials in the ~/.aws/credentials file once the copy command has started

What is the problem you are having with rclone?

I am using rclone to copy the data from AWS S3 to a PVC mount.
I am using a custom rclone.conf file where I have defined the remotes with AWS PROFILE. I am using this because I am refreshing the credentials every 15 mins as those are temporary credentials for that role. If the rclone copy does not happen in that 15 mins it is giving error saying that the credentials have been expired even though I am refreshing the credentials after 15 mins in ~/.aws/ credentials file.

Is there a way where I can give the credentials to rclone dynamically so that the already submitted rclone copy command doesn't fail?

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

version 1.69

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

AWS S3

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

rclone --config /tmp/rclone.conf copy -v --stats=1s --transfers $CONCURRENCY $DRY_RUN_FLAG "${SOURCE}" "${DESTINATION}"

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

[source]

type = s3
provider = AWS
env_auth = true
profile = source
region = us-east-2

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

Failed to copy: failed to open source object: operation error S3: GetObject, https response error StatusCode: 400,
api error ExpiredToken: The provided token has expired.

welcome to the forum,

might try something like

rclone rc backend/command command=set fs=s3: -o session_token=X -o access_key_id=X -o secret_access_key=X

I believe this won't help as the session_token will keep on changing. And I want rclone to read the token from ~/.aws/credentials file every time it makes a call to aws S3. I believe currently it does not do it right now

well, the doc link i shared has an explicit example using session_token. did you try, did not work??
This rebuilds the connection to the s3 backend when it is called with the new parameters


good chance that rclone does not do that.