Upstreaming this from our server logs (Phorge at 52be52d429ce); I checked that we have no offset of line numbers in downstream - there is not.
I'm quite puzzled that $query_key can be an array here. Looks like some Conduit API calls might allow passing that?
This code area was recently changed. In https://secure.phabricator.com/D21862 this code was changed to if ($query_key === null || !strlen($query_key)) instead of Phorge's D25204 $is_empty_query_key = phutil_string_cast($query_key) === '' approach.
[2023-09-08 11:18:38] EXCEPTION: (Exception) Value passed to "phutil_string_cast()" is an array; arrays can not be sensibly cast to strings. at [<arcanist>/src/utils/utils.php:1807] arcanist(), ava(), phorge(), translations(), wmf-ext-misc() #0 <#2> phutil_string_cast(array) called at [<phorge>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:1140] #1 <#2> PhabricatorApplicationSearchEngine::buildConduitResponse(ConduitAPIRequest, ManiphestSearchConduitAPIMethod) called at [<phorge>/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php:52] #2 <#2> PhabricatorSearchEngineAPIMethod::execute(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/method/ConduitAPIMethod.php:156] #3 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phorge>/src/applications/conduit/call/ConduitCall.php:131] #4 <#2> ConduitCall::executeMethod() called at [<phorge>/src/applications/conduit/call/ConduitCall.php:81] #5 <#2> ConduitCall::execute() called at [<phorge>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:83] #6 phlog(Exception) called at [<phorge>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:111] #7 PhabricatorConduitAPIController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284] #8 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204] #9 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]