Skip to content

Uploading to Gdrive Error : RetryError[Future at 0x7fa2f3688f30 state=finished raised HttpError]. #464

@notavailableusername122

Description

Describe the bug
RetryError[Future at 0x7fa2f3688f30 state=finished raised HttpError]
What is happening in your code (precise execution flow)

Reproduce:
— Take a zip file of a multiple folder with multiple files inside each folder. Upload with /m link -e , extract it. You get this error when it tries to upload.

Possible bug location : gdrive_utils/upload.py

Possible fix : The exact incorrect assumption in your logic
This condition is wrong:
if not Config.IS_TEAM_DRIVE:
self.set_permission(response["id"])
Because:
IS_TEAM_DRIVE == False does NOT mean
“I can modify permissions”
Files in My Drive folders you don’t own also inherit permissions
Shared folders inside My Drive still block permission edits

✅ Solution 1 — Skip permission setting entirely (safest)
Remove BOTH occurrences of:
if not Config.IS_TEAM_DRIVE:
self.set_permission(response["id"])
This is how most mature Drive uploaders work.

AI Generated solution.

File upload succeeds
Google Drive assigns the file to:
a folder you do not own, or
a Shared Drive / inherited-permission folder
Immediately after upload, your code calls:
self.set_permission(file_id)
set_permission() internally does a permission create/update
Google Drive rejects it with:
403 cannotModifyInheritedPermission

Because _upload_file() is decorated with tenacity.retry:
The same failing permission call is retried

Retries do not help
Eventually wrapped into RetryError

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions