My .env file is being ignored


#1

Ubuntu 16.04. Used the bootstrap.sh script, no errors.

When I try to edit /opt/redash/.env the file doesn’t get read in by redash after running. This is my current .env (modified for privacy)

export REDASH_LOG_LEVEL="INFO"
export REDASH_REDIS_URL=redis://localhost:6379/0
export REDASH_DATABASE_URL="postgresql:///redash"
export REDASH_COOKIE_SECRET=fsdfds
export REDASH_MAIL_SERVER="smtp.mailgun.org"
export REDASH_MAIL_PORT="25"
export REDASH_MAIL_USE_TLS=false
export REDASH_MAIL_USE_SSL=false # default: False
export REDASH_MAIL_USERNAME="someuser" # default: None
export REDASH_MAIL_PASSWORD="somepassword" # default: None
export REDASH_MAIL_DEFAULT_SENDER="someemail" # Email address to send from

I do a
sudo supervisorctl restart all
to reload the .env file, then a
sudo ./manage.py check_settings
to check settings. The email settings never take.

I’ve also tried going into the current directory, removing the symbolic link and moving the .env file there.


#2

When you run ./manage.py without bin/run it doesn’t read the .env file, and therefore doesn’t show the settings. If the symbolic link at /opt/redash/current points at /opt/redash/.env then it will use your new settings.


#3

Ahh you were right! Thank you so much for the fast response arikfr. New problem though, maybe you can run me through some troubleshooting steps.

So running the test email, I get a message. No Problem there, but I don’t get an email for an alert I setup. I checked all spam folders, other folks. Anything else I should be checking?


#4

Ignore my last message, pebkam :confused: I didn’t set things up correctly on the alert page (have to click ADD)