Page MenuHomePhabricator

Upgrade from Jun 18 2014
Closed, InvalidPublic

Description

I migrated phabricator from old server (Ubuntu 12.04.5) to the new one (Ubuntu 16.04.1, nginx + php5.6-fpm).
Last commit is rPca801c7ad49aa2e96e92f4bf4b892f9defe1c427, dated Jun 18 2014. All works just fine. Now I try to upgrade it.
Task order in upgrade manual is not clear. General steps say to stop services and than to run git pull, script makes things in vice versa. I tried both. Last my try was in script way.
I made git checkout to stable branch (from deploy) and had to install php7.1-mysql extension (and I use php5.6)

php-fpm5. 1269 www-data    0u  IPv4  17753      0t0  TCP ubuntu162.lab:9000 (LISTEN)
./bin/storage upgrade --force
Applying patch "phabricator:db.xhpast" to host "localhost:3306"...
Applying patch "phabricator:db.fund" to host "localhost:3306"...
Applying patch "phabricator:db.almanac" to host "localhost:3306"...
Applying patch "phabricator:db.multimeter" to host "localhost:3306"...
Applying patch "phabricator:db.spaces" to host "localhost:3306"...
Applying patch "phabricator:db.phurl" to host "localhost:3306"...
Applying patch "phabricator:db.badges" to host "localhost:3306"...
Applying patch "phabricator:db.packages" to host "localhost:3306"...
Applying patch "phabricator:20140211.dx.999.drop.relationships.sql" to host "localhost:3306"...
Applying patch "phabricator:20140214.clean.1.legacycommentid.sql" to host "localhost:3306"...
Applying patch "phabricator:20140214.clean.2.dropcomment.sql" to host "localhost:3306"...
Applying patch "phabricator:20140214.clean.3.dropinline.sql" to host "localhost:3306"...
Applying patch "phabricator:20140226.dxcustom.99.drop.sql" to host "localhost:3306"...
Applying patch "phabricator:20140624.projcolor.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140624.projcolor.2.sql" to host "localhost:3306"...
Applying patch "phabricator:20140629.dasharchive.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140629.legalsig.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140629.legalsig.2.php" to host "localhost:3306"...
Applying patch "phabricator:20140701.legalexemption.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140701.legalexemption.2.sql" to host "localhost:3306"...
Applying patch "phabricator:20140703.legalcorp.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140703.legalcorp.2.sql" to host "localhost:3306"...
Applying patch "phabricator:20140703.legalcorp.3.sql" to host "localhost:3306"...
Applying patch "phabricator:20140703.legalcorp.4.sql" to host "localhost:3306"...
Applying patch "phabricator:20140703.legalcorp.5.sql" to host "localhost:3306"...
Applying patch "phabricator:20140704.harbormasterstep.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140704.harbormasterstep.2.sql" to host "localhost:3306"...
Applying patch "phabricator:20140704.legalpreamble.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140706.harbormasterdepend.1.php" to host "localhost:3306"...
Applying patch "phabricator:20140706.pedge.1.sql" to host "localhost:3306"...
Applying patch "phabricator:20140711.pnames.1.sql" to host "localhost:3306"...
[2017-01-11 09:26:12] EXCEPTION: (AphrontQueryException) #1050: Table 'project_datasourcetoken' already exists at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:355]
arcanist(head=stable, ref.master=ade25facfdf2, ref.stable=9503b941cc02), phabricator(head=stable, ref.master=7ea1bd5a5a44, ref.stable=40be2d53743c), phutil(head=stable, ref.master=c5848b71c10f, ref.stable5b57f7ab524)
  #0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:289]
  #1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:185]
  #2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:8]
  #3 queryfx(AphrontMySQLiDatabaseConnection, string, string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:268]
  #4 PhabricatorStorageManagementAPI::applyPatchSQL(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:238]
  #5 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:1093]
  #6 PhabricatorStorageManagementWorkflow::doUpgradeSchemata(array, NULL, boolean, boolean) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php40]
  #7 PhabricatorStorageManagementWorkflow::upgradeSchemata(array, NULL, boolean, boolean) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflophp:78]
  #8 PhabricatorStorageManagementUpgradeWorkflow::didExecute(PhutilArgumentParser) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:107]
  #9 PhabricatorStorageManagementWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:438]
  #10 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:330]
  #11 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:249]

And now my phabricator web page shows

