googleapis / google-cloud-node

Google Cloud Client Library for Node.js
https://cloud.google.com/nodejs
Apache License 2.0
2.92k stars 591 forks source link

Vision: Error: Getting metadata from plugin failed with error: no start line #2658

Closed vichen closed 7 years ago

vichen commented 7 years ago

Found a similar issue, but it didn't really have a solution: #2609

Environment details

Node.js version: 8.1.4 npm version: 5.3.0 @google-cloud/vision version: 0.12.0

Steps to Reproduce Run the following

const config = require('src/lib/config.js');
const vision = require('@google-cloud/vision')({
  projectId: config.googlevision_project_id,
  credentials: {
    client_email: config.googlevision_client_email,
    private_key: config.googlevision_private_key,
  },
});

const image = {
  source: {
    imageUri: 'http://i0.kym-cdn.com/entries/icons/mobile/000/017/414/sampletext.jpg',
  },
};

vision.textDetection(image)
.then((result) => {
  console.log('result: ', result);
})
.catch((e) => {
  console.log('error: ', e);
});

Output

{ Error: Getting metadata from plugin failed with error: error:0906D06C:PEM 
  routines:PEM_read_bio:no start line
  at /node_modules/grpc/src/node/src/client.js:554:15
  code: 16,
  metadata: Metadata { _internal_repr: {} },
  note: 'Exception occurred in retry method that was not classified as transient' }
stephenplusplus commented 7 years ago

Hello! Would you please check the value of private_key is properly formatted? I can reproduce the no start line error if the key does not follow this pattern:

-----BEGIN PRIVATE KEY-----\n{REDACTED}\n-----END PRIVATE KEY-----\n
vichen commented 7 years ago

That was the issue. Thank you!

Apollo725 commented 5 years ago

Hi, @stephenplusplus I followed that pattern of private_key but I can still see that error. Could you help me?

parthasarathysarathy commented 5 years ago

Hi, @stephenplusplus I'm also followed that pattern of private_key after that seen your comment. but I can still see that error. Could you help me?

JustinBeckwith commented 5 years ago

Greetings @parthasarathysarathy! Could you please open a new issue with details on what you're running into? Generally commenting on closed issues makes it a little harder for us to keep track of things :)

jayarjo commented 4 years ago

@Apollo725 @parthasarathysarathy were you able to solve your problem?