Page MenuHomePhorge

PHP 8.1 "strlen(null)" exception initializing Diffusion repository without path access permissions
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. PHP 8.2.7; Phorge at bab99707405585911ca0e07d52d7117acd08fbcc
  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 with permissions that only the root user can access that directory and not Phorge
  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 gitRepo
  8. Select the Create Repository button
  9. Go to http://phorge.localhost/diffusion/17/manage/
  10. Select Activate Repository in the left panel (while no directory exists for this code repository)
  11. Look at the Working Copy Status section on http://phorge.localhost/diffusion/17/manage/

Actual outcome:

Initialization Error
Pull of 'R17' failed: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Raw Error
Error updating working copy: strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Expected outcome:

Initialization Error
Pull of 'R17' failed: Command failed with error #128! COMMAND git init --bare -- /var/repo/17 STDOUT (empty) STDERR fatal: cannot mkdir /var/repo/17: Permission denied

Raw Error
Error updating working copy: Command failed with error #128!
COMMAND
git init --bare -- /var/repo/17

STDOUT
(empty)

STDERR
fatal: cannot mkdir /var/repo/17: Permission denied

Other comments:
No stacktrace as nothing is in the error log, thus I temporarily edited src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php to print $ex->getExceptionTrace()) in the UI to find the line to fix.

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.