Page MenuHomePhabricator

Expected a scalar or null for %Ls conversion. Query: user.phid
Closed, ResolvedPublic

Description

Two users have reported this issue to me today. They receive the following error when attempting to create a differential revision:

[2016-05-17 23:57:08] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Expected a scalar or null for %Ls conversion. Query: user.phid IN (%Ls) at [<phutil>/src/conduit/ConduitFuture.php:58]
arcanist(head=master, ref.master=2234c8cacc21), phutil(head=master, ref.master=b25e0477b280)
  #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 [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1832]
  #3 ArcanistDiffWorkflow::validateCommitMessage(ArcanistDifferentialCommitMessage) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1712]
  #4 Arcanis
tDiffWorkflow::getCommitMessageFromUser() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1517]
  #5 ArcanistDiffWorkflow::buildCommitMessage() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:469]
  #6 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:392]

Server-side, I see this in the logs:

[18-May-2016 09:58:51 Australia/Sydney] [2016-05-18 09:58:51] EXCEPTION: (ConduitException) API Method "user.query" does not define these parameters: 'user.phid'. at [<phabricator>/src/applications/conduit/call/ConduitCall.php:37]
[18-May-2016 09:58:51 Australia/Sydney] arcanist(head=master, ref.master=2234c8cacc21), phabricator(head=master, ref.master=de1a30efc740, custom=1), phlab(head=master, ref.master=84b62e6917ec), phutil(head=master, ref.master=b25e0477b280)
[18-May-2016 09:58:51 Australia/Sydney]   #0 <#2> ConduitCall::__construct(string, array) called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:30]
[18-May-2016 09:58:51 Australia/Sydney]   #1 phlog(ConduitException) called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:101]
[18-May-2016 09:58:51 Australia/Sydney]   #2 PhabricatorConduitAPIController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
[18-May-2016 09:58:51 Australia/Sydney]   #3 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
[18-May-2016 09:58:51 Australia/Sydney]   #4 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]

Event Timeline

Oh, this is probably the correct error log:

[18-May-2016 09:57:08 Australia/Sydney] [2016-05-18 09:57:08] EXCEPTION: (AphrontParameterQueryException) Expected a scalar or null for %Ls conversion. Query: user.phid IN (%Ls) at [<phutil>/
src/xsprintf/qsprintf.php:309]
[18-May-2016 09:57:08 Australia/Sydney] arcanist(head=master, ref.master=2234c8cacc21), phabricator(head=master, ref.master=de1a30efc740, custom=1), phlab(head=master, ref.master=84b62e6917ec), phutil(head=master, ref.master=b25e0477b280)
[18-May-2016 09:57:08 Australia/Sydney]   #0 <#2> qsprintf_check_scalar_type(array, string, string) called at [<phutil>/src/xsprintf/qsprintf.php:267]
[18-May-2016 09:57:08 Australia/Sydney]   #1 <#2> qsprintf_check_type(array, string, string) called at [<phutil>/src/xsprintf/qsprintf.php:134]
[18-May-2016 09:57:08 Australia/Sydney]   #2 <#2> xsprintf_query(AphrontMySQLiDatabaseConnection, string, integer, array, integer) called at [<phutil>/src/xsprintf/xsprintf.php:70]
[18-May-2016 09:57:08 Australia/Sydney]   #3 <#2> xsprintf(string, AphrontMySQLiDatabaseConnection, array) called at [<phutil>/src/xsprintf/qsprintf.php:64]
[18-May-2016 09:57:08 Australia/Sydney]   #4 <#2> qsprintf(AphrontMySQLiDatabaseConnection, string, array) called at [<phabricator>/src/applications/people/query/PhabricatorPeopleQuery.php:308]
[18-May-2016 09:57:08 Australia/Sydney]   #5 <#2> PhabricatorPeopleQuery::buildWhereClauseParts(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:266]
[18-May-2016 09:57:08 Australia/Sydney]   #6 <#2> PhabricatorCursorPagedPolicyAwareQuery::buildWhereClause(AphrontMySQLiDatabaseConnection) called at [<phabricator>/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php:96]
[18-May-2016 09:57:08 Australia/Sydney]   #7 <#2> PhabricatorCursorPagedPolicyAwareQuery::loadStandardPageRows(PhabricatorUser) called at [<phabricator>/src/applications/people/query/PhabricatorPeopleQuery.php:128]
[18-May-2016 09:57:08 Australia/Sydney]   #8 <#2> PhabricatorPeopleQuery::loadPage() called at [<phabricator>/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:227]
[18-May-2016 09:57:08 Australia/Sydney]   #9 <#2> PhabricatorPolicyAwareQuery::execute() called at [<phabricator>/src/applications/people/conduit/UserQueryConduitAPIMethod.php:70]
[18-May-2016 09:57:08 Australia/Sydney]   #10 <#2> UserQueryConduitAPIMethod::execute(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/method/ConduitAPIMethod.php:122]
[18-May-2016 09:57:08 Australia/Sydney]   #11 <#2> ConduitAPIMethod::executeMethod(ConduitAPIRequest) called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:131]
[18-May-2016 09:57:08 Australia/Sydney]   #12 <#2> ConduitCall::executeMethod() called at [<phabricator>/src/applications/conduit/call/ConduitCall.php:81]
[18-May-2016 09:57:08 Australia/Sydney]   #13 <#2> ConduitCall::execute() called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:81]
[18-May-2016 09:57:08 Australia/Sydney]   #14 phlog(AphrontParameterQueryException) called at [<phabricator>/src/applications/conduit/controller/PhabricatorConduitAPIController.php:101]
[18-May-2016 09:57:08 Australia/Sydney]   #15 PhabricatorConduitAPIController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
[18-May-2016 09:57:08 Australia/Sydney]   #16 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
[18-May-2016 09:57:08 Australia/Sydney]   #17 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]
> arc diff --trace
 ARGV  '/home/REDACTED/phabricator/arcanist/bin/../scripts/arcanist.php' 'diff' '--trace'
 LOAD  Loaded "phutil" from "/home/REDACTED/phabricator/libphutil/src".
 LOAD  Loaded "arcanist" from "/home/REDACTED/phabricator/arcanist/src".
