Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Consent is required to transfer ownership of a file to another user. #44

Open
Butanium opened this issue Dec 29, 2022 · 8 comments

Comments

@Butanium
Copy link

PS C:\Users\Clement\Documents\Mes-Documents\coding\google-drive-recursive-ownership\google-drive-recursive-ownership> python .\transfer.py "test transfer" *@gmail.com
Changing all files at path "test transfer" to owner "*@gmail.com"
Prefix: ['test transfer']
Use this link for authorization: https://accounts.google.com/o/oauth2/auth?client_id=****
Verification code: ****
User *@gmail.com is permission ID *.
Gathering file listings for prefix []...
Folder: test transfer ([], *)
Gathering file listings for prefix ['test transfer']...
File: empty (['test transfer'], *)
Item b'test transfer\\empty' needs ownership granted.
   Creating new ownership permissions.
An error occurred inserting ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/1WAMRlwFeqj5urN2Bl6UhiLgdDzCYfJo98VIKtW5UbRY/permissions?emailMessage=Automated+recursive+transfer+of+ownership.&alt=json returned "Consent is required to transfer ownership of a file to another user.". Details: "[{'message': 'Consent is required to transfer ownership of a file to another user.', 'domain': 'global', 'reason': 'consentRequiredForOwnershipTransfer'}]">
Item b'test transfer' needs ownership granted.
   Creating new ownership permissions.
An error occurred inserting ownership permissions: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files/1LdEQ0-SFR59U15V5Rt9RNCtdEIdYqUIi/permissions?emailMessage=Automated+recursive+transfer+of+ownership.&alt=json returned "Consent is required to transfer ownership of a file to another user.". Details: "[{'message': 'Consent is required to transfer ownership of a file to another user.', 'domain': 'global', 'reason': 'consentRequiredForOwnershipTransfer'}]">

Granting edit rights to *@gmail.com doesn't fix the issue.

I'm trying give ownership acess from another @gmail.com account

@Butanium
Copy link
Author

Seems like the API won't work for @gmail.com account now : https://issuetracker.google.com/issues/228826345?pli=1

@Butanium
Copy link
Author

Apparently the process changed and is described in this article https://developers.google.com/drive/api/guides/manage-sharing#transfer-consumer-account

@kallewesterling
Copy link

Any updates on this? I am in need of transferring every single file on one of my Google Drive accounts to another, and it's a pain. As it stands, the google-drive-recursive-ownership adds my other user as an Editor but the ownership transfer doesn't work, still, like @Butanium points out above due to the API changes...

@Butanium
Copy link
Author

Any updates on this? I am in need of transferring every single file on one of my Google Drive accounts to another, and it's a pain. As it stands, the google-drive-recursive-ownership adds my other user as an Editor but the ownership transfer doesn't work, still, like @Butanium points out above due to the API changes...

FWIW: I think I ended up CTRL+A in the search tab and then transfer the selection

@kallewesterling
Copy link

That won't work for me as I'm trying to work with thousands of files.

@llang629
Copy link

llang629 commented Sep 4, 2023

This would have been such a useful tool before Google changed the API to require permissions for each change of ownership between consumer accounts.

I considered updating the API calls to follow the new process described here:
https://developers.google.com/drive/api/guides/manage-sharing#transfer-consumer-account
However, this program would only accomplish step 1.

Another program could be written to accomplish step 2, but it would have to execute with the receiving user's identity.

Otherwise the receiver would just receive a barrage of emails, one per file or folder, asking if they want to become the new owner. If you have enough files to warrant automating this process, wading through all those emails to accept seems to defeat the purpose.

Astonishing shortcoming of Google Drive that it doesn't support recursive change of ownership, since it does support recursive change of sharing.

@kallewesterling
Copy link

Agree, @llang629. It means that we're all locked into the accounts that we set up a long time ago :(

@svaponi
Copy link

svaponi commented Jan 7, 2024

Once completed step 1 (I have a local patch to do that if anybody is interested), then you can fairly easily perform step 2 manually on Google Drive:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants