Page MenuHomePhorge

PHP 8.1 "strlen(null)" exceptions block rendering page of a File
Closed, ResolvedPublic

Description

  1. PHP 8.2.5; Phorge at`8eaa7c1ccf3d75d438e83e074a28ea7de1f15d37`
  2. Go to http://phorge.localhost/file/
  3. Select Upload File in upper right corner to go to http://phorge.localhost/file/upload/
  4. Select Browse... button
  5. Select some local JPEG file
  6. Leave the Name field empty
  7. Select Upload button
  8. File gets successfully uploaded but an exception is shown in the UI:
[2023-05-04 11:33:03] 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=d47289622650), phorge(head=uploadFile, ref.master=8eaa7c1ccf3d, ref.uploadFile=8eaa7c1ccf3d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:314]
  #1 <#2> PhabricatorFileViewController::buildPropertyViews(PHUIObjectBoxView, PhabricatorFile) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:74]
  #2 <#2> PhabricatorFileViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #3 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #4 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #5 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix that exception; get next exception:

[2023-05-04 11:34:41] 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=d47289622650), phorge(head=uploadFile, ref.master=8eaa7c1ccf3d, ref.uploadFile=8eaa7c1ccf3d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:63]
  #1 <#2> PhabricatorDocumentRenderingEngine::newDocumentView(PhabricatorDocumentRef) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:413]
  #2 <#2> PhabricatorFileViewController::newFileContent(PhabricatorFile) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:77]
  #3 <#2> PhabricatorFileViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #4 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #5 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #6 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #7 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #8 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix that exception; get next exception:

[2023-05-04 11:35:43] 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=d47289622650), phorge(head=uploadFile, ref.master=8eaa7c1ccf3d, ref.uploadFile=8eaa7c1ccf3d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:68]
  #1 <#2> PhabricatorDocumentRenderingEngine::newDocumentView(PhabricatorDocumentRef) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:413]
  #2 <#2> PhabricatorFileViewController::newFileContent(PhabricatorFile) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:77]
  #3 <#2> PhabricatorFileViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #4 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #5 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #6 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #7 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #8 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Fix that exception; get next exception:

[2023-05-04 11:36:34] 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=d47289622650), phorge(head=uploadFile, ref.master=8eaa7c1ccf3d, ref.uploadFile=8eaa7c1ccf3d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/files/storage/PhabricatorFile.php:1281]
  #1 <#2> PhabricatorFile::getAltText() called at [<phorge>/src/applications/files/document/PhabricatorImageDocumentEngine.php:133]
  #2 <#2> PhabricatorImageDocumentEngine::newDocumentContent(PhabricatorDocumentRef) called at [<phorge>/src/applications/files/document/PhabricatorDocumentEngine.php:133]
  #3 <#2> PhabricatorDocumentEngine::newDocument(PhabricatorDocumentRef) called at [<phorge>/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php:117]
  #4 <#2> PhabricatorDocumentRenderingEngine::newDocumentView(PhabricatorDocumentRef) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:413]
  #5 <#2> PhabricatorFileViewController::newFileContent(PhabricatorFile) called at [<phorge>/src/applications/files/controller/PhabricatorFileViewController.php:77]
  #6 <#2> PhabricatorFileViewController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #7 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
  #8 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
  #9 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
  #10 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #11 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

Finally, page http://phorge.localhost/F91 gets rendered as expected 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.