Google workspace drive

What is the problem you are having with rclone?

I've configured a couple Google suite/workspace remotes - within google developer website, I've added a new application, enabled the drive API, etc . all according to the docs.

I generate a .json file and I can connect - however, from the linux command line, I only see files I specifically copy across, I do not see any of my existing drive files.
Also, from either the drive app on my android phone or the drive web app in my browser, I cannot see any of the files I copy across via rclone.

I've nuked out my config several times.
Using a "free" google account on another machine via oauth gives me full access to everything but being a gsuite account where I have paid for 100GB, it would be more advantageous to use my google suite account.

What is your rclone version (output from rclone version)

fedora 35 machine :
[glaw@optimus ~]$ rpm -qa |grep rclone
rclone-1.57.0-1.x86_64

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

google drive (google suite account)

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

[glaw@optimus ~]$  rclone -vv ls gdrive:
2021/12/10 09:17:53 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-vv" "ls" "gdrive:"]
2021/12/10 09:17:53 DEBUG : Creating backend with remote "gdrive:"
2021/12/10 09:17:53 DEBUG : Using config file from "/home/glaw/.config/rclone/rclone.conf"
2021/12/10 09:17:54 DEBUG : Google drive root '': 'root_folder_id = 0AJG4Ub8EgpQ3Uk9PVA' - save this in the config to speed up startup
        0 testme_2021-12-10.txt
        0 test_me_123
    11802 notes/.vimrc
     2618 notes/open_pmr.txt
2021/12/10 09:17:54 DEBUG : 6 go routines active
[glaw@optimus ~]$ 

The rclone config contents with secrets removed.

$ cat .config/rclone/rclone.conf 
[gdrive]
type = drive
client_id = gdrive
scope = drive
service_account_file = /Downloads/rclone-332619-26d6b167ac37.json

A log from the command with the -vv flag

[glaw@optimus ~]$ rclone -v -v  about gdrive:
2021/12/10 09:19:06 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-v" "-v" "about" "gdrive:"]
2021/12/10 09:19:06 DEBUG : Creating backend with remote "gdrive:"
2021/12/10 09:19:06 DEBUG : Using config file from "/home/glaw/.config/rclone/rclone.conf"
2021/12/10 09:19:06 DEBUG : Google drive root '': 'root_folder_id = 0AJG4Ub8EgpQ3Uk9PVA' - save this in the config to speed up startup
Total:   15 GiB
Used:    14.082 KiB
Free:    15.000 GiB
Trashed: 0 B
Other:   0 B
2021/12/10 09:19:06 DEBUG : 6 go routines active
[glaw@optimus ~]$  rclone -vv lsd gdrive:
2021/12/10 09:19:13 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-vv" "lsd" "gdrive:"]
2021/12/10 09:19:13 DEBUG : Creating backend with remote "gdrive:"
2021/12/10 09:19:13 DEBUG : Using config file from "/home/glaw/.config/rclone/rclone.conf"
2021/12/10 09:19:13 DEBUG : Google drive root '': 'root_folder_id = 0AJG4Ub8EgpQ3Uk9PVA' - save this in the config to speed up startup
          -1 2021-11-19 14:40:11        -1 notes
2021/12/10 09:19:13 DEBUG : 6 go routines active
[glaw@optimus ~]$  rclone -vv ls gdrive:
2021/12/10 09:19:17 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-vv" "ls" "gdrive:"]
2021/12/10 09:19:17 DEBUG : Creating backend with remote "gdrive:"
2021/12/10 09:19:17 DEBUG : Using config file from "/home/glaw/.config/rclone/rclone.conf"
2021/12/10 09:19:17 DEBUG : Google drive root '': 'root_folder_id = 0AJG4Ub8EgpQ3Uk9PVA' - save this in the config to speed up startup
        0 testme_2021-12-10.txt
        0 test_me_123
    11802 notes/.vimrc
     2618 notes/open_pmr.txt
2021/12/10 09:19:17 DEBUG : 6 go routines active

I have a "notes" directory created directly in the web gui -
https://drive.google.com/drive/u/0/folders/1FmXGK66wyhZ7vYSN0Vn1XPaorxDNvRqQ
and have tried using that folder ID in my config but no good.

So this is working to a certain level, its just a matter of the files only existing in rclone or google drive web GUI

I've also tried the impersonate option and folder id "" like I've seen elsewhere in the forum

[glaw@optimus ~]$ rclone -vv --drive-root-folder-id "" --drive-impersonate george@geolaw.com lsd gdrive:
2021/12/10 09:27:45 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-vv" "--drive-root-folder-id" "" "--drive-impersonate" "george@mydomain.com" "lsd" "gdrive:"]
2021/12/10 09:27:45 DEBUG : Creating backend with remote "gdrive:"
2021/12/10 09:27:45 DEBUG : Using config file from "/home/glaw/.config/rclone/rclone.conf"
2021/12/10 09:27:45 DEBUG : gdrive: detected overridden config - adding "{5sXh6}" suffix to name
2021/12/10 09:27:45 Failed to create file system for "gdrive:": couldn't find root directory ID: Get "https://www.googleapis.com/drive/v3/files/root?alt=json&fields=id&prettyPrint=false&supportsAllDrives=true": oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error": "unauthorized_client",
  "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."
}

hello and welcome to the forum,

did you do this?
"Tick "Enable G Suite Domain-wide Delegation". This option makes "impersonation" possible"
"in the gdrive web interface, share your root folder with the user/email of the new Service Account you created/selected at step #1"

Yes, used the clientid out of the json file to add a new domain-wide delegation for "rlcone" with the drive scope :
https://www.googleapis.com/auth/drive

Is that in your rclone.conf?

You should remove it as with a service account, it should look like:

[GD]
type = drive
scope = drive
service_account_file = /tmp/blah.json

You can put impersonate in there as well.

Is there a reason you want a service account and not just configure your user?

George Law george@geolaw.com 10:15 AM (3 minutes ago)

to Animosity022

bingo

commenting out :

#client_id = gdrive

And then adding the --drive-impersonate did it

$ rclone --drive-impersonate george@mydomain.com lsd gdrive:
-1 2014-07-19 23:22:50 -1 Apps
-1 2021-06-21 05:34:49 -1 CoinbaseWalletBackups
-1 2021-11-22 08:29:23 -1 Documents
-1 2012-05-04 08:42:07 -1 HelloFax
-1 2021-11-22 08:29:14 -1 Pictures

I think client_id was added automatically to my config - not 100% sure where that came from, but could have been one of the "optional fields" that I mistakenly set.

THANK YOU :slight_smile:

I'm using a service account because normal oath authentication with my google suite was giving me an error -- which may very well go right back to the same client_id :

Authorization Error
Error 401: invalid_client
The OAuth client was not found.

Thanks again

That sounds right.

If you want to make your own Client ID/Secret, you'd run through the process and you should be able to authorize the account.

client id and secret go together as you can't use one without the other.

Google drive (rclone.org)

You can authorize your account after that but you definitely want your own client ID/Secret if you use a user account.

A service account is fine as it uses its own client ID/secret.

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