Failed to copy: Error 403

Hey there,

I just started to use rclone today for a google drive share, and can't seem to get it properly configured.

I have my own google api OAuth token to grant the read/write/create access. I was able to mount my folder corrrectly, but I cannot add any local files to it.

$rclone mount mydrive: /path/to/drive/

This seems to launch a daemon, so in another terminal, I run:

$rclone copy /local/file mydrive:
2019/07/29 12:27:44 ERROR : file: Failed to copy: googleapi: Error 403: Forbidden, forbidden

Is this a bug? Or am I using the program incorrectly?

Please advise.

Did you happen to change the category after the post or did the bug template not pop up?

It looks like you need to run rclone config and authorize the remote.

I selected bug during the initial post, but I didn't see a template.

which config setting do I need to edit to authorize?

I selected my own client_id and client_secret, and authorized in my browser as suggested in the installation guides. I can see on my google account that full read/write/add/delete access is granted.

Interesting as I tested just now and I get the template to pop up.

You can run:
rclone config

and edit the remote and make sure to grab a key/authorize it.

I'm sorry for being dense here, but could you be more specific about how to "grab a key/authorize it".

I see a client_id for the OAuth token, and access_token in my config.
I tried to refresh the token, and authorized in my browser.

Already have a token - refresh?
y) Yes
n) No
y/n> y

Is this what you meant?

I still have the same problem.

Sorry as I should have been more verbose.

Yes, that's it. When you authorize that. You are seeing that all work?

Can you share:

rclone config file

rclone ls -vv mydrive:

Can you paste in your rclone.conf as shown in the rclone config file without any secrets or keys in it?

Yes, everything seems to work when I authorize. The CLI shows "got code" and my browser confirms the authorization.

rclone.conf:
[mydrive]
type = drive
client_id = <>
client_secret = <>
scope = drive
root_folder_id = <>
token = {"access_token":"<>","token_type":"Bearer","refresh_token":"<>","expiry":"2019-07-29T14:23:26.722440287-07:00"}

$ rclone ls -vv mydrive:
2019/07/29 14:25:38 DEBUG : rclone: Version "v1.48.0" starting with parameters ["rclone" "ls" "-vv" "minig:"]
2019/07/29 14:25:38 DEBUG : Using config file from "/.config/rclone/rclone.conf"

2019/07/29 14:25:39 DEBUG : 19 go routines active
2019/07/29 14:25:39 DEBUG : rclone: Version "v1.48.0" finishing with parameters ["rclone" "ls" "-vv" "mydrive:"]

So that looks like it works great.

Can you run the same command that wasn't working with -vv?

$:rclone copy -vv ./file mydrive:
2019/07/29 15:02:20 DEBUG : rclone: Version "v1.48.0" starting with parameters ["rclone" "copy" "-vv" "./file" "mydrive:"]
2019/07/29 15:02:20 DEBUG : Using config file from "/.config/rclone/rclone.conf"
2019/07/29 15:02:20 DEBUG : file: Couldn't find file - need to transfer
2019/07/29 15:02:21 ERROR : file: Failed to copy: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:21 ERROR : Attempt 1/3 failed with 2 errors and: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:21 DEBUG : file: Couldn't find file - need to transfer
2019/07/29 15:02:22 ERROR : file: Failed to copy: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:22 ERROR : Attempt 2/3 failed with 2 errors and: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:22 DEBUG : file: Couldn't find file - need to transfer
2019/07/29 15:02:23 ERROR : file: Failed to copy: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:23 ERROR : Attempt 3/3 failed with 2 errors and: googleapi: Error 403: Forbidden, forbidden
2019/07/29 15:02:23 Failed to copy with 2 errors: last error was: googleapi: Error 403: Forbidden, forbidden

Just so there is no confusion here between setting up a key and authorizing it - you have been through the step where you get the google login and the warning about "do you want to give (nameofyourOauth) access to your google drive?".

I normally do this part via the rclone built-in configurator since it just pops it up in your browser.

yes, I did that process in my browser. And I see on my google account that the 3rd party app does indeed have access.

So the first check was you have access to the drive.

What did you setup for access as it doesn't seem like you can write to it.

I gave full access for the API keys

access

Can you run the same command with:

rclone -vv --dump bodies

and share the output as that should point us in the right direction?

Thanks for helping out. here are the outputs

output from ls -vv: https://pastebin.com/zSuD6RJk
output from cp -vv: https://pastebin.com/KrZmzsaj

OOPS! I just realized that I didnt have write access to the actual google drive folder. sorry about that.

I'm not following. What didn't have access ?

I was trying to copy to a shared folder, which my google account only had read access too.

rclone had full read/write access, but my google account did not

Ah, thanks. I had assumed from your conf it was your drive so I can add that to a question to ask :slight_smile:

Thanks for sharing those additional details.

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