[Python] Why does Google Drive API return a 403 `storageQuotaExceeded` error for new Service...

Discussão em 'Python' iniciado por Stack, Julho 13, 2025.

  1. Stack

    Stack Membro Participativo

    I am encountering a critical, blocking issue with newly created Google Service Accounts that prevents any file creation via the Drive or Sheets APIs. This is happening under my personal Google account (@gmail.com), not a Workspace account.

    The Problem:

    Any attempt by a new Service Account to create a resource (e.g., an empty Google Sheet) fails with a 403 error: The user's Drive storage quota has been exceeded.

    This error is misleading. My user account has ample storage (>14 GB free), and the error occurs even for 0-byte operations. A forensic comparison between a working and a failing Service Account reveals the true cause:

    • Working (older) Service Account: A drive.about.get() call returns a storageQuota.limit of 15 GB. Creation succeeds.
    • Failing (new) Service Account: The same API call returns a storageQuota.limit of 0 bytes.

    The issue is not a bug in my code, but a server-side policy decision by Google to assign a zero-byte quota to my new Service Accounts.


    Context and Due Diligence Performed:

    I am an experienced developer and have successfully deployed this automation for multiple clients. I have a pool of older Service Accounts (6+) that continue to function perfectly under the same conditions. This issue is isolated to the last two new accounts I have created, suggesting a recent change in Google's platform policies.

    I have already exhausted all standard troubleshooting steps on a brand-new, clean GCP project:

    • Project Status: The OAuth Consent Screen is In Production.
    • API & Permissions: All necessary APIs (Drive, Sheets) are enabled. The Service Account has "Editor" permissions on the target Drive folder.
    • Billing Account: A working Service Account I own is in a project that does not have a billing account attached, so this does not appear to be the root cause.
    • Orphan Files: A script searching for files owned by the failing Service Account ('me' in owners) returned 0 results, confirming no hidden quota is being consumed.
    • Account Trust: My personal Google account is in good standing, with a verified phone number and years of activity history.
    • Critical Evidence: One of the now-failing accounts worked perfectly for two months before this 0-byte quota was suddenly enforced, ruling out a simple "new account" restriction.

    My Question:

    Given that all standard configuration issues have been ruled out, what undocumented policy or "trust" flag at the Google account or project level could be causing Google's backend to assign a 0-byte quota limit to new Service Accounts?

    How can a developer, operating outside of a Workspace environment, resolve this state and restore the standard functionality of Service Accounts?

    Continue reading...

Compartilhe esta Página