Page MenuHomePhorge

PHP 8.1 "json_decode(null)" exception blocks creating Almanac Hosts blueprint in Drydock
Open, Needs TriagePublic

Description

  1. PHP 8.2.6; Phorge at b1edfea09bad48c267b547918e82d6de43298781
  2. Go to Drydock at http://phorge.localhost/drydock/
  3. Select Blueprints to go to http://phorge.localhost/drydock/blueprint/
  4. Select Create Blueprint in upper right corner to go to http://phorge.localhost/drydock/blueprint/edit/form/default/
  5. Under Blueprint Type, select Almanac Hosts
  6. Select Continue button to go to http://phorge.localhost/drydock/blueprint/edit/form/default/
[2023-05-21 08:10:39] EXCEPTION: (RuntimeException) json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=e4fd31ec024e), phorge(head=master, ref.master=10fae71a042f)
  #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:895]
  #3 <#2> PhabricatorCustomField::setValueFromApplicationTransactions(NULL) called at [<phorge>/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php:70]
  #4 <#2> PhabricatorCustomFieldEditField::buildControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:376]
  #5 <#2> PhabricatorEditField::renderControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:406]
  #6 <#2> PhabricatorEditField::appendToForm(AphrontFormView) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1386]
  #7 <#2> PhabricatorEditEngine::buildEditForm(DrydockBlueprint, array) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1242]
  #8 <#2> PhabricatorEditEngine::buildEditResponse(DrydockBlueprint) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1000]
  #9 <#2> PhabricatorEditEngine::buildResponse() called at [<phorge>/src/applications/drydock/controller/DrydockBlueprintEditController.php:26]
  #10 <#2> DrydockBlueprintEditController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #11 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #12 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #13 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #14 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

[2023-05-21 08:10:39] 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=master, ref.master=e4fd31ec024e), phorge(head=master, ref.master=10fae71a042f)
  #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:895]
  #2 <#4> PhabricatorCustomField::setValueFromApplicationTransactions(NULL) called at [<phorge>/src/infrastructure/customfield/editor/PhabricatorCustomFieldEditField.php:70]
  #3 <#4> PhabricatorCustomFieldEditField::buildControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:376]
  #4 <#4> PhabricatorEditField::renderControl() called at [<phorge>/src/applications/transactions/editfield/PhabricatorEditField.php:406]
  #5 <#4> PhabricatorEditField::appendToForm(AphrontFormView) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1386]
  #6 <#4> PhabricatorEditEngine::buildEditForm(DrydockBlueprint, array) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1242]
  #7 <#4> PhabricatorEditEngine::buildEditResponse(DrydockBlueprint) called at [<phorge>/src/applications/transactions/editengine/PhabricatorEditEngine.php:1000]
  #8 <#4> PhabricatorEditEngine::buildResponse() called at [<phorge>/src/applications/drydock/controller/DrydockBlueprintEditController.php:26]
  #9 <#4> DrydockBlueprintEditController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #10 <#3> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
  #11 <#3> file_exists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1068]
  #12 <#3> Filesystem::pathExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1169]
  #13 <#3> Filesystem::assertExists(NULL) called at [<arcanist>/src/filesystem/Filesystem.php:1020]
  #14 <#3> Filesystem::isDescendant(NULL, string) called at [<phorge>/src/view/widget/AphrontStackTraceView.php:33]
  #15 <#3> AphrontStackTraceView::render() called at [<phorge>/src/view/AphrontView.php:222]
  #16 <#3> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
  #17 <#3> phutil_escape_html(AphrontStackTraceView) called at [<phorge>/src/infrastructure/markup/render.php:139]
  #18 <#3> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
  #19 <#3> phutil_tag(string, array, array) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:62]
  #20 <#3> PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #21 <#3> AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #22 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #23 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]
  #24 phlog(PhutilAggregateException) called at [<phorge>/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
  #25 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [<phorge>/webroot/index.php:46]

Event Timeline

For the records, the part in src/applications/passphrase/view/PassphraseCredentialControl.php is also triggered when setting a URI for a Diffusion repository and then trying to "Set Credential" via /diffusion/1/uri/credential/123/edit/. Should probably split that out into a separate task and patch to make progress.

Edit: Split into T15580: PHP 8.1 "strlen(null)" exception setting Passphrase Credential.