question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error:0909006C:PEM routines:get_name:no start line

See original GitHub issue

the following code is generating an error

const GoogleSpreadsheet = require('google-spreadsheet')
var creds_json = {
    client_email: 'herve76@gmail.com',
    private_key: 'AIzaSyCvB_9XZpafdHcM_AeIC4fwewYz9nOgE0'
}
let doc = new GoogleSpreadsheet('1ddhdoOTPzHho-VlU2TYPVgAC9FXx3wRw4UOHZyEdmXU')
doc.useServiceAccountAuth(creds_json, (data) => console.log(data))

error log:

error:0909006C:PEM routines:get_name:no start line
...
{
  library: 'PEM routines',
  function: 'get_name',
  reason: 'no start line',
  code: 'ERR_OSSL_PEM_NO_START_LINE'
}

any idea why?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

184reactions
crummycommented, Apr 19, 2020

If you store your key in SSM, and retrieve it with serverless and inject it with an environment variable, you’ll end up with your \n’s escaped. I resolved it this way after getting the error mentioned in this thread:

await doc.useServiceAccountAuth({
    client_email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,
    private_key: process.env.GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY.replace(/\\n/g, "\n"),
  })
11reactions
danilo-nzytecommented, Apr 4, 2021

@crummy not all heroes wear capes…

Read more comments on GitHub >

github_iconTop Results From Across the Web

error:0909006C:PEM routines:get_name:no start line - node
What this typically means is that the PEM file is missing the indicator that the key portion has begun. PEM files are structured...
Read more >
Please tutorial how to fix "error:0909006C:PEM routines ...
error:0909006C:PEM routines:get_name:no start line. How to fix it? Provide a properly formatted pkcs8 , pkcs1 , or sec1 PEM private key.
Read more >
Solved: error:0909006C:PEM routines:get_name:no start line
When making a request to a HTTPS end point, we might need to pass the certificate also. This error usually comes if the...
Read more >
error:0909006C:PEM routines:get_name:no start line.
The certificates that were used in the configuration.xml file were not in PEM format. Resolution. Ran the following to generate new certificates.
Read more >
error:0909006C:PEM routines:get_name:no start line - YouTube
json web token sign() function requires keys in certain format. Use the codehttps://gist.github.com/ygotthilf/baa58da5c3dd1f69fae9ssh-keygen ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found