Page MenuHomePhorge

Numerous PHP 8.1 "strlen(null)" exceptions trying to create a project
Closed, ResolvedPublic

Description

  1. Fedora 37, PHP 8.1.8
  2. Go to http://phorge.localhost/project/edit/form/default/
  3. Fill in some stuff
  4. Press "Create New Project" button
[2023-04-28 16:10:17] 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=master, ref.master=74dfe6f971af)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:620]
  #1 <#2> PhabricatorApplicationTransactionEditor::getTransactionNewValue(PhabricatorProject, PhabricatorProjectTransaction) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3248]
  #2 <#2> PhabricatorApplicationTransactionEditor::adjustObjectForPolicyChecks(PhabricatorProject, array) called at [<phorge>/src/applications/project/editor/PhabricatorProjectTransactionEditor.php:334]
  #3 <#2> PhabricatorProjectTransactionEditor::adjustObjectForPolicyChecks(PhabricatorProject, array) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3048]
  #4 <#2> PhabricatorApplicationTransactionEditor::validatePolicyTransaction(PhabricatorProject, array, string, string) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2880]
  #5 <#2> PhabricatorApplicationTransactionEditor::validateTransaction(PhabricatorProject, string, array) called at [<phorge>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1235]
  #6 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(PhabricatorProject, array) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1149]
  #7 <#2> PhabricatorEditEngine::buildEditResponse(PhabricatorProject) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1000]
  #8 <#2> PhabricatorEditEngine::buildResponse() called at [<phorge>/src/applications/project/controller/PhabricatorProjectEditController.php:91]
  #9 <#2> PhabricatorProjectEditController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #11 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #12 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #13 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #14 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix issue by replacing strlen with phutil_nonempty_string, then get:

[2023-04-28 16:13:27] 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=master, ref.master=74dfe6f971af)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php:41]
  #1 <#2> PhabricatorProjectWorkboardProfileMenuItem::getDisplayName(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectWorkboardProfileMenuItem.php:65]
  #2 <#2> PhabricatorProjectWorkboardProfileMenuItem::newMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/menuitem/PhabricatorProfileMenuItem.php:77]
  #3 <#2> PhabricatorProfileMenuItem::getMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php:129]
  #4 <#2> PhabricatorProfileMenuItemConfiguration::getMenuItemViewList() called at [<phorge>/src/applications/search/engine/PhabricatorProfileMenuEngine.php:1293]
  #5 <#2> PhabricatorProfileMenuEngine::newProfileMenuItemViewList() called at [<phorge>/src/applications/project/controller/PhabricatorProjectController.php:212]
  #6 <#2> PhabricatorProjectController::newNavigation(PhabricatorProject, string) called at [<phorge>/src/applications/project/controller/PhabricatorProjectManageController.php:42]
  #7 <#2> PhabricatorProjectManageController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/AphrontController.php:71]
  #8 <#2> AphrontController::delegateToController(PhabricatorProjectManageController) called at [<phorge>/src/applications/project/controller/PhabricatorProjectViewController.php:45]
  #9 <#2> PhabricatorProjectViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #11 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #12 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #13 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #14 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix issue by replacing strlen with phutil_nonempty_string, then get:

