Page MenuHomePhabricator

AphrontSchemaQueryException on create\update task
Closed, InvalidPublic

Description

After update we found that creating tasks is not possible anymore. Only error we see:

Unhandled Exception ("AphrontSchemaQueryException")
#1054: Unknown column 'projectPHIDs' in 'field list'

NOTE: This usually indicates that the MySQL schema has not been properly upgraded. Run 'bin/storage upgrade' to ensure your schema is up to date.

Database schema was not changed by hand, we already use bin/storage upgrade

How to reproduce (I don't sure you will be succeeded):

  1. use phabricator about 2 month without updates
  2. update it via update_phabricator.sh

From logs:

2016/02/26 15:12:02 [error] 13134#0: *4312 FastCGI sent in stderr: "PHP message: 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 /home/ylphil/sites/phabricator/libphutil/src/aphront/storage/connection/AphrontDatabase" while reading upstream, client: 32.130.91.221, server: phabricator.orbilet.ru, request: "POST /maniphest/task/edit/form/default/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "phabricator.orbilet.ru"
2016/02/26 15:12:02 [error] 13134#0: *4312 FastCGI sent in stderr: "TransactionState.php:78
Stack trace:
#0 [internal function]: AphrontDatabaseTransactionState->__destruct()
#1 {main}
  thrown in /home/ylphil/sites/phabricator/libphutil/src/aphront/storage/connection/AphrontDatabaseTransactionState.php on line 78" while reading upstream, client: 32.130.91.221, server: phabricator.orbilet.ru, request: "POST /maniphest/task/edit/form/default/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "phabricator.orbilet.ru"
2016/02/26 15:12:41 [error] 13134#0: *4333 FastCGI sent in stderr: "PHP message: [2016-02-26 15:12:41] EXCEPTION: (AphrontSchemaQueryException) #1054: Unknown column 'projectPHIDs' in 'field list' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:310]
PHP message: arcanist(head=stable, ref.master=57f6fb59d739, ref.stable=ed476cf8489c), phabricator(head=stable, ref.master=b5518d4bfb0d, ref.stable=ad53db0979de), phutil(head=stable, ref.master=f43291e99d36, ref.stable=9c472e7c9b64)
PHP message:   #0 <#2> AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:333]
PHP message:   #1 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
PHP message:   #2 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
PHP message:   #3 <#2> AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
PHP message:   #4 <#2> queryfx(AphrontMySQLiDatabaseConnection, string, string, string, array, string)
PHP message:   #5 <#2> call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:28]
PHP message:   #6 <#2> AphrontDatabaseConnection::query(string, string, string, array, string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1261]
PHP message:   #7 <#2> LiskDAO::insertRecordIntoDatabase(string) c" while reading response header from upstream, client: 32.130.91.221, server: phabricator.orbilet.ru, request: "POST /maniphest/task/edit/form/default/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "phabricator.orbilet.ru"
2016/02/26 15:12:41 [error] 13134#0: *4333 FastCGI sent in stderr: "alled at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1106]
PHP message:   #8 <#2> LiskDAO::insert() called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1075]
PHP message:   #9 <#2> LiskDAO::save() called at [<phabricator>/src/applications/maniphest/storage/ManiphestTask.php:201]
PHP message:   #10 <#2> ManiphestTask::save() called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:897]
PHP message:   #11 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phabricator>/src/applications/transactions/editengine/PhabricatorEditEngine.php:896]
PHP message:   #12 <#2> PhabricatorEditEngine::buildEditResponse(ManiphestTask) called at [<phabricator>/src/applications/transactions/editengine/PhabricatorEditEngine.php:792]
PHP message:   #13 <#2> PhabricatorEditEngine::buildResponse() called at [<phabricator>/src/applications/maniphest/controller/ManiphestTaskEditController.php:12]
PHP message:   #14 <#2> ManiphestTaskEditController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
PHP message:   #15 phlog(AphrontSchemaQueryException) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:32]
PHP message:   #16 PhabricatorDefaultRequestExceptionHandler::handleRequestException(AphrontRequest, AphrontSchemaQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:632]
PHP message:   #17 AphrontApplicationConfiguration::handleException(AphrontSchemaQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:242]
PHP message:   #18 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]

How to return phabricator back to normal life?

Event Timeline

Either your database didn't get updated, the code didn't fully download, or you didn't restart the webserver.

When we say "restart webserver", we mean Phabricator itself, which means php-fpm for you. See https://secure.phabricator.com/book/phabricator/article/restarting/ for more details.

Git says "Already up-to-date"
I did restart both nginx and php5-fpm many many times

But database is not equal to fresh install database.

I create the paste P1949 with schema from broken phabricator and then update it with schema from fresh install.
You can see here https://secure.phabricator.com/transactions/detail/PHID-XACT-PSTE-spejvgimsaxohyv/ diff between broken and normal db.

You can check database status and issues in Config -> Database

Maybe also related, T10003. Do you have any special configuration for Maniphest?

This column and the property for it were both removed in 32225d1 (Feb 8). You are running b5518d4b (Feb 7), but have somehow upgraded your database using a newer version of Phabricator.

Upgrade to HEAD, run bin/storage upgrade again, restart everything, and things should work again.

Oh, wait, you're actually on stable and just haven't updated master.

Regardless, the column and property were removed in 32225d1. This error is consistent with running code from before then against a more recent schema. You may not have restarted something properly, or you may not have updated src/applications/maniphest/storage/ManiphestTask.php properly. That file should no longer have projectPHIDs defined as a property, which should make this error impossible.

In any case, this is definitely some kind of problem in your local environment and not an issue with the upstream. We can't and won't be able to reproduce it and can't help you with installation and setup issues (see Support Resources).