Rclone auth error on google drive

What is the problem you are having with rclone?

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

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

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

Paste command here

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

hello and welcome to the forum,

help us to help you and please answer the questions in the help and support template.

What is the problem you are having with rclone?

When I try to mount a google drive account I have this error

rclone mount daniela_cd49: /home/debian/cuentas/daniela_cd49
2022/09/28 21:38:00 Failed to create file system for "daniela_cd49:": couldn't find root directory ID: googleapi: Error 401: Invalid Credentials, authError

it was working for 6 months and suddenly is no working anymore

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

rclone v1.57.0

  • os/version: debian 11.5 (64 bit)
  • os/kernel: 5.10.0-14-cloud-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

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 mount daniela_cd49: /home/debian/cuentas/daniela_cd49

The rclone config contents with secrets removed.

type = drive
client_id = 1064987322755-xxx6b.apps.googleusercontent.com
client_secret = GOCSPX-xxxxxpURu7YDIxJ_IyGWHKa
scope = drive.readonly
token = {"access_token":"ya29.a0Aa4xrXNO8QXVue5oNe8zO5DJ8QDI9ILtmK8iZbAqMESzbOXOJ7AIx1yp21PliB9MJbePbyearD5iLF1vnqB0yxxxxu8hxiNXNFAAYxAjgCRTXO-BW8RwUOZiV2A_kBQR1KnW9fO3Hls95IlAaAsaCgYKATASAR>
team_drive =


A log from the command with the -vv flag

ok, can you update rclone to latest stable v1.59.2
and then run this command and post the full output

rclone lsd daniela_cd49: -vv

debian@vps-f126e3b6:~$ sudo rclone selfupdate --stable
2022/09/28 21:48:25 NOTICE: Successfully updated rclone from version v1.57.0 to version v1.59.2
debian@vps-f126e3b6:~$ rclone lsd daniela_cd49: -vv
2022/09/28 21:49:38 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "lsd" "daniela_cd49:" "-vv"]
2022/09/28 21:49:38 DEBUG : Creating backend with remote "daniela_cd49:"
2022/09/28 21:49:38 DEBUG : Using config file from "/home/debian/.config/rclone/rclone.conf"
2022/09/28 21:49:38 Failed to create file system for "daniela_cd49:": couldn't find root directory ID: googleapi: Error 401: Invalid Credentials, authError

ok, recently google made some significant changes to oauth, which has been discussed a number of times in the forum.

can you try
rclone config reconnect daniela_cd49: -vv

debian@vps-f126e3b6:~$ rclone config reconnect daniela_cd49: -vv
2022/09/28 22:03:54 DEBUG : rclone: Version "v1.59.2" starting with parameters ["rclone" "config" "reconnect" "daniela_cd49:" "-vv"]
2022/09/28 22:03:54 DEBUG : Using config file from "/home/debian/.config/rclone/rclone.conf"
2022/09/28 22:03:54 DEBUG : daniela_cd49: config in: state="", result=""
2022/09/28 22:03:54 DEBUG : daniela_cd49: config out: out=&{State:*oauth,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/09/28 22:03:54 DEBUG : daniela_cd49: config in: state="*oauth,teamdrive,,", result=""
2022/09/28 22:03:54 DEBUG : daniela_cd49: config out: out=&{State:*oauth-confirm,teamdrive,, Option:true OAuth: Error: Result:}, err=
2022/09/28 22:03:54 DEBUG : daniela_cd49: config: reading config parameter "config_refresh_token"
Already have a token - refresh?
y) Yes (default)
n) No
y/n> Y

2022/09/28 22:03:57 DEBUG : daniela_cd49: config in: state="*oauth-confirm,teamdrive,,", result="true"
2022/09/28 22:03:57 DEBUG : daniela_cd49: config out: out=&{State:*oauth-islocal,teamdrive,, Option:true OAuth: Error: Result:}, err=
2022/09/28 22:03:57 DEBUG : daniela_cd49: config: reading config parameter "config_is_local"
Use auto config?

  • Say Y if not sure
  • Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n> n

