Unexpected storage quota error in Google Drive API for Android app

My Android app is having trouble uploading files to a specific Google Drive account. Users are getting an error saying their storage quota is exceeded. But when I check the account it shows plenty of free space.

Here’s what the error log shows:

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

I double-checked the storage quota using the API and got this:

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

This shows about 7GB free space. I also verified that the users’ personal Google Drive accounts have enough space.

Has anyone run into this issue before? Any ideas what might be causing it?

I’ve encountered a similar issue in the past. One potential cause could be that the user’s Drive is approaching, but not exceeding, their storage limit. Google sometimes preemptively blocks uploads when space is low to prevent overflow.

Another possibility is that the quota error is actually related to API usage limits rather than storage. Check your app’s API quota in the Google Cloud Console to ensure you haven’t exceeded daily or per-user limits.

If neither of these are the case, I’d recommend reaching out to Google Support. They can investigate backend issues that might be causing false quota errors. In my experience, their team has been helpful in resolving such discrepancies.

I ran into this exact problem a few months back. Turns out it was related to orphaned files in the user’s Drive that weren’t visible but still counted against the quota. Here’s what fixed it for us:

  1. Use the API to list all files, including trashed ones.
  2. Look for any with no parents (orphaned).
  3. Permanently delete those orphans.

After cleaning up those hidden files, the quota error disappeared. It’s worth a shot if the other suggestions don’t pan out.

Also, double-check you’re not hitting any per-user rate limits. We initially thought it was a storage issue, but it was actually because we were making too many API calls too quickly for some users. Implementing exponential backoff helped smooth things out.

hey there, i’ve seen this before. sometimes Google’s quota system gets wonky and reports incorrect usage. try clearing the app’s cache and data, then have users reauthorize. if that don’t work, wait a day or two - it might just resolve itself. google’s systems can be weird like that lol