Unexpected storage quota error in Google Drive API v3

My Android app users are facing issues uploading files to a specific Google Drive account. The error log shows:

"domain": "usageLimits",
"message": "The user's Drive storage quota has been exceeded.",
"reason": "storageQuotaExceeded".

But when I check the account’s storage, there’s about 7GB free. The API call to check storageQuota confirms this:

{
  "storageQuota": {
    "limit": "16106127360",
    "usage": "7298236418",
    "usageInDrive": "7298236418",
    "usageInDriveTrash": "0"
  }
}

I’ve also checked the users’ personal Google Drive accounts, and they have plenty of space too. Has anyone run into this strange mismatch between the actual storage available and the API’s error message? Any ideas on how to fix it?

hey alexr1990, have you checked if theres any folder-specific quotas? Sometimes google drive can have weird limits on certain folders. Also, maybe try clearing the api cache or waiting a bit? The quota info might just be out of sync. If nothing works, hit up google support - they migt know about some recent api hiccups.

Have you considered the possibility of a temporary API glitch or caching issue? Sometimes, the Google Drive API can lag in updating quota information, leading to false error messages. I’d suggest implementing a retry mechanism with exponential backoff in your app to handle transient errors. This approach has worked well for me in similar situations.

Another avenue to explore is checking if there are any file size limits or restrictions on the specific folder where uploads are failing. Occasionally, folder-level quotas or policies can cause unexpected behavior.

If the problem persists, it might be worth reaching out to Google’s support channels or checking their issue tracker. They might have insights into any known issues or recent changes that could be affecting your app’s functionality.

I’ve encountered a similar issue with the Google Drive API before, and in my case it turned out to be less about available storage and more about file ownership and permissions. The service account used for uploads did not have the appropriate access to the target folder. I recommend verifying that the account in use is properly permitted to interact with the destination folder. It might also help to try uploading to a newly created folder or a different location to see if the problem persists. Additionally, it is worthwhile to check that API quotas are not being exceeded, as these can sometimes trigger misleading error messages. If the problem remains unresolved, experimenting with an alternate service account or user credentials could isolate the issue further, and consulting Google Support or related issue trackers might shed light on any known synchronization or caching problems.