Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15333080
D20781.id49552.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20781.id49552.diff
View Options
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -249,9 +249,17 @@
}
try {
- $stack->pushSource(
- id(new PhabricatorConfigDatabaseSource('default'))
- ->setName(pht('Database')));
+ // See T13403. If we're starting up in "config optional" mode, suppress
+ // messages about connection retries.
+ if ($config_optional) {
+ $database_source = @new PhabricatorConfigDatabaseSource('default');
+ } else {
+ $database_source = new PhabricatorConfigDatabaseSource('default');
+ }
+
+ $database_source->setName(pht('Database'));
+
+ $stack->pushSource($database_source);
} catch (AphrontSchemaQueryException $exception) {
// If the database is not available, just skip this configuration
// source. This happens during `bin/storage upgrade`, `bin/conf` before
diff --git a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
--- a/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
+++ b/src/infrastructure/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
@@ -126,7 +126,14 @@
$code,
$ex->getMessage());
- phlog($message);
+ // See T13403. If we're silenced with the "@" operator, don't log
+ // this connection attempt. This keeps things quiet if we're
+ // running a setup workflow like "bin/config" and expect that the
+ // database credentials will often be incorrect.
+
+ if (error_reporting()) {
+ phlog($message);
+ }
} else {
$profiler->endServiceCall($call_id, array());
throw $ex;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 11:44 PM (3 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383945
Default Alt Text
D20781.id49552.diff (1 KB)
Attached To
Mode
D20781: Use the "@" operator to silence connection retry messages if initializing the stack with database config optional
Attached
Detach File
Event Timeline
Log In to Comment