Suddenly getting googleapi: Error 401: Invalid Credentials, authError

What's the purpose / goal of the service accounts in your setup and not just using your regular account?

In the beginning, it was to move data faster, I could switch between them and get it up and running sooner. I needed to do it as fast as possible in a downtime period.

Now it's just a way to keep it separated from my main account. It does not matter that much, but if my user is removed sometime in the future (changing jobs, etc.), etc. it's just easier that way.

Anyhow, I did try this with my main account (non service account), and I get the exact same error.

And in your OAUTH screen, I assume it's External not Internal?

If we can remove the service account, that's less complexity, can you share what you did to get the same error?

I just switched to my non sa remote – that was the one you spotted in the logs earlier.

[gdrive]
type = drive
client_id = <removed>.apps.googleusercontent.com
client_secret = <removed>
scope = drive
root_folder_id = <removed>
token = <removed>

[gdrive-crypt]
type = crypt
remote = gdrive:
filename_encryption = standard
directory_name_encryption = true
password = <removed>
password2 = <removed>

I don't think it matters due to the drive impersonation, and that they have the right to modify, but we can work with just the regular account for now. :slight_smile:

Regarding OAuth, its "External".

Mine is only Internal so I can't share outside my domain so I can't replicate your service account setup.

Did you comment out the service_account_file?

Can you share a debug log of the non service command?

Ah, ok.

service_account_file does not have any more data, so it does not use any file (it's literally as above service_account_file = <nothing>, but I removed it now for good measures.

Yes, I'm currently running through with the --disable copy flag, it's not done yet. I'll run it again with the normal user account when it's done.

Thanks for your help!

EDIT:
Just got the error again:

2021/11/02 14:57:00 ERROR : Encrypted drive 'gdrive-crypt-sa:/last_snapshot': error reading destination root directory: couldn't list directory: googleapi: Error 401: Invalid Credentials, authError
2021/11/02 14:57:00 ERROR : Encrypted drive 'gdrive-crypt-sa:/last_snapshot': not deleting files as there were IO errors
2021/11/02 14:57:00 ERROR : Encrypted drive 'gdrive-crypt-sa:/last_snapshot': not deleting directories as there were IO errors
2021/11/02 14:57:00 ERROR : Attempt 1/3 failed with 1 errors and: couldn't list directory: googleapi: Error 401: Invalid Credentials, authError

So I can run it again with my normal user. Running with debug log and dump headers.

Ok. This is weird. I started the sync process from my regular user, but after a couple of hours went by (the error usually came a lot sooner), I figured it suddenly seemed to work. So I canceled and tried again with the service account – and lo and behold:

Transferred:        3.557 GiB / 3.557 GiB, 100%, 1.919 KiB/s, ETA 0s
Checks:           2270777 / 2270777, 100%
Deleted:               92 (files), 35 (dirs)
Renamed:              107
Transferred:         1708 / 1708, 100%
Elapsed time:  34h32m21.9s

It's painstakingly slow, because of the dropbox tps-limit, but I'll go and tackle that now.

I have no idea why it suddenly worked. I have not done any changes. Must be an issue at Google?
I'm gonna run it again and see (with increased tps-limit)

hey op, you dont need to share a "my drive folder" thats a good way to get your drive locked if google does a dmca scan if there no crpyted.

All you do is delegate access with service accounts to your own domain in admin.google.com and then do --drive-impersonate email@domain and it will work without sharing the folder into your 'root' "mydrive" or any root folder for example GMC or GoogleMeidaCache folder. So its independent via a remote and wont try to put the files in its own 15gb 'mydrive'
I only use it due to headless linux server. ofc add them to a google group for a team drive though to make live easier.

I would advice not trying to circumvent googles 750gb limit though.

What you can do is copy that remote and do
[gdrive0]
no sa json file

[gdrive1]
with sa json file

same for the crypt.

[gdrive-crypt0]
remote = gdrive0:

[gdrive-crypt1]
remote = gdrive1:

that way you don't have to deal with configs over and over.

Not sure if I get what you're saying here. I'm also not sure if you read through the complete thread?

Anyhow, it's using a crypt, but it's not containing any copyrighted data. The Google limit was to move 4ish TB in the fastest time possible due to migrating from a local server to a virutal one.

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