Page MenuHomePhabricator

20131121.repocredentials.2.mig.php fails
Closed, ResolvedPublic

Description

If you are upgrading from an older version Fabricator error has occurred. I have to either complete the upgrade or revert to previous state.

Full dump below:

Applying patch 'phabricator:20131121.repocredentials.2.mig.php'...
Examining repository BIDEV...
...will migrate.
Examining repository WTM...
...will migrate.
Examining repository PPMTRUNK...
...will migrate.
Examining repository IPTOOR...
...will migrate.
Examining repository DROID...
...will migrate.
Examining repository CRM...
...will migrate.
Examining repository CRMDROID...
...will migrate.
Examining repository ASOF...
...will migrate.
Examining repository BSSPAY...
...will migrate.
Examining repository TRACKER...
...will migrate.
Examining repository CARDMON...
...will migrate.
Examining repository FRAUD...
...will migrate.
Examining repository ZOD...
...will migrate.
Examining repository FRD...
...will migrate.
Examining repository FRDEV...
...will migrate.
Examining repository CARDMONDEV...
...will migrate.
Examining repository ZODEV...
...will migrate.
Examining repository PTDEV...
...will migrate.
Examining repository DRDEV...
...will migrate.
Examining repository FMUS...
...will migrate.
Examining repository PPM...
...will migrate.
Examining repository DEBMON...
...will migrate.
Examining repository WEB...
...will migrate.
Examining repository SBTESTING...
...will migrate.
Examining repository SBTESTDEV...
...will migrate.
Examining repository SBTESTDEVPG...
...will migrate.
Examining repository SBBI...
...will migrate.
Examining repository STAVKA...
...no remote URI.
Creating: Migrated Repository Credential (BIDEV, WTM, PPMTRUNK, IPTOOR, DROID, CRM, CRMDROID, ASOF, BSSPAY, TRACKER, CARDMON, FRAUD, ZOD, FRD, FRDEV, CARDMONDEV, ZODEV...)...
[2015-07-03 16:57:27] EXCEPTION: (AphrontSchemaQueryException) #1146: Table 'phabricator_spaces.spaces_namespace' doesn't exist at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:308]
arcanist(head=master, ref.master=d54cb072facd), phabricator(head=master, ref.master=1f4cd900f3de), phutil(head=master, ref.master=83f09f6c5a03)

#0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
#1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
#2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
#3 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string, string, string, string, string, string, string)
#4 call_user_func_array(string, array) called at [<phutil>/src/xsprintf/queryfx.php:11]
#5 queryfx_all(AphrontMySQLiDatabaseConnection, string, string, string, string, string, string, string, string, string, string) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:99]
#6 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPageRows(PhabricatorSpacesNamespace) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:81]
#7 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPage(PhabricatorSpacesNamespace) called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:40]
#8 PhabricatorSpacesNamespaceQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:227]
#9 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:114]
#10 PhabricatorSpacesNamespaceQuery::getAllSpaces() called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:150]
#11 PhabricatorSpacesNamespaceQuery::getViewerSpaces(PhabricatorUser) called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:171]
#12 PhabricatorSpacesNamespaceQuery::getViewerActiveSpaces(PhabricatorUser) called at [<phabricator>/src/applications/people/storage/PhabricatorUser.php:797]
#13 PhabricatorUser::getDefaultSpacePHID() called at [<phabricator>/src/applications/passphrase/storage/PassphraseCredential.php:43]
#14 PassphraseCredential::initializeNewCredential(PhabricatorUser) called at [<phabricator>/resources/sql/patches/20131121.repocredentials.2.mig.php:87]
#15 require_once(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:226]
#16 PhabricatorStorageManagementAPI::applyPatchPHP(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:191]
#17 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:190]
#18 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
#19 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
#20 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:176]

PHP Fatal error: Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}

thrown in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Fatal error: Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}

thrown in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Event Timeline

appolonov raised the priority of this task from to Normal.
appolonov updated the task description. (Show Details)
appolonov added a project: Phabricator.
appolonov added a subscriber: appolonov.
chad raised the priority of this task from Normal to Needs Triage.Jul 3 2015, 2:43 PM
chad removed a project: Phabricator.

I believe this should now be fixed in HEAD. Please let us know if you encounter further issues.

After updating the data from the repository and updating the phabricator problem persists.

