Page MenuHomePhorge

Clicking "Clone" in a Diffusion repo gives an error
Open, Needs TriagePublic

Description

  • Create and activate a new git repo
  • Click "Clone"
  • Nothing happens, an error is logged in the browser console. Server-side, I get the following:
Oct 27 13:06:34 phorge nginx[4443]: 2023/10/27 13:06:34 [error] 4443#4443: *1 FastCGI sent in stderr: "PHP message: [2023-10-27 11:06:34] ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/nix/store/9bxi6wilm3f03hps7avsqj8cx4cslsh9-phorge-unstable-2023-09-28/phorge/src/applications/repository/storage/PhabricatorRepository.php:348]; PHP message: arcanist(head=master, ref.master=98d16d27cf3e), phorge(head=master, ref.master=d4b110af260c); PHP message:   #0 PhabricatorRepository::getCloneName() called at [<phorge>/src/applications/repository/storage/PhabricatorRepositoryURI.php:409]; PHP message:   #1 PhabricatorRepositoryURI::getForcedPath() called at [<phorge>/src/applications/repository/storage/PhabricatorRepositoryURI.php:303]; PHP message:   #2 PhabricatorRepositoryURI::getURIObject() called at [<phorge>/src/applications/repository/storage/PhabricatorRepositoryURI.php:218]; PHP message:   #3 PhabricatorRepositoryURI::getDisplayURI() called at [<phorge>/src/applications/diffusion/controller/DiffusionCloneController.php:107]; PHP message:   #4 DiffusionCloneController::renderCloneURI(PhabricatorRepository, PhabricatorRepositoryURI) called at [<phorge>/src/applications/diffusion/controller/DiffusionCloneController.php:43]; PHP message:   #5 DiffusionCloneController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]; PHP message:   #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]; PHP message:   #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]; PHP message: [2023-10-27 11:06:34] ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/nix/store/9bxi6wilm3f03hps7avsqj8cx4cslsh9-phorge-unstable-2023-09-28/phorge/src/applications/repository/storage/PhabricatorRepository.php:348]; PHP
Oct 27 13:06:34 phorge nginx[4443]: 2023/10/27 13:06:34 [error] 4443#4443: *1 upstream sent too big header while reading response header from upstream, client: 10.233.5.1, server: phorge-dev.local, request: "POST /diffusion/1/clone/ HTTP/2.0", upstream: "fastcgi://unix:/run/phpfpm/phorge.sock:", host: "phorge-dev.local"

The button worked in 03afb97ff20bd5480ecfa0fa809e3b751bd973e8 but fails in 71b273a622

Event Timeline

fgaz closed this task as Invalid.EditedOct 27 2023, 11:22

Nevermind, this is a problem with my setup, sorry for the noise. (I missed the second line, and of course I realized it right after submitting)

valerio.bozzolan edited projects, added PHP 8 support; removed Phorge.
valerio.bozzolan subscribed.

Thanks for reporting

I think that you already discovered that PHP 8.1 at the moment is not supported and you just adopted PHP 7.4 or something similar I think to fix,

but, don't worry, that is not your fault, and this is still an interesting and useful but report that deserves a fix sooner or later.

For instance, probably this should not use a strlen() to verify if the string is empty:

https://we.phorge.it/source/phorge/browse/master/src/applications/repository/storage/PhabricatorRepository.php;849e18ccbbea99643f51a8ee300446a42f61b418$343-348

Feel free to keep this open so somebody may decide to apply a fix, like replacing strlen() with phutil_nonempty_str() or something similar

you just adopted PHP 7.4 or something similar I think to fix

I actually am still running php 8. strlen() wasn't the problem, since it was turned into a nonfatal error in D25386 and D25387. The problem was in the last line "too big header" (maybe because the error log ended up in the headers somehow?), which I fixed by expanding the fastcgi buffers.

Makes sense to fix the error though, I'll keep this open