[2023-04-28 16:15:09] 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=master, ref.master=74dfe6f971af)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectMembersProfileMenuItem.php:24]
  #1 <#2> PhabricatorProjectMembersProfileMenuItem::getDisplayName(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectMembersProfileMenuItem.php:49]
  #2 <#2> PhabricatorProjectMembersProfileMenuItem::newMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/menuitem/PhabricatorProfileMenuItem.php:77]
  #3 <#2> PhabricatorProfileMenuItem::getMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php:129]
  #4 <#2> PhabricatorProfileMenuItemConfiguration::getMenuItemViewList() called at [<phorge>/src/applications/search/engine/PhabricatorProfileMenuEngine.php:1293]
  #5 <#2> PhabricatorProfileMenuEngine::newProfileMenuItemViewList() called at [<phorge>/src/applications/project/controller/PhabricatorProjectController.php:212]
  #6 <#2> PhabricatorProjectController::newNavigation(PhabricatorProject, string) called at [<phorge>/src/applications/project/controller/PhabricatorProjectManageController.php:42]
  #7 <#2> PhabricatorProjectManageController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/AphrontController.php:71]
  #8 <#2> AphrontController::delegateToController(PhabricatorProjectManageController) called at [<phorge>/src/applications/project/controller/PhabricatorProjectViewController.php:45]
  #9 <#2> PhabricatorProjectViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #11 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #12 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #13 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #14 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix issue by replacing strlen with phutil_nonempty_string, then get:

[2023-04-28 16:16:52] 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=master, ref.master=74dfe6f971af)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php:32]
  #1 <#2> PhabricatorProjectSubprojectsProfileMenuItem::getDisplayName(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php:56]
  #2 <#2> PhabricatorProjectSubprojectsProfileMenuItem::newMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/menuitem/PhabricatorProfileMenuItem.php:77]
  #3 <#2> PhabricatorProfileMenuItem::getMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php:129]
  #4 <#2> PhabricatorProfileMenuItemConfiguration::getMenuItemViewList() called at [<phorge>/src/applications/search/engine/PhabricatorProfileMenuEngine.php:1293]
  #5 <#2> PhabricatorProfileMenuEngine::newProfileMenuItemViewList() called at [<phorge>/src/applications/project/controller/PhabricatorProjectController.php:212]
  #6 <#2> PhabricatorProjectController::newNavigation(PhabricatorProject, string) called at [<phorge>/src/applications/project/controller/PhabricatorProjectManageController.php:42]
  #7 <#2> PhabricatorProjectManageController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/AphrontController.php:71]
  #8 <#2> AphrontController::delegateToController(PhabricatorProjectManageController) called at [<phorge>/src/applications/project/controller/PhabricatorProjectViewController.php:45]
  #9 <#2> PhabricatorProjectViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #11 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #12 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #13 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #14 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix issue by replacing strlen with phutil_nonempty_string, then get:

[2023-04-28 16:18:31] 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=master, ref.master=74dfe6f971af)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectManageProfileMenuItem.php:34]
  #1 <#2> PhabricatorProjectManageProfileMenuItem::getDisplayName(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/project/menuitem/PhabricatorProjectManageProfileMenuItem.php:59]
  #2 <#2> PhabricatorProjectManageProfileMenuItem::newMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/menuitem/PhabricatorProfileMenuItem.php:77]
  #3 <#2> PhabricatorProfileMenuItem::getMenuItemViewList(PhabricatorProfileMenuItemConfiguration) called at [<phorge>/src/applications/search/storage/PhabricatorProfileMenuItemConfiguration.php:129]
  #4 <#2> PhabricatorProfileMenuItemConfiguration::getMenuItemViewList() called at [<phorge>/src/applications/search/engine/PhabricatorProfileMenuEngine.php:1293]
  #5 <#2> PhabricatorProfileMenuEngine::newProfileMenuItemViewList() called at [<phorge>/src/applications/project/controller/PhabricatorProjectController.php:212]
  #6 <#2> PhabricatorProjectController::newNavigation(PhabricatorProject, string) called at [<phorge>/src/applications/project/controller/PhabricatorProjectManageController.php:42]
  #7 <#2> PhabricatorProjectManageController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/AphrontController.php:71]
  #8 <#2> AphrontController::delegateToController(PhabricatorProjectManageController) called at [<phorge>/src/applications/project/controller/PhabricatorProjectViewController.php:45]
  #9 <#2> PhabricatorProjectViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #11 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #12 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #13 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
  #14 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix issue by replacing strlen with phutil_nonempty_string, finally get http://phorge.localhost/project/view/1/ rendered in web browser.

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.