Page MenuHomePhabricator

Passing an incorrectly formatted revision ID to `arc patch` results in an exception
Closed, DuplicatePublic

Description

In an early morning haze I mistyped a revision ID in arc patch and got an exception:

cspeck@host ~/S/p/code> arc patch 40439 --trace
 ARGV  '/Users/cspeck/Projects/phacility/arcanist/bin/../scripts/arcanist.php' 'patch' '40439' '--trace'
 LOAD  Loaded "phutil" from "/Users/cspeck/Projects/phacility/libphutil/src".
 LOAD  Loaded "arcanist" from "/Users/cspeck/Projects/phacility/arcanist/src".
Config: Reading user configuration file "/Users/cspeck/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/cspeck/Source/project/code/.arcconfig".
Working Copy: Path "/Users/cspeck/Source/project/code" is part of `hg` working copy "/Users/cspeck/Source/project/code".
Working Copy: Project root is at "/Users/cspeck/Source/project/code".
Config: Did not find local configuration at "/Users/cspeck/Source/project/code/.hg/arc/config".
>>> [0] <conduit> differential.querydiffs() <bytes = 76>
>>> [1] <http> https://repo.company.com/api/differential.querydiffs
<<< [1] <http> 260,382 us
<<< [0] <conduit> 261,379 us
>>> [2] <conduit> user.whoami() <bytes = 117>
>>> [3] <http> https://repo.company.com/api/user.whoami
<<< [3] <http> 244,422 us
<<< [2] <conduit> 244,647 us
>>> [4] <conduit> differential.querydiffs() <bytes = 157>
>>> [5] <http> https://repo.company.com/api/differential.querydiffs
<<< [5] <http> 242,392 us
<<< [4] <conduit> 242,618 us
[2016-09-20 13:20:06] ERROR 2: Invalid argument supplied for foreach() at [/Users/cspeck/Projects/phacility/arcanist/src/workflow/ArcanistWorkflow.php:1200]
arcanist(head=master, ref.master=9e82ef979e81), phutil(head=master, ref.master=f241706ade25)
  #0 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1189]
  #1 ArcanistWorkflow::loadRevisionBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:384]
  #2 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:397]
  #3 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

[2016-09-20 13:20:06] EXCEPTION: (InvalidArgumentException) Argument 1 passed to idx() must be of the type array, boolean given, called in /Users/cspeck/Projects/phacility/arcanist/src/workflow/ArcanistWorkflow.php on line 1207 and defined at [<phutil>/src/error/PhutilErrorHandler.php:200]
arcanist(head=master, ref.master=9e82ef979e81), phutil(head=master, ref.master=f241706ade25)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phutil>/src/utils/utils.php:36]
  #1 idx(boolean, string) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1207]
  #2 ArcanistWorkflow::loadBundleFromConduit(ConduitClient, array) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1189]
  #3 ArcanistWorkflow::loadRevisionBundleFromConduit(ConduitClient, string) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:384]
  #4 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:397]
  #5 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]