Creating: Migrated Repository Credential (BIDEV, WTM, PPMTRUNK, IPTOOR, DROID, CRM, CRMDROID, ASOF, BSSPAY, TRACKER, CARDMON, FRAUD, ZOD, FRD, FRDEV, CARDMONDEV, ZODEV…)...
[2015-07-06 08:29:36] EXCEPTION: (AphrontSchemaQueryException) #1146: Table 'phabricator_spaces.spaces_namespace' doesn't exist at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:308]
arcanist(head=master, ref.master=d54cb072facd), phabricator(head=master, ref.master=ab7dc13c67fd), phutil(head=master, ref.master=83f09f6c5a03)

#0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
#1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
#2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
#3 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string, string, string, string, string, string, string)
#4 call_user_func_array(string, array) called at [<phutil>/src/xsprintf/queryfx.php:11]
#5 queryfx_all(AphrontMySQLiDatabaseConnection, string, string, string, string, string, string, string, string, string, string) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:99]
#6 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPageRows(PhabricatorSpacesNamespace) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:81]
#7 PhabricatorCursorPagedPolicyAwareQuery::loadStandardPage(PhabricatorSpacesNamespace) called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:40]
#8 PhabricatorSpacesNamespaceQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:227]
#9 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:114]
#10 PhabricatorSpacesNamespaceQuery::getAllSpaces() called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:150]
#11 PhabricatorSpacesNamespaceQuery::getViewerSpaces(PhabricatorUser) called at [<phabricator>/src/applications/spaces/query/PhabricatorSpacesNamespaceQuery.php:171]
#12 PhabricatorSpacesNamespaceQuery::getViewerActiveSpaces(PhabricatorUser) called at [<phabricator>/src/applications/people/storage/PhabricatorUser.php:797]
#13 PhabricatorUser::getDefaultSpacePHID() called at [<phabricator>/src/applications/passphrase/storage/PassphraseCredential.php:43]
#14 PassphraseCredential::initializeNewCredential(PhabricatorUser) called at [<phabricator>/resources/sql/patches/20131121.repocredentials.2.mig.php:87]
#15 require_once(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:226]
#16 PhabricatorStorageManagementAPI::applyPatchPHP(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:191]
#17 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:190]
#18 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
#19 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
#20 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:176]

PHP Fatal error: Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}

thrown in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

Fatal error: Uncaught exception 'Exception' with message 'Process exited with an open transaction! The transaction will be implicitly rolled back. Calls to openTransaction() must always be paired with a call to saveTransaction() or killTransaction().' in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}

thrown in /var/www/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78

I think the error is due to the fact that the table is going to appeal does not exist.

mysql> show tables from phabricator_spaces;
Empty set (0.01 sec)

The database phabricator_spaces contains no tables.

I would re-check you actually updated. The error message points to ab7dc13c67fd, which was before the fix was committed.

After updating the data from the repository and updating the phabricator problem persists. Creating: Migrated Repository Credential (BIDEV, WTM, PPMTRUNK, IPTOOR, DROID, CRM, CRMDROID, ASOF, BSSPAY, TRACKER, CARDMON, FRAUD, ZOD, FRD, FRDEV, CARDMONDEV, ZODEV…)...

[2015-07-06 08:29:36] EXCEPTION: (AphrontSchemaQueryException) #1146: Table 'phabricator_spaces.spaces_namespace' doesn't exist at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:308]
arcanist(head=master, ref.master=d54cb072facd), phabricator(head=master, ref.master=ab7dc13c67fd), phutil(head=master, ref.master=83f09f6c5a03)

ab7dc13c67fd (Sun, Jul 5, 12:28 PM) is after the earlier patch 92b73fed6b2c (Fri, Jul 3, 10:59 AM). This is still an error with the migration.

oh I moused over arcanist. I am teh sillies.

Since this migration is ~18 months old and there's no easy way to correct it, I'm just going to no-op it. You'll need to update your repositories to set the correct credentials after upgrading.

If they all share the same credentials, you can do this in bulk by updating one, then setting credentialPHID to the same value in all other rows. For example, update A, then select the resulting credential PHID:

SELECT credentialPHID FROM phabricator_repository.repository WHERE callsign = 'A';

Then update all the other rows to use the same credential:

UPDATE phabricator_repository.repository SET credentialPHID = '...';

This isn't great, but we don't have the infrastructure to reasonably maintain complete backward compatibility indefinitely.

Alternatively, you can update everything to some commit about 6 months ago, upgrade, then update to HEAD and upgrade again. That should work smoothly. This is a process we could hypothetically script, but the need to update through 18 months of changes is very rare and it requires external support infrastructure which we don't have today.

epriestley triaged this task as Normal priority.
epriestley added a project: Setup.

The problem was solved phased upgrade phabricator and libraries

Cool, glad to hear things are working again.