Search code examples
google-drive-api

(403) The user has exceeded their Drive storage quota ph


We have Google Drive account and using Google Console we created Service Admin Account which has access to folders in our Drive. Our Drive storage went out of space so application which was sending new files to Google Drive started to fail with error in the title.

We have added 100GB new storage(on Drive via Google One) but application still fails and responds with this error message.

As far as I investigated Service Accounts only have limited space so this account still has no space left even though my real account has 100GB more.

I tried to transfer ownership of folder in Drive to Service Account but I couldnt because I need to accept that and I cannot log into Service Account.

This project is old and uses google-api-php-client to connect to Drive and do other stuff.

Any help is appreciated!

EDIT: Hitting https://www.googleapis.com/drive/v2/about endpoint with same credentials as Service Account used to send files to Drive gives me this information about quota.

  "quotaBytesTotal": "107374182400",
  "quotaBytesUsed": "84631990",
  "quotaBytesUsedInTrash": "1573901",

Which is not logical to me because there is actually free space to be used.


Solution

  • I have a potential idea on the issue and clarification about the scenario. Based on the fact that you do not have a Google Workspace account to work with the Service account, you could be affected by the recent workflow changes on how the transfer of ownership of files between Google Accounts.

    Important notes:

    1. Service accounts are basically Google Accounts with their own default Drive Storage, 15 GB as any free Gmail account.
    2. You cannot increase the storage for the Service accounts.

    If you are sending the files to a Personal account, and the new workflow could be blocking it or delaying the process. Which could explain the error of space, it is not the personal account with the extra 100 gb, it is the Service account, because the file never changes the ownership.

    There is an Feature request that you can send also the feedback, and a similar scenario as yours has been shared by other people.

    The Google Drive API, has updated some of the process but they mostly applied to Google Workspace account, you can review it here.