Page MenuHomePhabricator

Expected a numeric scalar or null for %Ld conversion
Closed, WontfixPublic

Description

I'm seeing a bunch of these errors in our PHP logs:

[17-Mar-2015 18:41:31 Australia/Sydney] [2015-03-17 18:41:31] EXCEPTION: (AphrontParameterQueryException) Expected a numeric scalar or null for %Ld conversion. Query: id 
IN (%Ld) at [<phutil>/src/xsprintf/qsprintf.php:284]
[17-Mar-2015 18:41:31 Australia/Sydney] arcanist(head=master, ref.master=b961869edac9), phabricator(head=master, ref.master=98899c822eb9), phlab(head=master, ref.master=d
ddf486a2aec), phutil(head=master, ref.master=ce3959b4046f)
[17-Mar-2015 18:41:31 Australia/Sydney]   #0 _qsprintf_check_scalar_type(string, string, string) called at [<phutil>/src/xsprintf/qsprintf.php:258]
[17-Mar-2015 18:41:31 Australia/Sydney]   #1 _qsprintf_check_type(array, string, string) called at [<phutil>/src/xsprintf/qsprintf.php:129]
[17-Mar-2015 18:41:31 Australia/Sydney]   #2 xsprintf_query(AphrontMySQLiDatabaseConnection, string, integer, array, integer) called at [<phutil>/src/xsprintf/xsprintf.ph
p:70]
[17-Mar-2015 18:41:31 Australia/Sydney]   #3 xsprintf(string, AphrontMySQLiDatabaseConnection, array) called at [<phutil>/src/xsprintf/qsprintf.php:64]
[17-Mar-2015 18:41:31 Australia/Sydney]   #4 qsprintf(AphrontMySQLiDatabaseConnection, string, array) called at [<phabricator>/src/applications/differential/query/Differe
ntialDiffQuery.php:131]
[17-Mar-2015 18:41:31 Australia/Sydney]   #5 DifferentialDiffQuery::buildWhereClause(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/applications/differenti
al/query/DifferentialDiffQuery.php:45]
[17-Mar-2015 18:41:31 Australia/Sydney]   #6 DifferentialDiffQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:22
7]
[17-Mar-2015 18:41:31 Australia/Sydney]   #7 PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php:41]
[17-Mar-2015 18:41:31 Australia/Sydney]   #8 DifferentialQueryDiffsConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:65]
[17-Mar-2015 18:41:31 Australia/Sydney]   #9 ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:134]
[17-Mar-2015 18:41:31 Australia/Sydney]   #10 ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:84]
[17-Mar-2015 18:41:31 Australia/Sydney]   #11 ConduitCall::execute() called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:88]
[17-Mar-2015 18:41:31 Australia/Sydney]   #12 PhabricatorConduitAPIController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33]
[17-Mar-2015 18:41:31 Australia/Sydney]   #13 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:196]
[17-Mar-2015 18:41:31 Australia/Sydney]   #14 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:121]
[17-Mar-2015 18:41:31 Australia/Sydney]   #15 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:19]

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Conduit.
joshuaspence added a subscriber: joshuaspence.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

I think we can only fix this by adding typechecking to Conduit, which will happen some day but is a larger project.

My guess is that someone or some script submitted something like [[1]] for ids (i.e., a list of arrays instead of a list of scalars).

Specifically, submitting ids: [[1]] will reproduce this:

Screen_Shot_2015-03-21_at_4.50.42_AM.png (1×1 px, 131 KB)

FWIW, it looks like arc export hits this when invoked with --diff-id DXXX instead of --diff-id XXX

seth@dev9:~/update/pro$ arc export --trace --unified --diff D378
libphutil loaded from '/home/seth/local/src/arcanist/libphutil/src'.
arcanist loaded from '/home/seth/local/src/arcanist/arcanist/src'.
Config: Reading user configuration file "/home/seth/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: No candidate locations for .arcconfig from this working directory.
Working Copy: Path "/home/seth/update/pro" is not in any working copy.
>>> [0] <conduit> conduit.connect() <bytes = 490>
>>> [1] <http> http://phab.internal:8001/api/conduit.connect
<<< [1] <http> 52,073 us
<<< [0] <conduit> 52,302 us
>>> [2] <conduit> differential.querydiffs() <bytes = 189>
>>> [3] <http> http://phab.internal:8001/api/differential.querydiffs
<<< [3] <http> 39,077 us
<<< [2] <conduit> 39,233 us

[2015-03-26 13:34:29] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Expected a numeric scalar or null for %Ld conversion. Query: id IN (%Ld) at [<phutil>/src/conduit/ConduitFuture.php:54]
arcanist(head=master, ref.master=a01d3c3b1a5a), phutil(head=master, ref.master=f3c43468cd3b)
  #0 ConduitFuture::didReceiveResult(array) called at [<phutil>/src/future/FutureProxy.php:60]
  #1 FutureProxy::getResult() called at [<phutil>/src/future/FutureProxy.php:37]
  #2 FutureProxy::resolve() called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1136]
  #3 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1117]
  #4 ArcanistWorkflow::loadDiffBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistExportWorkflow.php:230]
  #5 ArcanistExportWorkflow::run() called at [<arcanist>/scripts/arcanist.php:378]