Page MenuHomePhorge

PHP 8.1 "strlen(null)" exceptions trying to browse Diffusion repository history
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. PHP 8.2.7; Phorge at 108cbcd09bd39fda0ad24a2ee25afe5aac230e08
  2. Check that http://phorge.localhost/config/edit/repository.default-local-path/ is set to default /var/repo/
  3. Make sure that /var/repo/ exists locally
  4. As a Phorge admin, go to Diffusion at http://phorge.localhost/diffusion/
  5. Select Create Repository in upper right corner to go to http://phorge.localhost/diffusion/edit/form/default/
  6. Select "Create Git Repository" to go to http://phorge.localhost/diffusion/edit/form/default/?vcs=git
  7. On the Create Repository page, in the Name field, enter gitRepoEmpty
  8. Select the Create Repository button
  9. End up on http://phorge.localhost/diffusion/19/manage/
  10. Select Activate Repository in the left panel (while no directory exists for this code repository)
  11. Wait a minute for daemons to create the repository
  12. In a terminal, go to now existing /var/repo/19/
  13. In a terminal, run git init
  14. In a terminal, run git checkout -b master
  15. In a terminal, run touch newFile
  16. In a terminal, run git add newFile
  17. In a terminal, run git commit -m "first commit" newFile
  18. In the browser, on http://phorge.localhost/diffusion/19/manage/ , select on the right Update Now and select Schedule Update button
  19. In the browser, go to http://phorge.localhost/diffusion/19/
  20. Select the History tab to go to http://phorge.localhost/diffusion/19/history/master/
[2023-06-12 00:28:05] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=97e163187418), phorge(head=diffusionBrowseCode, ref.master=108cbcd09bd3, ref.diffusionBrowseCode=015ffef14b0c)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:50]
  #1 <#2> DiffusionHistoryQueryConduitAPIMethod::getGitResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:155]
  #2 <#2> DiffusionQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:35]
  #3 <#2> DiffusionHistoryQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:110]
  #4 <#2> DiffusionQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156]
  #5 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131]
  #6 <#2> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81]
  #7 <#2> ConduitCall::execute() called at [<arcanist>/src/future/MethodCallFuture.php:30]
  #8 <#2> MethodCallFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
  #9 <#2> Future::updateFuture() called at [<arcanist>/src/future/Future.php:159]
  #10 <#2> Future::start() called at [<arcanist>/src/future/FutureIterator.php:403]
  #11 <#2> FutureIterator::moveFutureToWork(integer) called at [<arcanist>/src/future/FutureIterator.php:374]
  #12 <#2> FutureIterator::updateWorkingSet() called at [<arcanist>/src/future/FutureIterator.php:206]
  #13 <#2> FutureIterator::next() called at [<arcanist>/src/future/FutureIterator.php:190]
  #14 <#2> FutureIterator::rewind()
  #15 <#2> iterator_to_array(FutureIterator) called at [<arcanist>/src/future/FutureIterator.php:84]
  #16 <#2> FutureIterator::resolveAll() called at [<arcanist>/src/future/Future.php:47]
  #17 <#2> Future::resolve() called at [<phorge>/src/applications/diffusion/query/DiffusionQuery.php:83]
  #18 <#2> DiffusionQuery::callConduitWithDiffusionRequest(PhabricatorUser, DiffusionGitRequest, string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionController.php:241]
  #19 <#2> DiffusionController::callConduitWithDiffusionRequest(string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionHistoryController.php:30]
  #20 <#2> DiffusionHistoryController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #21 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #22 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #23 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #24 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #25 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
[2023-06-12 00:28:05] 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: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=master, ref.master=97e163187418), phorge(head=diffusionBrowseCode, ref.master=108cbcd09bd3, ref.diffusionBrowseCode=015ffef14b0c)
  #0 <#4> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:50]
  #1 <#4> DiffusionHistoryQueryConduitAPIMethod::getGitResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:155]
  #2 <#4> DiffusionQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:35]
  #3 <#4> DiffusionHistoryQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:110]
  #4 <#4> DiffusionQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156]
  #5 <#4> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131]
  #6 <#4> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81]
  #7 <#4> ConduitCall::execute() called at [<arcanist>/src/future/MethodCallFuture.php:30]
  #8 <#4> MethodCallFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
  #9 <#4> Future::updateFuture() called at [<arcanist>/src/future/Future.php:159]
  #10 <#4> Future::start() called at [<arcanist>/src/future/FutureIterator.php:403]
  #11 <#4> FutureIterator::moveFutureToWork(integer) called at [<arcanist>/src/future/FutureIterator.php:374]
  #12 <#4> FutureIterator::updateWorkingSet() called at [<arcanist>/src/future/FutureIterator.php:206]
  #13 <#4> FutureIterator::next() called at [<arcanist>/src/future/FutureIterator.php:190]
  #14 <#4> FutureIterator::rewind()
  #15 <#4> iterator_to_array(FutureIterator) called at [<arcanist>/src/future/FutureIterator.php:84]
  #16 <#4> FutureIterator::resolveAll() called at [<arcanist>/src/future/Future.php:47]
  #17 <#4> Future::resolve() called at [<phorge>/src/applications/diffusion/query/DiffusionQuery.php:83]
  #18 <#4> DiffusionQuery::callConduitWithDiffusionRequest(PhabricatorUser, DiffusionGitRequest, string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionController.php:241]
  #19 <#4> DiffusionController::callConduitWithDiffusionRequest(string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionHistoryController.php:30]
  #20 <#4> DiffusionHistoryController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #21 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #22 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #23 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #24 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #25 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #26 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #27 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #28 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #29 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #30 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #31 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #32 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #33 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #34 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #35 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #36 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

