I need help regarding a document AI processor location/region issue we are facing. Currently it return an error if we use a processor with EU location but works fine with US location. Although, in GCP it says processor are available for both EU and US regions.
I am using Laravel and `google/cloud-document-ai` package to use it.
Here is the error return by Document AI API call while setting up request to process Pdf document:
{
"message": "Request contains an invalid argument.",
"code": 3,
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com\/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "name",
"description": "Invalid location: 'eu' must match the server deployment 'us'"
}
]
}
]
}
Here are my processor details:
Solved! Go to Solution.
Hi surinderfnl,
Welcome to Google Cloud Community!
When utilizing the Google Document AI API, an INVALID_ARGUMENT error indicates a specific configuration mismatch, not an issue with authentication or permissions. This error occurs when the regional location specified in the processor's resource name does not match the regional API endpoint the client is configured to call.
Document AI is a regionalized service, meaning processors and their corresponding API endpoints are isolated by geographic location (e.g., us or eu). The API client library must be explicitly instructed to target the correct regional endpoint. The INVALID_ARGUMENT error arises from one of two inconsistencies:
The fundamental principle is that the server you are calling must be the one that actually hosts the resource you are requesting.
Note that you must ensure perfect alignment between the client's API endpoint configuration and the location defined in the processor's resource name. Both must reference the EU region.
As a workaround, you may verify the following points in your codebase:
By aligning these configuration values, you instruct the client library to send the request to the correct regional service that hosts your processor.
Also, feel free to refer to this case that you may find useful.
Was this helpful? If so, please accept this answer as โSolutionโ. If you need additional assistance, reply here within 2 business days and Iโll be happy to help.
Hi surinderfnl,
Welcome to Google Cloud Community!
When utilizing the Google Document AI API, an INVALID_ARGUMENT error indicates a specific configuration mismatch, not an issue with authentication or permissions. This error occurs when the regional location specified in the processor's resource name does not match the regional API endpoint the client is configured to call.
Document AI is a regionalized service, meaning processors and their corresponding API endpoints are isolated by geographic location (e.g., us or eu). The API client library must be explicitly instructed to target the correct regional endpoint. The INVALID_ARGUMENT error arises from one of two inconsistencies:
The fundamental principle is that the server you are calling must be the one that actually hosts the resource you are requesting.
Note that you must ensure perfect alignment between the client's API endpoint configuration and the location defined in the processor's resource name. Both must reference the EU region.
As a workaround, you may verify the following points in your codebase:
By aligning these configuration values, you instruct the client library to send the request to the correct regional service that hosts your processor.
Also, feel free to refer to this case that you may find useful.
Was this helpful? If so, please accept this answer as โSolutionโ. If you need additional assistance, reply here within 2 business days and Iโll be happy to help.