2022/09/28 22:03:59 DEBUG : daniela_cd49: config in: state="*oauth-islocal,teamdrive,,", result="false"
2022/09/28 22:03:59 DEBUG : daniela_cd49: config out: out=&{State:*oauth-remote,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/09/28 22:03:59 DEBUG : daniela_cd49: config in: state="*oauth-remote,teamdrive,,", result=""
2022/09/28 22:03:59 DEBUG : sending client_id = "1064987322755-bedso0cjvs0qjssrg6ohuk9otuv5f36b.apps.googleusercontent.com"
2022/09/28 22:03:59 DEBUG : sending client_secret = "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"
2022/09/28 22:03:59 DEBUG : sending scope = "drive.readonly"
2022/09/28 22:03:59 DEBUG : daniela_cd49: config out: out=&{State:*oauth-authorize,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/09/28 22:03:59 DEBUG : daniela_cd49: config: reading config parameter "config_token"
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: Remote Setup
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "drive" "eyJjbGllbnRfaWQiOiIxMDY0OTg3MzIyNzU1LWJlZHNvMGNqdnMwcWpzc3JnNm9odWs5b3R1djVmMzZiLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiY2xpZW50X3NlY3JldCI6IkdPQ1NQWC1yd05LQTlUV0ZQcFVSdTdZREl4Sl9JeUdXSEthIiwic2NvcGUiOiJkcml2ZS5yZWFkb25seSJ9"
Then paste the result.
Enter a value.
config_token> eyJ0b2tlbiI6IntcImFjY2Vzc190b2tlblwiOlwieWEyOS5hMEFhNHhyWE9GeHpPUUJ5Z0xvek5HRGczX2VLNEVzWWFXQkNfWHBqYndQV2RzdGlab0huc0hJOG1sa201V1BWVm1KZlo3ZDhVaHp3RTFPLWtQODVBSWZiQW5aTGpnTWpwVl91b1o3dVBzWFNqYVo3Y0lYNU1YY0Rta0hRYndwWDNka2c0dXB4dnE3SjJSdUI2SlJnWm0zeU5ENUZjMGFDZ1lLQVRBU0FSRVNGUUVqRHZMOXhxRVpoVmhhTjZxTmpSbmJ2SHhJS3cwMTYzXCIsXCJ0b2tlbl90eXBlXCI6XCJCZWFyZXJcIixcInJlZnJlc2hfdG9rZW5cIjpcIjEvLzBmQnJuOXFWU1JxVjBDZ1lJQVJBQUdBOFNOd0YtTDlJcmZmc19mOVMyUVBiUEJ0VkNRUmV5amJVM3I3czRFUHlnYkN3RDdGbGtpd1hOMWVYS0lVeEpuZThyWi1RbWJYZS1ueEFcIixcImV4cGlyeVwiOlwiMjAyMi0wOS0yOFQxODowNDozMC4wOTUxOTMxNDEtMDU6MDBcIn0ifQ

2022/09/28 22:05:12 DEBUG : daniela_cd49: config in: state="*oauth-authorize,teamdrive,,", result="eyJ0b2tlbiI6IntcImFjY2Vzc190b2tlblwiOlwieWEyOS5hMEFhNHhyWE9GeHpPUUJ5Z0xvek5HRGczX2VLNEVzWWFXQkNfWHBqYndQV2RzdGlab0huc0hJOG1sa201V1BWVm1KZlo3ZDhVaHp3RTFPLWtQODVBSWZiQW5aTGpnTWpwVl91b1o3dVBzWFNqYVo3Y0lYNU1YY0Rta0hRYndwWDNka2c0dXB4dnE3SjJSdUI2SlJnWm0zeU5ENUZjMGFDZ1lLQVRBU0FSRVNGUUVqRHZMOXhxRVpoVmhhTjZxTmpSbmJ2SHhJS3cwMTYzXCIsXCJ0b2tlbl90eXBlXCI6XCJCZWFyZXJcIixcInJlZnJlc2hfdG9rZW5cIjpcIjEvLzBmQnJuOXFWU1JxVjBDZ1lJQVJBQUdBOFNOd0YtTDlJcmZmc19mOVMyUVBiUEJ0VkNRUmV5amJVM3I3czRFUHlnYkN3RDdGbGtpd1hOMWVYS0lVeEpuZThyWi1RbWJYZS1ueEFcIixcImV4cGlyeVwiOlwiMjAyMi0wOS0yOFQxODowNDozMC4wOTUxOTMxNDEtMDU6MDBcIn0ifQ"
2022/09/28 22:05:12 DEBUG : Saving config "token" in section "daniela_cd49" of the config file
2022/09/28 22:05:12 DEBUG : received token = "{"access_token":"ya29.a0Aa4xrXOFxzOQBygLozNGDg3_eK4EsYaWBC_XpjbwPWdstiZoHnsHI8mlkm5WPVVmJfZ7d8UhzwE1O-kP85AIfbAnZLjgMjpV_uoZ7uPsXSjaZ7cIX5MXcDmkHQbwpX3dkg4upxvq7J2RuB6JRgZm3yND5Fc0aCgYKATASARESFQEjDvL9xqEZhVhaN6qNjRnbvHxIKw0163","token_type":"Bearer","refresh_token":"1//0fBrn9qVSRqV0CgYIARAAGA8SNwF-L9Irffs_f9S2QPbPBtVCQReyjbU3r7s4EPygbCwD7FlkiwXN1eXKIUxJne8rZ-QmbXe-nxA","expiry":"2022-09-28T18:04:30.095193141-05:00"}"
2022/09/28 22:05:12 DEBUG : daniela_cd49: config out: out=&{State:*oauth-done,teamdrive,, Option: OAuth: Error: Result:}, err=
2022/09/28 22:05:12 DEBUG : daniela_cd49: config in: state="*oauth-done,teamdrive,,", result=""
2022/09/28 22:05:12 DEBUG : daniela_cd49: config out: out=&{State:teamdrive Option: OAuth: Error: Result:}, err=
2022/09/28 22:05:12 DEBUG : daniela_cd49: config in: state="teamdrive", result=""
2022/09/28 22:05:12 DEBUG : daniela_cd49: config out: out=&{State:teamdrive_ok Option:false OAuth: Error: Result:}, err=
2022/09/28 22:05:12 DEBUG : daniela_cd49: config: reading config parameter "config_change_team_drive"
Configure this as a Shared Drive (Team Drive)?

y) Yes
n) No (default)
y/n> n

