Page MenuHomePhorge

PHP 8.2: "substr(null) exception" in People > Activity Logs
Closed, ResolvedPublic

Description

When someone tries to log on with invalid credentials, a record is inserted in the phabricator_user.user_log table with action = login-fail.
The session value of this record is set to null in this case.

When you open the PeopleActivity Logs screen, you will see an exception because of this.

Stack trace
[Sat Jul 15 14:29:22.840573 2023] [php:notice] [2001:db8:0:f101::1:37608] [2023-07-15 12:29:22] EXCEPTION: (RuntimeException) substr(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
[Sat Jul 15 14:29:22.841072 2023] [php:notice] [2001:db8:0:f101::1:37608] arcanist(head=master, ref.master=6e4947b55f09), diagram(head=master, ref.master=9031a4f716a0), example(), phorge(head=master, ref.master=f7dd8f579a36, custom=1)
[Sat Jul 15 14:29:22.841079 2023] [php:notice] [2001:db8:0:f101::1:37608]   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<arcanist>/src/error/PhutilErrorHandler.php:261]
[Sat Jul 15 14:29:22.841082 2023] [php:notice] [2001:db8:0:f101::1:37608]   #1 <#2> substr(NULL, integer, integer) called at [<phorge>/src/applications/people/view/PhabricatorUserLogView.php:39]
[Sat Jul 15 14:29:22.841093 2023] [php:notice] [2001:db8:0:f101::1:37608]   #2 <#2> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:97]
[Sat Jul 15 14:29:22.841095 2023] [php:notice] [2001:db8:0:f101::1:37608]   #3 <#2> phutil_tag(string, array, array) called at [<phorge>/src/infrastructure/javelin/markup.php:70]
[Sat Jul 15 14:29:22.841097 2023] [php:notice] [2001:db8:0:f101::1:37608]   #4 <#2> javelin_tag(string, array, array) called at [<phorge>/src/view/AphrontTagView.php:158]
[Sat Jul 15 14:29:22.841100 2023] [php:notice] [2001:db8:0:f101::1:37608]   #5 <#2> AphrontTagView::render() called at [<phorge>/src/view/AphrontView.php:222]
[Sat Jul 15 14:29:22.841102 2023] [php:notice] [2001:db8:0:f101::1:37608]   #6 <#2> AphrontView::producePhutilSafeHTML() called at [<phorge>/src/infrastructure/markup/render.php:115]
[Sat Jul 15 14:29:22.841104 2023] [php:notice] [2001:db8:0:f101::1:37608]   #7 <#2> phutil_escape_html(PHUIObjectBoxView) called at [<phorge>/src/infrastructure/markup/render.php:139]
[Sat Jul 15 14:29:22.841107 2023] [php:notice] [2001:db8:0:f101::1:37608]   #8 <#2> phutil_escape_html(array) called at [<phorge>/src/infrastructure/markup/render.php:171]
[Sat Jul 15 14:29:22.841109 2023] [php:notice] [2001:db8:0:f101::1:37608]   #9 <#2> phutil_implode_html(string, array) called at [<phorge>/src/view/page/PhabricatorBarePageView.php:58]
[Sat Jul 15 14:29:22.841111 2023] [php:notice] [2001:db8:0:f101::1:37608]   #10 <#2> PhabricatorBarePageView::willRenderPage() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:216]
[Sat Jul 15 14:29:22.841113 2023] [php:notice] [2001:db8:0:f101::1:37608]   #11 <#2> PhabricatorStandardPageView::willRenderPage() called at [<phorge>/src/view/page/AphrontPageView.php:46]
[Sat Jul 15 14:29:22.841115 2023] [php:notice] [2001:db8:0:f101::1:37608]   #12 <#2> AphrontPageView::render() called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:904]
[Sat Jul 15 14:29:22.841118 2023] [php:notice] [2001:db8:0:f101::1:37608]   #13 <#2> PhabricatorStandardPageView::produceAphrontResponse() called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:722]
[Sat Jul 15 14:29:22.841120 2023] [php:notice] [2001:db8:0:f101::1:37608]   #14 <#2> AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:299]
[Sat Jul 15 14:29:22.841122 2023] [php:notice] [2001:db8:0:f101::1:37608]   #15 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
[Sat Jul 15 14:29:22.841125 2023] [php:notice] [2001:db8:0:f101::1:37608]   #16 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
[Sat Jul 15 14:29:22.841127 2023] [php:notice] [2001:db8:0:f101::1:37608]   #17 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:337]
[Sat Jul 15 14:29:22.841129 2023] [php:notice] [2001:db8:0:f101::1:37608]   #18 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
[Sat Jul 15 14:29:22.841135 2023] [php:notice] [2001:db8:0:f101::1:37608]   #19 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

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.