Page MenuHomePhorge

PHP 8.1 "preg_match(null)" exception blocks rendering the "Browse Herald Rules" dialog
Closed, ResolvedPublic

Description

  1. PHP 8.2.6; Phorge at 5405134fa5db77bfdc0f5dbc55ed07134a60799a
  2. Have an active Diffusion repository configured
  3. Go to that existing Diffusion repository at http://phorge.localhost/diffusion/9/ (requires D25247 to be in place)
  4. Select the Actions dropdown in upper right corner to go to http://phorge.localhost/diffusion/edit/form/default/
  5. Select the View Push Logs to go to http://phorge.localhost/diffusion/pushlog/?repositories=PHID-REPO-someRepositoryString
  6. In the Blocked By field with the Type a Herald rule name... placeholder, select the magnifier button
[2023-05-26 21:26:24] EXCEPTION: (RuntimeException) preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=0e32dbc1ac8f), phorge(head=diffusionRepoPage, ref.master=5405134fa5db, ref.diffusionRepoPage=dbe5e3a68c41)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #1 <#2> preg_match(string, NULL) called at [<phorge>/src/applications/herald/typeahead/HeraldRuleDatasource.php:25]
  #2 <#2> HeraldRuleDatasource::loadResults() called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php:142]
  #3 <#2> PhabricatorTypeaheadDatasource::loadResultsForPhase(string, integer) called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php:136]
  #4 <#2> PhabricatorTypeaheadCompositeDatasource::loadResultsForPhase(string, integer) called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php:48]
  #5 <#2> PhabricatorTypeaheadCompositeDatasource::loadResults() called at [<phorge>/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:91]
  #6 <#2> PhabricatorTypeaheadModularDatasourceController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #7 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #8 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #9 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #10 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #11 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
[2023-05-26 21:26:24] 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: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=master, ref.master=0e32dbc1ac8f), phorge(head=diffusionRepoPage, ref.master=5405134fa5db, ref.diffusionRepoPage=dbe5e3a68c41)
  #0 <#4> preg_match(string, NULL) called at [<phorge>/src/applications/herald/typeahead/HeraldRuleDatasource.php:25]
  #1 <#4> HeraldRuleDatasource::loadResults() called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php:142]
  #2 <#4> PhabricatorTypeaheadDatasource::loadResultsForPhase(string, integer) called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php:136]
  #3 <#4> PhabricatorTypeaheadCompositeDatasource::loadResultsForPhase(string, integer) called at [<phorge>/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php:48]
  #4 <#4> PhabricatorTypeaheadCompositeDatasource::loadResults() called at [<phorge>/src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php:91]
  #5 <#4> PhabricatorTypeaheadModularDatasourceController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #7 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #8 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #9 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #10 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #11 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #12 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #13 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #14 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #15 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #16 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #17 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #18 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #19 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #20 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #21 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

Fix that exception; afterwards Browse Herald Rules overlay dialog is correctly rendered in web browser, listing available Herald rules.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.