Upgrade MySQL Schema
Run the storage upgrade script to upgrade databases (host "localhost:3306" is out of date). Missing patches: phabricator:20140711.pnames.1.sql, phabricator:20140711.pnames.2.php, phabricator:20140711.workerpriority.sql, phabricator:20140712.projcoluniq.sql, phabricator:20140721.phortune.1.cart.sql, phabricator:20140721.phortune.2.purchase.sql, phabricator:20140721.phortune.3.charge.sql, phabricator:20140721.phortune.4.cartstatus.sql, phabricator:20140721.phortune.5.cstatusdefault.sql, phabricator:20140721.phortune.6.onetimecharge.sql, phabricator:20140721.phortune.7.nullmethod.sql, phabricator:20140722.appname.php, phabricator:20140722.audit.1.xactions.sql, phabricator:20140722.audit.2.comments.sql, phabricator:20140722.audit.3.miginlines.php, phabricator:20140722.audit.4.migtext.php, phabricator:20140722.renameauth.php, phabricator:20140723.apprenamexaction.sql, phabricator:20140725.audit.1.migxactions.php, phabricator:20140731.audit.1.subscribers.php, phabricator:20140731.cancdn.php, phabricator:20140731.harbormasterstepdesc.sql, phabricator:20140805.boardcol.1.sql, phabricator:20140805.boardcol.2.php, phabricator:20140807.harbormastertargettime.sql, phabricator:20140808.boardprop.1.sql, phabricator:20140808.boardprop.2.sql, phabricator:20140808.boardprop.3.php, phabricator:20140811.blob.1.sql, phabricator:20140811.blob.2.sql, phabricator:20140812.projkey.1.sql, phabricator:20140812.projkey.2.sql, phabricator:20140814.passphrasecredentialconduit.sql, phabricator:20140815.cancdncase.php, phabricator:20140818.harbormasterindex.1.sql, phabricator:20140821.harbormasterbuildgen.1.sql, phabricator:20140822.daemonenvhash.sql, phabricator:20140902.almanacdevice.1.sql, phabricator:20140904.macroattach.php, phabricator:20140911.fund.1.initiative.sql, phabricator:20140911.fund.2.xaction.sql, phabricator:20140911.fund.3.edge.sql, phabricator:20140911.fund.4.backer.sql, phabricator:20140911.fund.5.backxaction.sql, phabricator:20140914.betaproto.php, phabricator:20140917.project.canlock.sql, 

AND SO ON

Event Timeline

avivey added a subscriber: avivey.

The order of stopping/starting daemons/webserver isn't important, as long as both are down during the upgrade.

Looks like you already have the table phabricator_project.project_datasourcetoken, although I see nothing in the code that would create it. Did you start a migration and then stop it using +C?

In this particular case, and assuming ./bin/storage status | grep phabricator:20140711.pnames.2.php shows localhost Not Applied, you can just drop the table and run the migration script again. Make sure it passes, otherwise you will not have the server up to date.

(Note that this kind of requests are normally not supported - see Support Resources. This is not likely a bug in Phabricator).

epriestley added a subscriber: epriestley.

Particularly, this does not reproduce against the upstream. All patches can be re-run in order with ./bin/storage upgrade --no-quickstart --namespace ..., and we do this somewhat regularly. This process runs cleanly:

$ ./bin/storage upgrade --no-quickstart --namespace test_T12094 --force
<... snip ...>
Applying patch "phabricator:20140704.legalpreamble.1.sql" to host "localhost"...
Applying patch "phabricator:20140706.harbormasterdepend.1.php" to host "localhost"...
Applying patch "phabricator:20140706.pedge.1.sql" to host "localhost"...
Applying patch "phabricator:20140711.pnames.1.sql" to host "localhost"...
Applying patch "phabricator:20140711.pnames.2.php" to host "localhost"...
Updating project datasource tokens...
Done.
Applying patch "phabricator:20140711.workerpriority.sql" to host "localhost"...
Applying patch "phabricator:20140712.projcoluniq.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.1.cart.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.2.purchase.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.3.charge.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.4.cartstatus.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.5.cstatusdefault.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.6.onetimecharge.sql" to host "localhost"...
Applying patch "phabricator:20140721.phortune.7.nullmethod.sql" to host "localhost"...
<... snip ...>
Applying schema adjustments...
Done.                                                                         
Completed applying all schema adjustments.

Also note that PHP7 is not supported (see T9640), so even if you make it through the process Phabricator will refuse to run. This is noted in the install documentation:

PHP: You need PHP 5.2 or newer, but note that PHP 7 is not supported.
https://secure.phabricator.com/book/phabricator/article/installation_guide/

Since we can't reproduce this (and all signs point to it not being an upstream bug), I'm going to close this task. Feel free to open a new one if you can develop complete reproduction steps (see Providing Reproduction Steps) which we can follow in a clean environment to reproduce the issue.

I know that php7 is not supported. I mentioned that I switched php to 5 version

php-fpm5. 1269 www-data    0u  IPv4  17753      0t0  TCP ubuntu162.lab:9000 (LISTEN)

Okay, I saw php7.1-mysql and just wanted to make sure you were aware.