Problems with multiline environment variable


#1

I was wondering if anyone had any tips regarding multiline environment variables.

Specifically, I’ve got a PEM formatted private key for accessing a Google service. I’m currently reading it in via an environment variable but I keep getting the error Error: error:0906D06C:PEM routines:PEM_read_bio:no start line. I’m fairly sure that’s because the newlines aren’t being preserved and the parser can’t find the start line.

Here’s a screenshot of the results of me pasting the environment variable in as a service variable:

Making all of this worse: this was working yesterday. In between one deploy and the next this stopped working. So if this issue sounds familiar or someone else has a workaround or any ideas, please let me know.


#4

Hey, when was the last deploy where this worked? And have you tried using newline escape sequences?


#5

Last time it worked was yesterday, not sure about the time. Late afternoon for me (I’m in CDT).

I’m not sure I escaped them enough. :slightly_smiling_face: I wrote \n (the first time I tried to get this to work) and was getting the same error. I haven’t tried it today. Maybe I should’ve written \\n? Any opinions before I go find-and-replacing when I get a chance?


#6

Thanks for the info – just trying to discern whether it having stopped working might relate to our multi-container rollout. If it has worked the entire time before, and doesn’t now, this could be a bug, we’ll check.


#11

Can you tell us how long ago you set this multiline value first? Was that weeks ago, or did you update it in the past couple of days?


#13

Past couple of days. I think I even opened my account yesterday.


#14

I’m having the same problem; if I paste in multi-line strings then the newlines appear to be turned into spaces. Did you find a workaround / was this resolved?


#21

Hi,

We can confirm that this is an issue with the Dashboard, we have already filed an issue and will update the thread when the fix reaches production.

Thanks for reporting!


#28

In many of my Google integrations I configure the base64 part of the secret, and manage the new lines from within the code. Not a fix, but a workaround, and in my case also leaves the configuration values cleaner.


#29

@drhayes @WillFG We’ve released an update to the dashboard that fixes this issue. Line breaks in environment variable values are now preserved correctly.