Page MenuHomePhorge

PHP 8.1 "strlen(null)" exceptions rendering Maniphest task when custom select field configured
Closed, ResolvedPublic

Description

  1. PHP 8.2.13, Phorge at 99ee9357eff29f450526607cabec9ec557cfdec3
  2. Have an older Phabricator database on that system which has a "select" type custom field defined under http://phorge.localhost/config/edit/maniphest.custom-field-definitions/ , for example:
{
  "risk.rating": {
    "name": "Risk Rating",
    "search": true,
    "type": "select",
    "options": {
      "": "N/A",
      "info": "Informational",
      "low": "Low",
      "medium": "Medium",
      "high": "High",
      "crit": "Critical"
    }
  }
}
  1. Install most recent Phorge on that machine and configure it to access that database (and run ./bin/storage upgrade if required)
  2. Try to access T1.
[2023-12-05 02:37:23] EXCEPTION: (RuntimeException) json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=arcpatch-D25374, ref.master=25611ba24add, ref.arcpatch-D25374=e0a29d0df650), phorge(head=master, ref.master=99ee9357eff2)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #1 <#2> json_decode(NULL, boolean) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php:44]
  #2 <#2> PhabricatorStandardCustomFieldPHIDs::setValueFromStorage(NULL) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:609]
  #3 <#2> PhabricatorCustomField::setValueFromStorage(NULL) called at [<phorge>/src/infrastructure/customfield/query/PhabricatorCustomFieldStorageQuery.php:78]
  #4 <#2> PhabricatorCustomFieldStorageQuery::loadFieldsFromStorage(ManiphestCustomFieldStorage, array) called at [<phorge>/src/infrastructure/customfield/query/PhabricatorCustomFieldStorageQuery.php:47]
  #5 <#2> PhabricatorCustomFieldStorageQuery::execute() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php:60]
  #6 <#2> PhabricatorCustomFieldList::readFieldsFromStorage(ManiphestTask) called at [<phorge>/src/applications/maniphest/controller/ManiphestTaskDetailController.php:27]
  #7 <#2> ManiphestTaskDetailController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #8 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #9 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #10 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #11 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #12 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
[2023-12-05 02:37:23] EXCEPTION: (PhutilAggregateException) Encountered a processing exception, then another exception when trying to build a response for the first exception.
    - RuntimeException: file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
    - RuntimeException: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:316]
arcanist(head=arcpatch-D25374, ref.master=25611ba24add, ref.arcpatch-D25374=e0a29d0df650), phorge(head=master, ref.master=99ee9357eff2)
  #0 <#4> json_decode(NULL, boolean) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php:44]
  #1 <#4> PhabricatorStandardCustomFieldPHIDs::setValueFromStorage(NULL) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:609]
  #2 <#4> PhabricatorCustomField::setValueFromStorage(NULL) called at [<phorge>/src/infrastructure/customfield/query/PhabricatorCustomFieldStorageQuery.php:78]
  #3 <#4> PhabricatorCustomFieldStorageQuery::loadFieldsFromStorage(ManiphestCustomFieldStorage, array) called at [<phorge>/src/infrastructure/customfield/query/PhabricatorCustomFieldStorageQuery.php:47]
  #4 <#4> PhabricatorCustomFieldStorageQuery::execute() called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php:60]
  #5 <#4> PhabricatorCustomFieldList::readFieldsFromStorage(ManiphestTask) called at [<phorge>/src/applications/maniphest/controller/ManiphestTaskDetailController.php:27]
  #6 <#4> ManiphestTaskDetailController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #7 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #8 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #9 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #10 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #11 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #12 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #13 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #14 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #15 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #16 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #17 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #18 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #19 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #20 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #21 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #22 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

Fix issue, run into next exception:

[2023-12-05 02:38:58] EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=arcpatch-D25374, ref.master=25611ba24add, ref.arcpatch-D25374=e0a29d0df650), phorge(head=master, ref.master=99ee9357eff2)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldSelect.php:76]
  #1 <#2> PhabricatorStandardCustomFieldSelect::renderPropertyViewValue(array) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomField.php:1301]
  #2 <#2> PhabricatorCustomField::renderPropertyViewValue(array) called at [<phorge>/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php:159]
  #3 <#2> PhabricatorCustomFieldList::appendFieldsToPropertyList(ManiphestTask, PhabricatorUser, PHUIPropertyListView) called at [<phorge>/src/applications/maniphest/controller/ManiphestTaskDetailController.php:396]
  #4 <#2> ManiphestTaskDetailController::buildPropertyView(ManiphestTask, PhabricatorCustomFieldList, array, PhabricatorHandleList) called at [<phorge>/src/applications/maniphest/controller/ManiphestTaskDetailController.php:68]
  #5 <#2> ManiphestTaskDetailController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #7 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #8 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Event Timeline

aklapper renamed this task from PHP 8.1 "strlen(null)" exceptions rendering Maniphest task when custom text field configured to PHP 8.1 "strlen(null)" exceptions rendering Maniphest task when custom select field configured.Dec 5 2023, 03:05
aklapper updated the task description. (Show Details)