Closed ghost closed 8 years ago
If the application isn't able to connect to its database server, it returns a 500, with a blank page.
Display a useful error message, so that there's some indication of what happened.
2016/08/28 22:01:19 [error] 29847#29847: *13650 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: connection in /var/www/beta.example.com/airship/src/config/logger.php on line 38 PHP message: PHP Fatal error: Uncaught Airship\Alerts\Database\DBException: Could not create a database connection. Please check your username and password. in /var/www/beta.example.com/airship/src/Engine/Database.php:100 Stack trace: #0 /var/www/beta.example.com/airship/src/Airship.php(384): Airship\Engine\Database::factory('pgsql:host=loca...', 'db_name', '555-555-0199@ex...', Array) #1 /var/www/beta.example.com/airship/src/Engine/LedgerStorage/DBStore.php(46): Airship\get_database() #2 /var/www/beta.example.com/airship/src/config/logger.php(41): Airship\Engine\LedgerStorage\DBStore->__construct(NULL, '') #3 /var/www/beta.example.com/airship/src/config/logger.php(54): {closure}() #4 /var/www/beta.example.com/airship/src/bootstrap.php(170): require_once('/var/www/beta.a...') #5 /var/www/beta.example.com/airship/src/public/index.php(91): require_once('/var/www/beta.a...') #6 {main} thrown in /var/www/beta.example.com/airship/src/Engine/Database.php on line 100" while reading response header from upstream, client: 127.0.0.1, server: beta.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "beta.example.com"
:+1: https://github.com/paragonie/airship/commit/3bb230708d29d7b0533323d91261ef0fd156cbd8
Summary
If the application isn't able to connect to its database server, it returns a 500, with a blank page.
Expected Outcome
Display a useful error message, so that there's some indication of what happened.