Not able to sync with google drive due to 403 and 404 errors

What is the problem you are having with rclone?

rclone sync app gdrive:
2020/11/15 22:22:29 ERROR : server/composer.json: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/15 22:22:30 ERROR : server/install.sh: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/15 22:22:30 ERROR : server/composer.lock: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound

What is your rclone version (output from rclone version)

rclone v1.53.2-DEV

  • os/arch: darwin/amd64
  • go version: go1.15.3

Which OS you are using and how many bits (eg Windows 7, 64 bit)

MacOS x64

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 copy ~/app gdrive: -vv

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = xxxxx.apps.googleusercontent.com
client_secret = xxxxxxxx
scope = drive
root_folder_id = 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP
service_account_file = /Users/user/projects/project/server/config/gdrive-creds.json

A log from the command with the -vv flag

2020/11/16 00:27:09 DEBUG : rclone: Version "v1.53.2-DEV" starting with parameters ["rclone" "copy" "/Users/user/app" "gdrive:" "-vv"]
2020/11/16 00:27:09 DEBUG : Creating backend with remote "/Users/user/app"
2020/11/16 00:27:09 DEBUG : Using config file from "/Users/user/.config/rclone/rclone.conf"
2020/11/16 00:27:09 DEBUG : Creating backend with remote "gdrive:"
2020/11/16 00:27:09 DEBUG : Google drive root '': Waiting for checks to finish
2020/11/16 00:27:09 DEBUG : Google drive root '': Waiting for transfers to finish
2020/11/16 00:27:10 ERROR : server/composer.json: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/16 00:27:11 ERROR : server/install.sh: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/16 00:27:12 ERROR : server/composer.lock: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/16 00:27:12 ERROR : server/terminal.php: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound
2020/11/16 00:27:12 ERROR : server/vendor/autoload.php: Failed to copy: failed to make directory: googleapi: Error 404: File not found: 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP., notFound

dircetory 1-2NZnVzSrH4TbjRk08Tb68nqLL1r8YmP exists on the Google Drive and I'm owner of it.
I have created service account from the same account that owns this Google Drive. It's not Team drive. Files exists and readable. The same behavior on the same config on the Debian remote server.

If you are using a service account, you need to impersonate.

I have added
impersonate=owner.of.the.service.account@gmail.com
now I'm getting
oauth2: cannot fetch token: 401 Unauthorized

Also I have the credentials file with the next structure

{
"type": "service_account",
"project_id": ".....",
"private_key_id": "........",
"private_key": ".......",
"client_email": ".....",
"client_id": "........",
"auth_uri": "https ://accounts.google.com/o/oauth2/auth",
"token_uri": "https ://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https ://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https ://www.googleapis.com/robot/v1/metadata/x509/......."
}

You need to give the service account impersonate permissions as well in your GSuite setup.

I don't use GSuite. Only free Google Drive and the service account with credentials created in the developer console

I'm unaware of how you'd setup a service account without GSuite as you can't do this:

https://rclone.org/drive/#service-account-support I used this part. As I understand unattended mode don't needs this

Right, you can't do #2 (which I linked) in the process flow there as you don't have GSuite.

but why it worked without this and then stopped after days?

It would not have ever worked as you don't have a GSuite account to set it up. It was most likely not using a service account if it was working prior.

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