GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

documentai - "Error: 3 INVALID_ARGUMENT: due to apiEndpoint not defined in service client #131

Open lelesrc opened 6 months ago

lelesrc commented 6 months ago

Environment details

Steps to reproduce

When using a documentai node, the following error is returned: message: "Error: 3 INVALID_ARGUMENT: Request contains an invalid argument."

Workaround

Define apiEndpoint in file documentai.js:191

189             documentProcessorServiceClient = new DocumentProcessorServiceClient({
190                 "credentials": credentials,
191                 "apiEndpoint": "eu-documentai.googleapis.com"
192             });

Fix

apiEndpoint could be inferred from location (eu/us) or set by the user in node config.endPoint (more future-proof).