Page MenuHomePhabricator

/bin/storage upgrade fails while applying a patch.
Closed, ResolvedPublic

Description

I've been trying to upgrade phabricator (rev=d8739459f6f9d6ebd4ebd02d513533a00420f74a) to the current stable branch.

Here is my workflow,

  1. Backup current phabricator database
  2. Restore data to a new database
  3. Grab stable versions of phabricator, arcanist and libphutil.
  4. Connect new phab to the new database by setting mysql creds via ./bin/config set
  5. Run ./bin/storage upgrade

Step 5 fails with:

Applying patch 'phabricator:20141222.maniphestprojtxn.php'...
Converting Maniphest project transactions to modern edge transactions...
[2015-09-24 00:35:18] EXCEPTION: (InvalidArgumentException) Argument 1 passed to mig20141222_build_edge_data() must be an array, string given, called in /srv/rdio/phabricator/releases/20150923212053/phabricator/resources/sql/autopatches/20141222.maniphestprojtxn.php on line 19 and defined at [<phutil>/src/error/PhutilErrorHandler.php:200]
arcanist(head=master, ref.master=9c056c5cc887), phabricator(head=master, ref.master=337990423740), phutil(head=master, ref.master=c72eb747e706)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/resources/sql/autopatches/20141222.maniphestprojtxn.php:36]
  #1 mig20141222_build_edge_data(string, string) called at [<phabricator>/resources/sql/autopatches/20141222.maniphestprojtxn.php:19]
  #2 require_once(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:226]
  #3 PhabricatorStorageManagementAPI::applyPatchPHP(string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:191]
  #4 PhabricatorStorageManagementAPI::applyPatch(PhabricatorStoragePatch) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:190]
  #5 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:406]
  #6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:301]
  #7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:176]

Looks like it's a change that's made as a part of https://github.com/phacility/phabricator/commits/master/resources/sql/autopatches/20141222.maniphestprojtxn.php

Any ideas on what I'm missing here?

Event Timeline

ybv assigned this task to joshuaspence.
ybv updated the task description. (Show Details)
ybv added projects: Maniphest, Infrastructure.
ybv added a subscriber: ybv.

Nothing looks suspicious in the migration diff and no one else in 10 months has reported any issues here from searching around. You should be reading out arrays from the DB, maybe upgrade first before the move?

rPe76499bb is the migration.

@chad thanks for the quick response.
just to clarify,
you mean: upgrade new phabricator connected to a fresh db via /bin/storage upgrade-> restore data from old database -> run /bin/storage upgrade again?

chad removed btrahan as the assignee of this task.Sep 24 2015, 1:31 AM

Please let us handle task assignment.

I'll relax this migration, give me a few minutes. You have some sketchy data in your transaction history but we can just ignore it safely.

(This migration isn't idempotent and I can't really test it thoroughly since we don't have year-old environments on hand, so there's going to be some level of guesswork here.)

Oh, I'm wrong. It is idempotent, so we should be OK.

A likely fix for this is now available in HEAD:

  • Upgrade phabricator/ to HEAD of master to pick up rP99e4472.
  • Try running bin/storage upgrade again.

@chad oops, sorry!
@epriestley Thanks, will give it a shot in a bit.

That fixed it!
Sorry for the late response. Thank you so much guys.