Config: Reading user configuration file "/home/REDACTED/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/home/REDACTED/Documents/repos/REDACTED/.arcconfig".
Working Copy: Path "/home/REDACTED/Documents/repos/REDACTED" is part of `git` working copy "/home/REDACTED/Documents/repos/REDACTED".
Working Copy: Project root is at "/home/REDACTED/Documents/repos/REDACTED".
Config: Did not find local configuration at "/home/REDACTED/Documents/repos/REDACTED/.git/arc/config".
Loading phutil library from '/home/REDACTED/Documents/repos/REDACTED/support/flarc/src'...
>>> [0] <conduit> user.whoami() <bytes = 117>
>>> [1] <http> https://phabricator.REDACTED.com/api/user.whoami
<<< [1] <http> 1,117,794 us
<<< [0] <conduit> 1,118,567 us
>>> [2] <exec> $ git diff --no-ext-diff --no-textconv --raw 'HEAD' --
>>> [3] <exec> $ git ls-files --others --exclude-standard
<<< [3] <exec> 125,537 us
<<< [2] <exec> 177,610 us
>>> [4] <exec> $ git diff-files --name-only
<<< [4] <exec> 60,686 us
You have untracked files in this working copy.

  Working copy: /home/REDACTED/Documents/repos/REDACTED/

  Untracked changes in working copy:
  (To ignore these changes, add them to ".git/info/exclude".)
    REDACTED

    Ignore these untracked files and continue? [y/N] y

