Page MenuHomePhabricator

GitLab MR widget sometimes errors out on a missing index
Closed, ResolvedPublicBUG REPORT

Description

Noticed by users (at a low volume, I think) after last week's deploy of T324149: Build a widget to display GitLab changes on related Phabricator tasks.

See T332234#8708974:

It says "Undefined index: state" in an unhandled exception, maybe triggered by the recent upgrade (and revert?).

I think I just failed to account for some empty response case from the GitLab API, or maybe a variant form of the data. Digging.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
GitLabPatchesCustomField: check array indices before userepos/phabricator/extensions!4brennenwork/robustify-mr-widgetwmf/stable
Customize query in GitLab

Event Timeline

Yep:

(RuntimeException) Undefined index: state at [<arcanist>/src/error/PhutilErrorHandler.php:251]PHP message: arcanist(), ava(), phabricator(), translations(), wmf-ext-misc()
PHP message:   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<wmf-ext-misc>/src/customfields/GitLabPatchesCustomField.php:122]
PHP message:   #1 <#2> GitLabPatchesCustomField::getMergeRequestsForTask(string) called at [<wmf-ext-misc>/src/customfields/GitLabPatchesCustomField.php:63]
PHP message:   #2 <#2> GitLabPatchesCustomField::shouldAppearInPropertyView() called at [<phabricator>/src/infrastructure/customfield/field/PhabricatorCustomField.php:299]
PHP message:   #3 <#2> PhabricatorCustomField::shouldEnableForRole(string) called at [<phabricator>/src/infrastructure/customfield/field/PhabricatorCustomField.php:93]
PHP message:   #4 <#2> PhabricatorCustomField::getObjectFields(ManiphestTask, string) called at [<phabricator>/src/applications/maniphest/controller/ManiphestTaskDetailController.php:24]
PHP message:   #5 <#2> ManiphestTaskDetailController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
PHP message:   #6 phlog(RuntimeException) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
PHP message:   #7 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
PHP message:   #8 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
PHP message:   #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
PHP message:   #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:35]'

16 of these in logs. I'm guessing a brief hiccup of some kind from the GitLab API. I'll have a patch ready shortly.

brennen changed the task status from Open to In Progress.Mar 30 2023, 3:43 PM
brennen triaged this task as Medium priority.
brennen moved this task from Waiting Response to Radar on the User-brennen board.

I think this should be fixed after this morning's Phabricator update. Keeping an eye on it.

brennen claimed this task.
brennen moved this task from Radar to Done or Declined on the User-brennen board.