What is the problem you are having with rclone?
We are running a project that facilitates connection for different users to different drives for various actions. We have a problem with large files that needs to be updated/sync etc. on Google Drive. When the process time exceeds 1h, the previous token we used for this task expires and needs to be refreshed. As I read other threads, I understood that rclone refreshes automatically the tokens. The problem is that we cannot have a global rconf for each individual users from where rclone can take the refresh token and refresh it because multiple users can trigger actions at the same time and data race can happen over rconf.
Credentials for Google Auth are created on the fly in our backend logic. (Basically, the user is inserting in UI, client_id, client_secret and client_token). Then the users hits something like "trigger" and then the command listed bellow is created and triggered in a subprocess.
OS: Linux - Ubuntu 20.04
Any thoughts how can I achieve this ?
Run the command 'rclone version' and share the full output of the command.
Version: rclone-v1.56.2-linux-amd64
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
)
rclone -vv --drive-token {access_token: some_token, token_type: "Bearer", "refresh_token": some_refresh_token, "expiry": "2022-02-10T23:05:36.476357+00:00" } --drive-team-drive "some_drive_team_hash" copy :drive:ExecOnline/5. Managed Services/b.Productio/GDriveConnector /tmp/tmpgx1tp1sv --filter "+ To_Path/**/ *" --filter "- From_Some_path/ **/*.*" --filter - From_SomePath/* --filter "- *.DS_Store" --filter "-*" --max-age "0001-01-01T00:00:00+00:00"
A log from the command with the -vv
flag
2022/02/28 18:00:47 DEBUG : rclone: Version "v1.53.1" starting with parameters
["rclone" "-vv" "--drive-token" "{\"access_token\":
\"some_token\", \"token_type\": \"Bearer\", \"refresh_token\":
\"some_refresh_token", \"expiry\": \"2022-02-
28T18:00:56.088516+00:00\"}" "--drive-team-drive" "some_hash" "copy"
"/tmp/tmpca6v76_4" ":drive:ExecOnline/5. Managed Services/b.
Production/GDriveConnector"]
2022/02/28 18:00:47 DEBUG : Creating backend with remote "/tmp/tmpca6v76_4"
2022/02/28 18:00:47 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found -
using defaults
2022/02/28 18:00:47 DEBUG : Creating backend with remote ":drive:ExecOnline/5.
Managed Services/b. Production/GDriveConnector"
2022/02/28 18:00:47 DEBUG : :drive: Failed to read token out of config file: config file
not found
2022/02/28 18:00:47 DEBUG : :drive: Token refresh failed try 1/5: oauth2: cannot
fetch token: 401 Unauthorized
Response: {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}