HomePhabricator

Raise setup warnings immediately when failing to load configuration from the…

Description

Raise setup warnings immediately when failing to load configuration from the database

Summary:
Ref T11589. Previously, when we failed to load database configuration we just continued anyway, in order to get to setup checks so we could raise a better error.

There was a small chance that this could lead to pages running in a broken state, where ONLY that connection failed and everything else worked. This was accidentally fixed by narrowing the exceptions we continue on in D16489.

However, this "fix" meant that users no longer got helpful setup instructions. Instead:

  • Keep throwing these exceptions: it's bad to continue if we've failed to connect to the database.
  • However, catch them and turn them into setup errors.
  • Share all the setup code so these errors and setup check errors work the same way.

Test Plan:

  • Intentionally broke mysql.host and mysql.pass.
  • Loaded pages.
  • Got good setup errors.
  • Hit normal setup errors too.
  • Put everything back.
  • Swapped into cluster mode.
  • Intentionally broke cluster mode, saw failover to readonly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16501