Page MenuHomePhabricator

"Undefined index" exception in ChangesetParser while viewing diffs
Closed, ResolvedPublic

Description

Via cluster user report. Here's at trace from web.

[2020-04-27 20:48:38] EXCEPTION: (RuntimeException) Undefined index:  at [<arcanist>/src/error/PhutilErrorHandler.php:253]
arcanist(head=stable, ref.master=7d15b85a1bc0, ref.stable=c87880142b72), libcore(), phabricator(head=stable, ref.stable=a1c978ef378a), services(head=stable, ref.master=fb2140e5b9da, ref.stable=2d7586076ae4)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:984]
  #1 <#2> DifferentialChangesetParser::render(NULL, NULL, array) called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:75]
  #2 <#2> DifferentialChangesetParser::renderChangeset() called at [<phabricator>/src/applications/differential/parser/DifferentialChangesetParser.php:1874]
  #3 <#2> DifferentialChangesetParser::newChangesetResponse() called at [<phabricator>/src/applications/differential/view/DifferentialChangesetListView.php:207]
  #4 <#2> phutil_escape_html(DifferentialChangesetListView) called at [<phabricator>/src/infrastructure/markup/render.php:135]
  #5 <#2> phutil_escape_html(array) called at [<phabricator>/src/infrastructure/markup/render.php:97]
  #6 <#2> phutil_tag(string, array, array) called at [<phabricator>/src/view/phui/PHUITwoColumnView.php:243]
  #7 <#2> PHUITwoColumnView::buildFooter() called at [<phabricator>/src/view/phui/PHUITwoColumnView.php:123]
  #8 <#2> PHUITwoColumnView::getTagContent() called at [<phabricator>/src/view/AphrontTagView.php:161]
  #9 <#2> AphrontTagView::render() called at [<phabricator>/src/view/AphrontView.php:222]
  #10 <#2> AphrontView::producePhutilSafeHTML() called at [<phabricator>/src/infrastructure/markup/render.php:111]
  #11 <#2> phutil_escape_html(PHUITwoColumnView) called at [<phabricator>/src/infrastructure/markup/render.php:167]
  #12 <#2> phutil_implode_html(string, array) called at [<phabricator>/src/view/page/PhabricatorBarePageView.php:58]
  #13 <#2> PhabricatorBarePageView::willRenderPage() called at [<phabricator>/src/view/page/PhabricatorStandardPageView.php:216]
  #14 <#2> PhabricatorStandardPageView::willRenderPage() called at [<phabricator>/src/view/page/AphrontPageView.php:46]
  #15 <#2> AphrontPageView::render() called at [<phabricator>/src/view/page/PhabricatorStandardPageView.php:904]
  #16 <#2> PhabricatorStandardPageView::produceAphrontResponse() called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:723]
  #17 <#2> AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:303]
  #18 phlog(RuntimeException) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #19 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:752]
  #20 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:341]
  #21 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:211]
  #22 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:35]

Event Timeline

epriestley triaged this task as Normal priority.Apr 27 2020, 8:51 PM
epriestley created this task.

This appears to be an issue with synthetic lint messages from Harbormaster that do not specify a line number. We reach this section of the code:

$line = $comment->getLineNumber();
if ($new_side) {
  $back_line = $new_backmap[$line];
} else {
  $back_line = $old_backmap[$line];
}

...and now fail trying to access $new_backmap[null] after D21044.

This seems to be fixed and has deployed to the cluster.