Page MenuHomePhorge

PHP 8.1 "strlen(null)" exceptions block repository import
Closed, ResolvedPublic

Description

Stack trace shared by @amit from Q55 while importing a Mercurial repository:

[08-May-2023 14:01:03 UTC] [2023-05-08 14:01:03] EXCEPTION: (PhutilProxyException) Error while executing Task ID 180186. {>} (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
[08-May-2023 14:01:03 UTC] arcanist(head=stable, ref.master=a1ee2ab93158, ref.stable=d47289622650), phorge(head=stable, ref.master=58fbf64a2786, ref.stable=d74e9d825a2c)
[08-May-2023 14:01:03 UTC]   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1140]
[08-May-2023 14:01:03 UTC]   #1 <#2> PhabricatorApplicationSearchEngine::buildConduitResponse(ConduitAPIRequest, DiffusionInternalCommitSearchConduitAPIMethod) called at [<phorge>/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php:52]
[08-May-2023 14:01:03 UTC]   #2 <#2> PhabricatorSearchEngineAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156]
[08-May-2023 14:01:03 UTC]   #3 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131]
[08-May-2023 14:01:03 UTC]   #4 <#2> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81]
[08-May-2023 14:01:03 UTC]   #5 <#2> ConduitCall::execute() called at [<arcanist>/src/future/MethodCallFuture.php:30]
[08-May-2023 14:01:03 UTC]   #6 <#2> MethodCallFuture::isReady() called at [<arcanist>/src/future/Future.php:63]
[08-May-2023 14:01:03 UTC]   #7 <#2> Future::updateFuture() called at [<arcanist>/src/future/Future.php:159]
[08-May-2023 14:01:03 UTC]   #8 <#2> Future::start() called at [<arcanist>/src/future/FutureIterator.php:403]
[08-May-2023 14:01:03 UTC]   #9 <#2> FutureIterator::moveFutureToWork(integer) called at [<arcanist>/src/future/FutureIterator.php:374]
[08-May-2023 14:01:03 UTC]   #10 <#2> FutureIterator::updateWorkingSet() called at [<arcanist>/src/future/FutureIterator.php:206]
[08-May-2023 14:01:03 UTC]   #11 <#2> FutureIterator::next() called at [<arcanist>/src/future/FutureIterator.php:190]
[08-May-2023 14:01:03 UTC]   #12 <#2> FutureIterator::rewind()
[08-May-2023 14:01:03 UTC]   #13 <#2> iterator_to_array(FutureIterator) called at [<arcanist>/src/future/FutureIterator.php:84]
[08-May-2023 14:01:03 UTC]   #14 <#2> FutureIterator::resolveAll() called at [<arcanist>/src/future/Future.php:47]
[08-May-2023 14:01:03 UTC]   #15 <#2> Future::resolve() called at [<phorge>/src/applications/repository/storage/PhabricatorRepositoryCommit.php:549]
[08-May-2023 14:01:03 UTC]   #16 <#2> PhabricatorRepositoryCommit::newCommitRef(PhabricatorUser) called at [<phorge>/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php:19]
[08-May-2023 14:01:03 UTC]   #17 <#2> PhabricatorRepositoryCommitMessageParserWorker::parseCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phorge>/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:72]
[08-May-2023 14:01:03 UTC]   #18 <#2> PhabricatorRepositoryCommitParserWorker::doWork() called at [<phorge>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
[08-May-2023 14:01:03 UTC]   #19 <#2> PhabricatorWorker::executeTask() called at [<phorge>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:160]
[08-May-2023 14:01:03 UTC]   #20 <#2> PhabricatorWorkerActiveTask::executeTask() called at [<phorge>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:22]
[08-May-2023 14:01:03 UTC]   #21 PhabricatorTaskmasterDaemon::run() called at [<phorge>/src/infrastructure/daemon/PhutilDaemon.php:219]
[08-May-2023 14:01:03 UTC]   #22 PhutilDaemon::execute() called at [<phorge>/scripts/daemon/exec/exec_daemon.php:131]

Marking as Diffusion since this bug was raised by the Diffusion homepage, but very probably the solution is not strictly related to that.

Event Timeline

valerio.bozzolan triaged this task as High priority.
valerio.bozzolan created this object in space S1 Public.

Hi @amit can you please confirm if D25204 fixes your problem? I tested it locally and it works, but having a double-check from you would be super-nice. Thanks!

Again @amit I know you have other things to do :) Can you just try to manually apply this patch?

D25204: Fix PHP 8.1 "strlen(null)" exception which can block repository imports

I think it fixes your issue but I cannot be sure since I do not use Mercurial