Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception inCelerityResourceController to make CSS/JS load
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Install Phorge on a freshly set up Fedora 37 machine with PHP 8.1.18 installed; no existing previous MariaDB database.
  2. Apply patch from T15279/D25137

Actual outcome:

Get no CSS applied in web browser:

Screenshot from 2023-04-27 09-56-42.png (974×1 px, 254 KB)

[27-Apr-2023 07:53:36 UTC] [2023-04-27 07:53:36] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
[27-Apr-2023 07:53:36 UTC] arcanist(head=master, ref.master=82d1abd4edd1), phorge(head=T15279, ref.master=7b080db57c5b, ref.T15279=706064d0f127)
[27-Apr-2023 07:53:36 UTC]   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/celerity/controller/CelerityResourceController.php:116]
[27-Apr-2023 07:53:36 UTC]   #1 <#2> CelerityResourceController::serveResource(array) called at [<phorge>/src/applications/celerity/controller/CelerityPhabricatorResourceController.php:37]
[27-Apr-2023 07:53:36 UTC]   #2 <#2> CelerityPhabricatorResourceController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
[27-Apr-2023 07:53:36 UTC]   #3 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
[27-Apr-2023 07:53:36 UTC]   #4 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.p
hp:751]
[27-Apr-2023 07:53:36 UTC]   #5 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
[27-Apr-2023 07:53:36 UTC]   #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontAppl
icationConfiguration.php:204]
[27-Apr-2023 07:53:36 UTC]   #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Expected outcome:

Screenshot from 2023-04-27 09-56-52.png (974×1 px, 151 KB)

Event Timeline

(Thanks for the copy paste of the stack trace. I like that since it's really easy to find that from search engines)

By the way I don't know why you receive an error 500 for the favicon :) Maybe that deserves a separated troubleshooting

By the way I don't know why you receive an error 500 for the favicon :) Maybe that deserves a separated troubleshooting

One thing at a time, plus I'm only here in my free time. :) First need to make Phorge basically work and render on PHP 8.1/8.2; there's still lots of issues.
And AFAIK Debian 12 (Bookworm) will be out in June 2023 including PHP 8.2.

Same and I agree on your concerns

In my opinion Phorge should not escalate any deprecation warning to a nuclear nuke, and should just log these instead. But in not bold enough for that change. In the meanwhile, these fixes are really appreciated.