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.

could not parse environment variables

See original GitHub issue

Description

environment command in beanstalk platform scripts does not work Sorry for posting this here bug but I don’t know where to report this

Steps to reproduce

ssh to the beanstalk instance and execute the command

/opt/elasticbeanstalk/bin/get-config environment

Observed result

could not parse environment variables

Expected result

list of environment variables

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: amzn2
  2. it works using optionsettings command
/opt/elasticbeanstalk/bin/get-config optionsettings
  1. My environment variables:
  "ANALYTICS_AWS_KEY": "",
  "ANALYTICS_AWS_REGION": "eu-west-1",
  "ANALYTICS_AWS_SECRET": "",
  "ANALYTICS_AWS_URL": "https://sqs.eu-west-1.amazonaws.com/********/awseb-**********",
  "ANALYTICS_ENABLED": "true",
  "ANALYTICS_SECRET_KEY": "*************",
  "APP_ADMIN_MAIL": "contact@******.com",
  "APP_DEBUG": "false",
  "APP_ENV": "local",
  "APP_KEY": "base64:xb/***********=",
  "APP_NAME": "Laravel",
  "APP_URL": "https://prod.core.******.com",
  "AWS_ACCESS_KEY_ID": "",
  "AWS_BUCKET": "",
  "AWS_DEFAULT_REGION": "eu-west-1",
  "AWS_SECRET_ACCESS_KEY": "",
  "BROADCAST_DRIVER": "log",
  "CACHE_DRIVER": "redis",
  "DB_CONNECTION": "mongodb",
  "DB_DATABASE": "******",
  "DB_DSN": "mongodb://*****:**(&**#**=***@*****:27017/*****?authSource=admin",
  "ELASTICSEARCH_HOST": "https://*****.eu-west-1.es.amazonaws.com:443",
  "ELASTICSEARCH_INDEX": "scout",
  "FILESYSTEM_DRIVER": "public",
  "FIREBASE_CREDENTIALS": "storage/********.json",
  "FIREBASE_ENABLE_DEBUG": "false",
  "FIREBASE_PROJECT": "******",
  "LOGGING_APP_TAG": "*******.logs",
  "LOGGING_NGINX_TAG": "*******.logs",
  "LOG_CHANNEL": "stack",
  "MAIL_ENCRYPTION": "tls",
  "MAIL_FROM_ADDRESS": "admin@********.com",
  "MAIL_FROM_NAME": "${APP_NAME}",
  "MAIL_HOST": "smtp.*******",
  "MAIL_MAILER": "smtp",
  "MAIL_PASSWORD": "********",
  "MAIL_PORT": "2525",
  "MAIL_USERNAME": "******",
  "MIX_PUSHER_APP_CLUSTER": "${PUSHER_APP_CLUSTER}",
  "MIX_PUSHER_APP_KEY": "${PUSHER_APP_KEY}",
  "PUSHER_APP_CLUSTER": "mt1",
  "PUSHER_APP_ID": "",
  "PUSHER_APP_KEY": "",
  "PUSHER_APP_SECRET": "",
  "QUEUE_CONNECTION": "redis",
  "REDIS_CLIENT": "predis",
  "REDIS_HOST": "***-prod.rodwzz.***",
  "REDIS_PASSWORD": null,
  "REDIS_PORT": "6379",
  "SCOUT_DRIVER": "elastic",
  "SCOUT_QUEUE": "true",
  "SESSION_DRIVER": "file",
  "SESSION_LIFETIME": "120"
  1. Beanstalk Solution:
PHP 7.3 running on 64bit Amazon Linux 2/3.1.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
shqear93commented, Dec 13, 2020

As a workaround I wrote this script :

/opt/elasticbeanstalk/bin/get-config optionsettings | \
    jq '."aws:elasticbeanstalk:application:environment"' | \
    jq -r 'to_entries | .[] | "export \(.key)=\"\(.value)\""'
2reactions
AdamSelenecommented, Aug 7, 2021

I had a similar issue: get-config environment would fail on one Amazon Linux 2 environment (“could not parse environment variables”), but it was working on others (with different environment variables). Turns out get-config environment was choking on an env var that was set to "null" (i.e. the 4-characters string “null”) - I updated it and it worked 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot issues when passing environment variables to ...
I want to troubleshoot issues when passing environment variables to my Amazon Elastic Container Service (Amazon ECS) task. Short description.
Read more >
Environment properties are not passed to application in ...
No. I mean in the actual variable value, in ANY env var that is in EB. Our issue was that we had a...
Read more >
Setting the remote environment - Ansible Documentation
You can use the environment keyword at the play, block, or task level to set an environment variable for an action on a...
Read more >
Problems with Environment Variables
If the error message states that the environment variable is not set, IT MEANS PRECISELY THAT ! The most likely reason is that...
Read more >
Craft cms environment Variable not parse
I am using craft cms version 3.7.42. when i use my system email that give me my .env variable name only not parse...
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