Page MenuHomePhabricator

Browsing commits sporadically failing with Invalid Argument
Closed, ResolvedPublic

Description

I have a Repo that is fully imported on phacility (mnkrastest) and when clicking on individual commits I get the following error:

Unhandled Exception ("InvalidArgumentException")
Array item with key '0' must be an instance of DiffusionPathChange, array given.

It is sporadic and in consistent as I can select the same commit and it will be fine, then I select it again later, and it fails.

Event Timeline

Mnkras raised the priority of this task from to Needs Triage.
Mnkras updated the task description. (Show Details)
Mnkras added a project: Phacility.
Mnkras added a subscriber: Mnkras.
epriestley added a subscriber: epriestley.

Here's a stack trace for this:

[Fri Feb 13 16:10:24.883335 2015] [:error] [pid 16778] [client 172.30.0.99:10757] [2015-02-13 16:10:24] EXCEPTION: (InvalidArgumentException) Array item with key '0' must be an instance of DiffusionPathChange, array given. at [<phutil>/src/utils/utils.php:541]
[Fri Feb 13 16:10:24.883497 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #0 assert_instances_of(array, string) called at [<phabricator>/src/applications/diffusion/view/DiffusionHistoryTableView.php:13]
[Fri Feb 13 16:10:24.884711 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #1 DiffusionHistoryTableView::setHistory(array) called at [<phabricator>/src/applications/diffusion/controller/DiffusionCommitController.php:909]
[Fri Feb 13 16:10:24.884721 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #2 DiffusionCommitController::buildMergesTable(PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/diffusion/controller/DiffusionCommitController.php:175]
[Fri Feb 13 16:10:24.884728 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #3 DiffusionCommitController::processDiffusionRequest(AphrontRequest) called at [<phabricator>/src/applications/diffusion/controller/DiffusionController.php:51]
[Fri Feb 13 16:10:24.884735 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #4 DiffusionController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:196]
[Fri Feb 13 16:10:24.884739 2015] [:error] [pid 16778] [client 172.30.0.99:10757]   #5 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:121]

You can currently pull these with, e.g., core/bin/remote ssh web001, then go fish around in /var/log/apache2/error.log. We could improve the tooling here if we end up doing this a lot.

If you've configured your local instance according to the cluster instructions, newly created repositories should get bound to a service and use HTTP to pull data instead of local VCS commands. So you can likely reproduce this by creating a new repository, then browsing around on /rX1234 URIs ("DiffusionCommitController" in the stack trace).

My guess is that some call isn't getting serialized + unserialized correctly (e.g., the Conduit call just returns a PHP object instead of data that we can send over the wire). Kick this back to me this isn't good enough to hunt it down / repro it / etc.

Peeking at it, I'm guessing mergedcommitsquery returns the wrong data type here:

return DiffusionQuery::loadHistoryForCommitIdentifiers(
  $hashes,
  $drequest);

That needs to do a serailize + unserialize dance with DiffusionPathChange::newFromConduit() or whatever.