I am currently using the Document AI API to label bank statements. I trained a custom processor and have been successfully sending PDF files to the API. However, over the past few days, I have been receiving the following error message: StatusCode=“ResourceExhausted”, Detail=“Resource has been exhausted (e.g. check quota).”
I reviewed the quotas in the Cloud Console, and the current usage is well below the configured limits.
What could be causing this issue if the quotas are not near their limits?
If you’re using the Google Cloud Document AI API and getting a “ResourceExhausted” error with the detail “Resource has been exhausted (e.g. check quota),” there might be a few reasons for this, even if you’ve already checked that your quotas are below their limits.
If you’re encountering an error, consider investigating these potential causes:
Rate Limiting - Check if you’re hitting any rate limits. Even if your overall quota isn’t reached, you might be exceeding the rate limit for a specific operation. You are making too many requests that could cause you to hit rate limits.
Document Size and Complexity - Try processing smaller or less complex PDFs. Larger or more complex PDFs may require more resources than are currently available.
Retries and Exponential Backoff - Given that Google Cloud APIs are subject to resource limits, implementing retries with exponential backoff may help handle transient errors when you’re close to hitting limits.
If the issue persists, I suggest contacting Google Cloud Support as they can provide more insights to see if the behavior you’ve encountered is a known issue or specific to your project.