Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15390498
D10199.id24541.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10199.id24541.diff
View Options
diff --git a/scripts/sql/manage_storage.php b/scripts/sql/manage_storage.php
--- a/scripts/sql/manage_storage.php
+++ b/scripts/sql/manage_storage.php
@@ -70,6 +70,46 @@
exit(77);
}
+// First, test that the Phabricator configuration is set up correctly. After
+// we know this works we'll test any administrative credentials specifically.
+
+$test_api = new PhabricatorStorageManagementAPI();
+$test_api->setUser($default_user);
+$test_api->setHost($default_host);
+$test_api->setPort($default_port);
+$test_api->setPassword($conf->getPassword());
+$test_api->setNamespace($args->getArg('namespace'));
+
+try {
+ queryfx(
+ $test_api->getConn(null),
+ 'SELECT 1');
+} catch (AphrontQueryException $ex) {
+ $message = phutil_console_format(
+ pht(
+ "**MySQL Credentials Not Configured**\n\n".
+ "Unable to connect to MySQL using the configured credentials. ".
+ "You must configure standard credentials before you can upgrade ".
+ "storage. Run these commands to set up credentials:\n".
+ "\n".
+ " phabricator/ $ ./bin/config set mysql.host __host__\n".
+ " phabricator/ $ ./bin/config set mysql.user __username__\n".
+ " phabricator/ $ ./bin/config set mysql.pass __password__\n".
+ "\n".
+ "These standard credentials are separate from any administrative ".
+ "credentials provided to this command with __--user__ or ".
+ "__--password__, and must be configured correctly before you can ".
+ "proceed.\n".
+ "\n".
+ "**Raw MySQL Error**: %s\n",
+ $ex->getMessage()));
+
+ echo phutil_console_wrap($message);
+
+ exit(1);
+}
+
+
if ($args->getArg('password') === null) {
// This is already a PhutilOpaqueEnvelope.
$password = $conf->getPassword();
@@ -92,10 +132,18 @@
$api->getConn(null),
'SELECT 1');
} catch (AphrontQueryException $ex) {
- echo phutil_console_format(
- "**%s**: %s\n",
- 'Unable To Connect',
- $ex->getMessage());
+ $message = phutil_console_format(
+ pht(
+ "**Bad Administrative Credentials**\n\n".
+ "Unable to connnect to MySQL using the administrative credentials ".
+ "provided with the __--user__ and __--password__ flags. Check that ".
+ "you have entered them correctly.\n".
+ "\n".
+ "**Raw MySQL Error**: %s\n",
+ $ex->getMessage()));
+
+ echo phutil_console_wrap($message);
+
exit(1);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 6:16 AM (1 w, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7390244
Default Alt Text
D10199.id24541.diff (2 KB)
Attached To
Mode
D10199: Improve `bin/storage upgrade` behavior when run out-of-order
Attached
Detach File
Event Timeline
Log In to Comment