I'm seeing an unexpected environment variable dump

I’m seeing an unexpected environment variable dump Rubyonrails-talk,

My environment is:

Ubuntu 16.04

Rails 5.2.0

Ruby 2.3.1p112

I got a failure (the cause is as yet undetermined). Here is, partially, the text (in orange) of the error message I got:

We’re sorry, but something went wrong.

The issue has been logged for investigation. Please try again later.

Technical details for the administrator of this website

Error:

Web application could not be started

Error ID:

68b2c6fb

Details:

It looks like Bundler could not find a gem. Maybe you didn’t install all the gems that this application needs. To install your gems, please run:

I was surprised to see a dump of my environment variables! I thought a dump of environment variables had been turned off for security reasons since some apps stored passwords and encryption keys in environment variables.

Comments, please.

Ralph Shnelvar

Hi Ralph,

You have to explicitly turn those details off depending on the environment you’re running the app in. For instance when you’re running in development mode you want the details on so you can trace errors. When running in production you don’t want those details to show for security purposes. You can check the setting in the /path/to/your/app**/config/environments/** folder. You should see separate .rb files for each environment. The flag you need to look for is config.consider_all_requests_local, when set to true it will show the details dump.

I got a failure (the cause is as yet undetermined). Here is, partially, the text (in orange) of the error message I got: We're sorry, but something went wrong.

The issue has been logged for investigation. Please try again later. Technical details for the administrator of this website Error: Web application could not be started Error ID: 68b2c6fb Details:

That isn't a base Rails-generated error. Are you seeing this message in the console/log or on a web page?

If the latter, I'd guess you're running Apache httpd + Passenger, so there may be config options there beyond what Rails provides.

Comments, please.

If running in development mode, dumping env vars on error doesn't seem particularly bad. (Passenger used to also do this in production mode (!), though I'm told it no longer does.)