Page MenuHomePhorge

PHP 8.1 "strlen(null)" exception blocks rendering Upload SSH Public key settings dialog
Closed, ResolvedPublic

Description

  1. PHP 8.1.8, D25144, D25145, D25146, D25147, D25151, D25152, D25153 locally applied
  2. Go to http://phorge.localhost/settings/panel/ssh/
  3. Select SSH Key Actions dropdown on the right
  4. Select Upload Public Key to go to http://phorge.localhost/auth/sshkey/upload/?objectPHID=PHID-USER-123456789abcdef01234
[2023-04-30 18:05:40] 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=82d1abd4edd1), phorge(head=D25161, ref.master=5a0d82df7f86, ref.D25161=5a0d82df7f86)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/auth/controller/PhabricatorAuthSSHKeyEditController.php:57]
  #1 <#2> PhabricatorAuthSSHKeyEditController::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:204]
  #6 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix that code line, get the Upload SSH Public Key dialog rendered in web browser.

Note: Three lines later the same logic applies to $e_key but I have not been able to somehow trigger an exception for that one.