Page MenuHomePhabricator

Unable to view Harbormaster Build Plans after tagging many projects on a build plan
Closed, ResolvedPublic

Description

I'm not sure that title description is 100% correct, but I was able to view the build plans when some of them had one or two projects tagged, but after editing one build plan and adding 9 project tags, including some projects which are archived, and some not, I can no longer view the list of Build Plans (at /harbormaster/plan/). At first I thought the archived projects may be the cause of the issue, but after studying the code, it looks more likely that above a certain threshold, an iterator rather than an array is used to pass the tag list around, and the code is only partially handling that case.

Instead of seeing the list of build plans I get the message:

InvalidArgumentException
Argument 1 passed to mpull() must be of the type array, object given, called in /var/www/phabricator/src/applications/phid/view/PHUIHandleTagListView.php on line 89 and defined

PHUIHandleTagListView.php is at commit rP86720b45

I see in the code, that an attempt has been made on line 66 to handle an iterator instead of an array, but only under certain conditions (which may not be covering all cases) and it uses a local variable $handles, while the code further down which triggers the exception is using the original $this->handles.

Versions Info:

phabricator f3d8e3832c96040b6319f5f599aa877c2d773c25 (Sun, Aug 14)
arcanist c9337c2ade7c76edc98d27c216ab97fc1e40d01c (Sun, Aug 7)
phutil b6f4e866fdb2c41de23c8e635c7803a09a44e9f4 (Sun, Aug 14)

Event Timeline

epriestley triaged this task as Normal priority.

D15133 (making array utility functions accept any array-like object) is a possible attack on this in the general case, but I'm just going to fix this narrowly for now since it hasn't been a frequent/common/recurring problem so far. A more general approach may be warranted in the longer run.

This should be resolved at HEAD of master. Thanks for the report and the detailed analysis of the issue.

(Sorry this didn't get fixed more promptly, yesterday was a bit of a mess.)

Let us know if you're still seeing issues after updating, or run into anything else.