Page MenuHomePhabricator

conduit.querydiffs generates error when optional `id` argument is empty
Closed, ResolvedPublic


When running arc diff or arc patch commands, arcanist makes an API call to conduit.querydiffs. This API method returns an error, which causes arcanist to throw an exception. The error is: Array for %Ld conversion is empty. Query: id IN (%Ld).

Here is output from arcanist with the --trace flag:

>>> [23] <conduit> differential.querydiffs() <bytes = 196>
>>> [24] <http> /api/differential.querydiffs
<<< [24] <http> 151,358 us
<<< [23] <conduit> 151,692 us

[2017-01-10 21:22:55] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Array for %Ld conversion is empty. Query: id IN (%Ld) at [<phutil>/src/conduit/ConduitFuture.php:58]
arcanist(head=stable, ref.master=ade25facfdf2, ref.stable=9503b941cc02), drupal(), phutil(head=stable, ref.master=c5848b71c10f, ref.stable=35b57f7ab524)
  #0 ConduitFuture::didReceiveResult(array) called at [<phutil>/src/future/FutureProxy.php:58]
  #1 FutureProxy::getResult() called at [<phutil>/src/future/FutureProxy.php:35]
  #2 FutureProxy::resolve() called at [<phutil>/src/conduit/ConduitClient.php:64]
  #3 ConduitClient::callMethodSynchronous(string, array) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2246]
  #4 ArcanistDiffWorkflow::loadActiveLocalCommitInfo() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2144]
  #5 ArcanistDiffWorkflow::getGitUpdateMessage() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2110]
  #6 ArcanistDiffWorkflow::getDefaultUpdateMessage() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1887]
  #7 ArcanistDiffWorkflow::getUpdateMessage(array, NULL) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:773]
  #8 ArcanistDiffWorkflow::buildRevisionFromCommitMessage(ArcanistDifferentialCommitMessage) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:478]
  #9 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

I've been able to reproduce this in the Conduit web interface:

Screen Shot 2017-01-10 at 2.34.42 PM.png (828×1 px, 90 KB)

If I enter values for both arguments (ids and revisionIDs), the error does not occur. However, normal usage of arcanist is broken because arcanist only provides revision IDs to the conduit.querydiffs method.

Phabricator version information:

phabricator 7ea1bd5a5a44361ebec617b0ae17e1fac965f711 (Mon, Jan 9)
arcanist ade25facfdf22aed1c1e20fed3e58e60c0be3c2b (Thu, Jan 5)
phutil c5848b71c10fb585b2cfdfaaee13aec2ba163c8d (Thu, Jan 5)

Arcanist version information

also tested with previous versions dating back to October 2016.

$ arc version
arcanist 9503b941cc02be637d967bb50cfb25f852e071e4 (7 Jan 2017)
libphutil 35b57f7ab52454f697681f034bbad978658a2ff4 (7 Jan 2017)

Event Timeline

Thanks for the report. This should be resolved at HEAD of master. Let us know if you run into anything else.

Thanks a lot for the quick fix here. Works great now. Was the change to get rid of potential arc commands in the Diffusion review intentional or is that also a bug?