Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

890
Views
Error on Heroku when trying to post data ( error:0909006C Pem routines..._

I am trying to make a small nodeJS server deployed on Heroku, saving data to Firestore database. The server is deployed and running correctly. I use Insomnia to test my requests and when I use it locally I can send a post request and save my data object to the database without issues. However, when I try to send a post request to Heroku, I get a 500 error with this message:

{ "code": 16, "details": "Failed to retrieve auth metadata with error: error:0909006C:PEM routines:get_name:no start line", "metadata": {}, "note": "Exception occurred in retry method that was not classified as transient" }

I have read that it is necessary to add real line breaks in the env variable but I guess I am doing it already. This is my initializeApp function:

admin.initializeApp({
    credential: admin.credential.cert({
        projectId: process.env.PROJECT_ID,
        privateKey: process.env.PRIVATE_KEY
        ? process.env.PRIVATE_KEY.replace(/\\n/gm, "\n")
        : undefined,
        clientEmail: process.env.CLIENT_EMAIL
      }),
    databaseURL: "XXXXX"
  });

Any idea how to fix this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I solved it by copy-pasting the key with break lines directly into Heroku config variables and removing .replace(/\\n/gm, "\n") from the code.

privateKey: process.env.PRIVATE_KEY
    ? process.env.PRIVATE_KEY
    : undefined
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!