>>> [5] <event> diff.didCollectChanges <listeners = 0>
<<< [5] <event> 306 us
>>> [6] <exec> $ git rev-parse --verify HEAD^
<<< [6] <exec> 11,622 us
>>> [7] <exec> $ git merge-base 'production/master' HEAD
<<< [7] <exec> 11,132 us
>>> [8] <exec> $ git rev-parse 'HEAD'
<<< [8] <exec> 10,127 us
>>> [9] <exec> $ git log --first-parent --format=medium 'cd2704e5e59f9e1a05de9caf45fa43ce64ce64df'..'65c1c3b79f058c106b674fcf2a267d6f7207da12'
<<< [9] <exec> 10,771 us
>>> [10] <exec> $ git log '65c1c3b79f058c106b674fcf2a267d6f7207da12' --not 'cd2704e5e59f9e1a05de9caf45fa43ce64ce64df' --format='%H%x01%T%x01%P%x01%at%x01%an%x01%aE%x01%s%x01%s%n%n%b%x02' --
<<< [10] <exec> 10,416 us
>>> [11] <conduit> differential.query() <bytes = 376>
>>> [12] <http> https://phabricator.REDACTED.com/api/differential.query
<<< [12] <http> 356,480 us
<<< [11] <conduit> 356,960 us
>>> [13] <exec> $ git rev-parse --git-dir
<<< [13] <exec> 3,024 us
>>> [14] <exec> $ git log '65c1c3b79f058c106b674fcf2a267d6f7207da12' --not 'cd2704e5e59f9e1a05de9caf45fa43ce64ce64df' --format='%H%x01%T%x01%P%x01%at%x01%an%x01%aE%x01%s%x01%s%n%n%b%x02' --
<<< [14] <exec> 9,987 us
>>> [15] <conduit> differential.parsecommitmessage() <bytes = 501>
>>> [16] <http> https://phabricator.REDACTED.com/api/differential.parsecommitmessage
<<< [16] <http> 371,712 us
<<< [15] <conduit> 372,269 us
>>> [17] <event> diff.willBuildMessage <listeners = 0>
<<< [17] <event> 188 us
>>> [18] <conduit> differential.getcommitmessage() <bytes = 736>
>>> [19] <http> https://phabricator.REDACTED.com/api/differential.getcommitmessage
<<< [19] <http> 362,558 us
<<< [18] <conduit> 363,125 us
>>> [20] <exec> $ git symbolic-ref --quiet HEAD
<<< [20] <exec> 3,916 us
>>> [21] <exec> $ vi  '/tmp/edit.8y8vhx7xqkg0ggos/new-commit'
<<< [21] <exec> 4,492,757 us
>>> [22] <exec> $ git commit --amend --allow-empty -F '/tmp/4eyusk9nkwao880o/10971-728R8q'
<<< [22] <exec> 135,158 us
>>> [23] <conduit> differential.parsecommitmessage() <bytes = 508>
>>> [24] <http> https://phabricator.REDACTED.com/api/differential.parsecommitmessage
<<< [24] <http> 358,794 us
<<< [23] <conduit> 359,454 us
>>> [25] <conduit> user.query() <bytes = 305>
>>> [26] <http> https://phabricator.REDACTED.com/api/user.query
<<< [26] <http> 344,541 us
<<< [25] <conduit> 345,254 us
(Message saved to commit message.)

[2016-05-17 23:46:15] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Expected a scalar or null for %Ls conversion. Query: user.phid IN (%Ls) at [<phutil>/src/conduit/ConduitFuture.php:58]
arcanist(head=master, ref.master=2234c8cacc21), flarc(), phutil(head=master, ref.master=b25e0477b280)
  #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 [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1832]
  #3 ArcanistDiffWorkflow::validateCommitMessage(ArcanistDifferentialCommitMessage) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1712]
  #4 ArcanistDiffWorkflow::getCommitMessageFromUser() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1517]
  #5 ArcanistDiffWorkflow::buildCommitMessage() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:469]
  #6 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:392]

I think the output format from differential.parsecommitmessage has changed:

	
{
  "errors": [],
  "fields": {
    "title": "Dummy",
    "summary": "Dummy, please ignore.",
    "testPlan": "Ignore.",
    "reviewerPHIDs": [
      {
        "phid": "PHID-PROJ-nbtcpwy6jyqurn4donug",
        "suffixes": []
      }
    ],
    "ccPHIDs": [],
    "jira.issues": []
  },
  "revisionIDFieldInfo": {
    "value": null,
    "validDomain": "https://phabricator.REDACTED.com"
  }
}

I'm not sure if this change is correct, but it seems to fix the issue for me: https://secure.phabricator.com/differential/diff/38381/

D15934? looks like it introduced "suffixes" for reviewers.

Thanks, try HEAD?

That diff will also work, but prevent the new Reviewers: reviewer! blocking syntax from working properly.