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.

possible bug - environment variable value being cut

See original GitHub issue

I have an ENV variable, say RANDOM_HASH in my .env file

.env

RANDOM_HASH="XXXXX#XXXXX%9^XX$4$FYNHtpPs6uc"

and on serverless.yml

custom:
  dotenv:
    include:
      - RANDOM_HASH

when i deploy it, what reaches my lambda function only is XXXXX#XXXXX%9^XX Somehow, it has been cut in the first $

same thing is found on the cloudformation-template-update-stack.json file

        "Environment": {
          "Variables": {
            "RANDOM_HASH": "XXXXX#XXXXX%9^XX"
          }
        }

so i suspect that the library somehow accidentally split the content. Do you have some work around in mind, so that I can upload the same env variable value?

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
tafelnlcommented, Nov 25, 2021

I think this should really be mentioned in the docs. Not everyone is aware of this, and they might bang their head against the wall while figuring this out 😉

2reactions
jeffskicommented, Jun 13, 2020

Hi @triwats, yes, I’m just using a backslash \ to secape a $, not using any kind of encapsulation around it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variable string getting chopped off because of ...
I need to use the varibale in a script. When I print the variable through the script, The string gets chopped off after...
Read more >
Buffer Overflow via Environment Variables - OWASP Foundation
The environment variable exposed to the user is vulnerable to a buffer overflow. The vulnerable environment variable uses untrusted data. Tainted data used...
Read more >
5 Bug-Prone Points About Variables in Linux Bash Scripting
When we declare a variable in Bash, there are 3 options about the usage of quotation marks: No quotation marks at all; Use...
Read more >
Environment variables in .tf files · Issue #62 · hashicorp/terraform
I browsed all over the documentation and couldn't find a way to interpolate environment variables in a configuration file. Is this possible?
Read more >
23.2 env : Run a command in a modified environment - GNU.org
Setting a variable to an empty value is different from unsetting it. ... Run foo with a reduced environment, preserving only the original...
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