Page MenuHomePhorge

PHP 8.1 "ltrim(null)" exception blocks rendering five applications' Configure pages
Closed, ResolvedPublic

Description

  1. PHP 8.2.5; Phorge at 651e3f7263b58e46cd65285cce7ba266af480aef with D25197 for T15358 on top
  2. Go to http://phorge.localhost/applications/
  3. Select Configure button for Differential (happens also without D25197 applied), Maniphest, Files, Paste, and Ponder
  4. All of them expose the same exception:
[2023-05-06 13:00:50] EXCEPTION: (RuntimeException) ltrim(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=renderDashboardTabPanelContent, ref.master=d47289622650, ref.renderDashboardTabPanelContent=d47289622650), phorge(head=configAppMore, ref.master=651e3f7263b5, ref.configAppMore=651e3f7263b5)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #1 <#2> ltrim(NULL, string) called at [<phorge>/src/applications/meta/panel/PhabricatorApplicationConfigurationPanel.php:31]
  #2 <#2> PhabricatorApplicationConfigurationPanel::getPanelURI() called at [<phorge>/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php:333]
  #3 <#2> PhabricatorMetaMTAApplicationEmailPanel::buildEmailTable(boolean, NULL) called at [<phorge>/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php:19]
  #4 <#2> PhabricatorMetaMTAApplicationEmailPanel::buildConfigurationPagePanel() called at [<phorge>/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:58]
  #5 <#2> PhabricatorApplicationDetailViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #7 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #8 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
[2023-05-06 13:00:50] EXCEPTION: (PhutilAggregateException) Encountered a processing exception, then another exception when trying to build a response for the first exception.
    - RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
    - RuntimeException: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=renderDashboardTabPanelContent, ref.master=d47289622650, ref.renderDashboardTabPanelContent=d47289622650), phorge(head=configAppMore, ref.master=651e3f7263b5, ref.configAppMore=651e3f7263b5)
  #0 <#4> ltrim(NULL, string) called at [<phorge>/src/applications/meta/panel/PhabricatorApplicationConfigurationPanel.php:31]
  #1 <#4> PhabricatorApplicationConfigurationPanel::getPanelURI() called at [<phorge>/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php:333]
  #2 <#4> PhabricatorMetaMTAApplicationEmailPanel::buildEmailTable(boolean, NULL) called at [<phorge>/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php:19]
  #3 <#4> PhabricatorMetaMTAApplicationEmailPanel::buildConfigurationPagePanel() called at [<phorge>/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php:58]
  #4 <#4> PhabricatorApplicationDetailViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #5 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #6 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #7 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #8 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #9 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #10 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #11 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #12 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #13 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #14 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #15 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #16 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #17 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #18 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #19 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #20 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

After fixing that exception, all fives applications' Configure pages get rendered in web browser.

Related Objects