Page MenuHomePhorge

PHP 8.1 "strlen(null)" exception when Diffusion repository has no tags
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 Tags tab to go to http://phorge.localhost/diffusion/19/tags/master/
[2023-06-12 00:00:04] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=diffusionEmptyRepoPatternSearch, ref.master=97e163187418, ref.diffusionEmptyRepoPatternSearch=97e163187418), phorge(head=master, ref.master=108cbcd09bd3)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/diffusion/controller/DiffusionTagListController.php:28]
  #1 <#2> DiffusionTagListController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #2 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #3 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #4 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #5 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #6 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

After fixing, get the expected CommandException: Command failed with error #128! due to fatal: detected dubious ownership in repository at '/var/repo/19' (plus a RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated as a bonus).

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.