Storage Upgrade doesn't seem to be completing

I am attempting to upgrade two Phabricator servers with glaring PHP5 vulnerabilities. The first server went without an issue but the second one does not seem to be able to complete the storage upgrade using the command:

./bin/sudo storage upgrade

I have tried using the username and password switches with a user I was sure could connect to mysql as well as --force but I always get the below output every time after the command is run:

Applying patch "phabricator:20170528.maniphestdupes.php" to host "localhost"...
[2017-10-26 20:36:14] EXCEPTION: (Exception) No configured storage engine can store this file. See "Configuring File Storage" in the documentation for information on configuring storage engines. at [<phabricator>/src/applications/files/storage/PhabricatorFile.php:314]
arcanist(head=master, ref.master=0989343a4e0c), phabricator(head=master, ref.master=beaf0ad9a636), phutil(head=master, ref.master=95c065963998)
  #0 PhabricatorFile::buildFromFileData(string, array) called at [<phabricator>/src/applications/files/storage/PhabricatorFile.php:428]
  #1 PhabricatorFile::newFromFileData(string, array) called at [<phabricator>/src/applications/files/builtin/PhabricatorFilesComposeAvatarBuiltinFile.php:174]
  #2 PhabricatorFilesComposeAvatarBuiltinFile::getUserProfileImageFile(string) called at [<phabricator>/src/applications/people/cache/PhabricatorUserProfileImageCacheType.php:54]
  #3 PhabricatorUserProfileImageCacheType::newValueForUsers(string, array) called at [<phabricator>/src/applications/people/query/PhabricatorPeopleQuery.php:618]
  #4 PhabricatorPeopleQuery::fillUserCaches(array) called at [<phabricator>/src/applications/people/query/PhabricatorPeopleQuery.php:448]
  #5 PhabricatorPeopleQuery::rebuildAvailabilityCache(array) called at [<phabricator>/src/applications/people/query/PhabricatorPeopleQuery.php:208]
  #6 PhabricatorPeopleQuery::didFilterPage(array) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:273]
  #7 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/phid/type/PhabricatorPHIDType.php:91]
  #8 PhabricatorPHIDType::loadObjects(PhabricatorObjectQuery, array) called at [<phabricator>/src/applications/phid/query/PhabricatorObjectQuery.php:153]
  #9 PhabricatorObjectQuery::loadObjectsByPHID(array, array) called at [<phabricator>/src/applications/phid/query/PhabricatorObjectQuery.php:73]
  #10 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/phid/query/PhabricatorHandleQuery.php:46]
  #11 PhabricatorHandleQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:236]
  #12 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/phid/handle/pool/PhabricatorHandlePool.php:73]
  #13 PhabricatorHandlePool::loadPHIDs(array) called at [<phabricator>/src/applications/phid/handle/pool/PhabricatorHandleList.php:44]
  #14 PhabricatorHandleList::loadHandles() called at [<phabricator>/src/applications/phid/handle/pool/PhabricatorHandleList.php:49]
  #15 PhabricatorHandleList::getHandle(string) called at [<phabricator>/src/applications/phid/handle/pool/PhabricatorHandleList.php:130]
  #16 PhabricatorHandleList::current()
  #17 iterator_to_array(PhabricatorHandleList) called at [<phabricator>/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php:144]
  #18 PhabricatorApplicationTransactionQuery::willFilterPage(array) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:247]
  #19 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/resources/sql/autopatches/20170528.maniphestdupes.php:26]
  #20 require_once(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:285]
  #21 PhabricatorStorageManagementAPI::applyPatchPHP(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:241]
  #22 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:1103]
  #23 PhabricatorStorageManagementWorkflow::doUpgradeSchemata(array, NULL, boolean, boolean) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:849]
  #24 PhabricatorStorageManagementWorkflow::upgradeSchemata(array, NULL, boolean, boolean) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:78]
  #25 PhabricatorStorageManagementUpgradeWorkflow::didExecute(PhutilArgumentParser) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:107]
  #26 PhabricatorStorageManagementWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:441]
  #27 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:333]
  #28 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:249]

Is the pertinent error the exception about “No configured storage engine” at the top? I don’t think there is an issue with the connection to the storage engine as I get the below output to the webpage and it seems that some of the SQL changes applied if I check with “./storage status”. Any ideas? Internet searches haven’t provided any similar problems or resolutions.

“No configured storage engine” refers to Phabricator’s hosting of user-generated files, so it’s possible that the application works without it.

From the stacktrace, it looks like something is trying to generate avatar images (Which are considered “user-generated”), and fails because of the storage setup being problematic.

Depending on how exactly you had things configured, it’s possible that some problem makes file storage fail completely. These files should be small (<10K). I’m guessing you disabled file-system storage and mysql storage, and only allow S3 or something like that?

As a workaround, I think enabling file-system storage (use ./bin/config to configure storage.local-disk.path to something writable) should allow the migration to continue, and you can migrate the files to the right place later using ./bin/files.

As a side-note, you shouldn’t run ./bin/storage as root - it only needs read access to the config file, and then it will access the DB the the credentials from there.

1 Like

Thank you! That was it. I created a directory and set it as the storage.local-disk.path. I’ll compare this to the other server and do some more investigation on how ./bin/files works when I do the live upgrade (this was only a test on a VM clone).

Thanks again.

It turned out the problem I was having is that it was missing the AWS S3 region, so it thought the config was invalid. Adding this allowed the script to run:

sudo ./config set amazon-s3.region us-west-2

Just thought I’d close the loop on this…

hello,I have meet a similar problem.when I Excuting the cmd: ./bin/storage upgrade ,this problem occur:


the version of mysql is 5.7.20,Is it because my database is not configured yet? If so,How should I configure it .
Looking forward to your answer, thank you

@Hesir: Your php is missing mysql extensions. Install php-mysqli. See https://secure.phabricator.com/book/phabricator/article/installation_guide/.