I'm using Google's AutoML Natural Language API for Node.js. Everything works great, except for a particular service account and user (a student of mine). She gets the following error:
> Auth error:Error: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode
> { Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode
> at Object.exports.createStatusError (/home/ubuntu/workspace/functions/node_modules/grpc/src/common.js:87:15)
> at Object.onReceiveStatus (/home/ubuntu/workspace/functions/node_modules/grpc/src/client_interceptors.js:1188:28)
> at InterceptingListener._callNext (/home/ubuntu/workspace/functions/node_modules/grpc/src/client_interceptors.js:564:42)
> at InterceptingListener.onReceiveStatus (/home/ubuntu/workspace/functions/node_modules/grpc/src/client_interceptors.js:614:8)
> at callback (/home/ubuntu/workspace/functions/node_modules/grpc/src/client_interceptors.js:841:24)
> code: 14,
> metadata: Metadata { _internal_repr: {} },
> details: 'Getting metadata from plugin failed with error: error:0906D064:PEM routines:PEM_read_bio:bad base64 decode' }
The code that produces this error is:
const automl = require('@google-cloud/automl')
const client = new automl.v1beta1.PredictionServiceClient({keyFilename: 'key_file.json'})
const formattedName = client.modelPath('<project-id>', 'us-central1', '<model-id>')
const payload = {
textSnippet: {
content: 'Recognize this text',
mimeType: 'text/plain'
}
}
const request = {
name: formattedName,
payload,
}
client.predict(request)
.then(responses => console.log(responses[0].payload[0]))
.catch(console.error(err))
If I change *project-id*, *model-id*, and *key-file.json* to my own, then this works perfect. I've verified she's entering the correct project-id, model-id, and key-file.json (at least those are from the exact same places I found mine). Any ideas what's causing this?