After fixing, get next exception:

[2023-06-12 00:29:41] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=97e163187418), phorge(head=diffusionBrowseHistory, ref.master=108cbcd09bd3, ref.diffusionBrowseHistory=108cbcd09bd3)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:57]
  #1 <#2> DiffusionHistoryQueryConduitAPIMethod::getGitResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:155]
  #2 <#2> DiffusionQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:35]
  #3 <#2> DiffusionHistoryQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:110]
  #4 <#2> DiffusionQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156]
  #5 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131]
  #6 <#2> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81]
  #7 <#2> ConduitCall::execute() called at [<arcanist>/src/future/MethodCallFuture.php:30]
  #8 <#2> MethodCallFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
  #9 <#2> Future::updateFuture() called at [<arcanist>/src/future/Future.php:159]
  #10 <#2> Future::start() called at [<arcanist>/src/future/FutureIterator.php:403]
  #11 <#2> FutureIterator::moveFutureToWork(integer) called at [<arcanist>/src/future/FutureIterator.php:374]
  #12 <#2> FutureIterator::updateWorkingSet() called at [<arcanist>/src/future/FutureIterator.php:206]
  #13 <#2> FutureIterator::next() called at [<arcanist>/src/future/FutureIterator.php:190]
  #14 <#2> FutureIterator::rewind()
  #15 <#2> iterator_to_array(FutureIterator) called at [<arcanist>/src/future/FutureIterator.php:84]
  #16 <#2> FutureIterator::resolveAll() called at [<arcanist>/src/future/Future.php:47]
  #17 <#2> Future::resolve() called at [<phorge>/src/applications/diffusion/query/DiffusionQuery.php:83]
  #18 <#2> DiffusionQuery::callConduitWithDiffusionRequest(PhabricatorUser, DiffusionGitRequest, string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionController.php:241]
  #19 <#2> DiffusionController::callConduitWithDiffusionRequest(string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionHistoryController.php:30]
  #20 <#2> DiffusionHistoryController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #21 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #22 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #23 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #24 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #25 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
[2023-06-12 00:29:41] 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: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=master, ref.master=97e163187418), phorge(head=diffusionBrowseHistory, ref.master=108cbcd09bd3, ref.diffusionBrowseHistory=108cbcd09bd3)
  #0 <#4> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:57]
  #1 <#4> DiffusionHistoryQueryConduitAPIMethod::getGitResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:155]
  #2 <#4> DiffusionQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php:35]
  #3 <#4> DiffusionHistoryQueryConduitAPIMethod::getResult(ConduitAPIRequest) called at [<phorge>/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php:110]
  #4 <#4> DiffusionQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156]
  #5 <#4> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131]
  #6 <#4> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81]
  #7 <#4> ConduitCall::execute() called at [<arcanist>/src/future/MethodCallFuture.php:30]
  #8 <#4> MethodCallFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
  #9 <#4> Future::updateFuture() called at [<arcanist>/src/future/Future.php:159]
  #10 <#4> Future::start() called at [<arcanist>/src/future/FutureIterator.php:403]
  #11 <#4> FutureIterator::moveFutureToWork(integer) called at [<arcanist>/src/future/FutureIterator.php:374]
  #12 <#4> FutureIterator::updateWorkingSet() called at [<arcanist>/src/future/FutureIterator.php:206]
  #13 <#4> FutureIterator::next() called at [<arcanist>/src/future/FutureIterator.php:190]
  #14 <#4> FutureIterator::rewind()
  #15 <#4> iterator_to_array(FutureIterator) called at [<arcanist>/src/future/FutureIterator.php:84]
  #16 <#4> FutureIterator::resolveAll() called at [<arcanist>/src/future/Future.php:47]
  #17 <#4> Future::resolve() called at [<phorge>/src/applications/diffusion/query/DiffusionQuery.php:83]
  #18 <#4> DiffusionQuery::callConduitWithDiffusionRequest(PhabricatorUser, DiffusionGitRequest, string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionController.php:241]
  #19 <#4> DiffusionController::callConduitWithDiffusionRequest(string, array) called at [<phorge>/src/applications/diffusion/controller/DiffusionHistoryController.php:30]
  #20 <#4> DiffusionHistoryController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #21 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #22 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #23 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #24 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #25 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #26 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #27 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #28 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #29 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #30 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #31 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #32 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #33 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #34 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #35 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #36 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

After fixing, get next expected exceptions (thus not to be handled in this task) about RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated and CommandException: Command failed with error #128! fatal: detected dubious ownership in repository at '/var/repo/19'

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.