2022/09/28 22:05:23 DEBUG : daniela_cd49: config in: state="teamdrive_ok", result="false"
2022/09/28 22:05:23 DEBUG : Saving config "team_drive" in section "daniela_cd49" of the config file
2022/09/28 22:05:23 DEBUG : daniela_cd49: config out: out=, err=
2022/09/28 22:05:23 DEBUG : rclone: Version "v1.59.2" finishing with parameters ["rclone" "config" "reconnect" "daniela_cd49:" "-vv"]

With the changes that google made to oauth, what is the guide to configure a google account and mount it on my system from scratch.

so did that fix your problem or what?

No the problem is still on my side. But I was asking if there is a guide from zero to configure a google account whith new changes over oauth that made google.

yes, just follow the rclone documentation

What can I do to Make work the reconnect with this account

works for me

rclone config

Current remotes:

Name                 Type
====                 ====

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n

Enter name for new remote.
name> gdrivetest01

Option Storage.
Storage> drive

Option client_id.
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a value. Press Enter to leave empty.
client_id> redacted

Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret> redacted

Option scope.
Scope that rclone should use when requesting access from drive.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
 1 / Full access all files, excluding Application Data Folder.
   \ (drive)
 2 / Read-only access to file metadata and file contents.
   \ (drive.readonly)
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ (drive.file)
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ (drive.appfolder)
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ (drive.metadata.readonly)
scope>

Option service_account_file.
Service Account Credentials JSON file path.
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a value. Press Enter to leave empty.
service_account_file>

Edit advanced config?
y) Yes
n) No (default)
y/n>

Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n>

2022/09/28 18:44:37 NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
2022/09/28 18:44:37 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=0FK4ileuaRuJfoCoAG6FfA
2022/09/28 18:44:37 NOTICE: Log in and authorize rclone for access
2022/09/28 18:44:37 NOTICE: Waiting for code...
2022/09/28 18:45:09 NOTICE: Got code
Configure this as a Shared Drive (Team Drive)?

y) Yes
n) No (default)
y/n>

Configuration complete.
Options:
- type: drive
- client_id: redacted
- client_secret: redacted
- token: {"access_token":"redacted","expiry":"2022-09-28T19:45:08.7301499-04:00"}
- team_drive:
Keep this "gdrivetest01" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

rclone lsd gdrivetest01:
          -1 2022-01-12 13:38:48        -1 zork

Following the instructions the way it worked for you.
It keeps giving me the same error

2022/09/28 20:15:41 Failed to create file system for "test:": couldn't find root directory ID: googleapi: Error 401: Invalid Credentials, authError

perhaps you are not typing in the correct information, maybe a typo or copy/paste issue?

i would create a new client id/secret and create a new remote

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