StorageQuotaExceeded: The user's Drive storage quota has been exceeded.) for service account

have a google drive API integration setup using a service account. The service account name ends in: iam.gserviceaccount.com.

Now it is correct that this account has quite some files created in our organisation - maybe 30Gb or so. However I would like to increase this quota, but I cannot figure out how?

I have tried searching in both developer console IAM (I can't find any quotas related to storage for the service account). And in admin.google.com for our organisation but no user-based quotas are enabled neither can I find the service account there.

Are there any way to increase drive storage quota for the service account so I don't have to delete files or create a new account

1 5 5,724
5 REPLIES 5

Hi @NKsdkf,

Welcome to Google Cloud Community!

Based on your error message, storageQuotaExceeded error occurs when the user has reached their storage limit.

Following this documentation regarding your error, you may perform the following:

As the service account is not an account that you can fully manage (in the sense of addding Drive Storage licences for example), the best would be to have those files transferred to a user in your organization or even better to create the files in a Google Shared Drive, so that the owner is the organization and not the service account.

I'm also in the same situation.
And I can't find what the quota is for the service account.
And in my Google Drive, uploads made by the service account appear as shared with me and don't consume space from my Google Drive.
And when I delete it from Google Drive it doesn't seem to release the quota for the service account.
I'm uploading via a shell script.
Does anybody know how to solve this?
My Google Drive is not for business.

Same. My last successful /upload/drive/v3/files was on May 2023.

I started getting:

 

 

{
  "error": {
    "code": 403,
    "message": "The user's Drive storage quota has been exceeded.",
    "errors": [
      {
        "message": "The user's Drive storage quota has been exceeded.",
        "domain": "usageLimits",
        "reason": "storageQuotaExceeded"
      }
    ]
  }
}

 

 

But the user I am uploading to says "9 GB of 15 GB used"

EDIT: I'm only uploading a 330 MB file.

EDIT2: Apparently the space is based on the service account, not the user. In order to use the space of the user, the service account needs to be configured to *impersonate* the user (see https://stackoverflow.com/questions/40535355/how-to-fix-the-storage-exceeded-issue-for-google-drive-...). I couldn't be bothered with this, so I just created a new service account, shared my gdrive folder, use the new key in my shell script, and got it to work again.

Hello everyone. I have a service account integration with the Drive API. I have heaps of files and folders that are created programatically using the API. Each time a file is uploaded to drive, I save the files id, public link (the web content link) and a download link. 

Some of those files are video files. I then embed the video file inside a <video></video> tag using the file's download link but reformatted to include my API key like so: 

https://www.googleapis.com/drive/v3/files/{file_id}alt=media&key={api_key}

This was working fine until today (may have been a few days earlier but today's when I noticed it). 

This now throws the following error: 

{
  "error": {
    "code": 403,
    "message": "The download quota for this file has been exceeded.",
    "errors": [
      {
        "message": "The download quota for this file has been exceeded.",
        "domain": "usageLimits",
        "reason": "downloadQuotaExceeded"
      }
    ]
  }
}

However, I a confirm that this error is completely erroneous. Here's why: 
The file in question was uploaded moments ago. No one downloaded it. The total space consumed by the service account is currently 2.41Gb of the 2Tb shared space for the service account user. 

Is this a new thing with Google? Can anyone help overcome this issue?