Page MenuHomePhabricator

arc feature D123 fails with ERR-INVALID-SESSION
Closed, DuplicatePublic

Description

arc feature D123 should check out the branch from revision D123 according to the help:

With name, it creates or checks out a branch. If the branch name doesn't exist and is in format D123 then the branch of revision D123 is checked out.

I thought it would work kind of like arc patch but create a branch with a friendly name (instead of arcpatch-D123).

When I run it that doesn't seem to happen:

$ git branch
* master
$ arc feature D11892
Branch D11892 set up to track local branch master.
Switched to a new branch 'D11892'
$ git branch
* D11892
master

The new branch is just a tracking branch of master. The commits at D11892 and master are the same.

I added an echo $ex to ArcanistFeatureWorkflow.php:139 and saw the following error:

exception 'ConduitClientException' with message 'ERR-INVALID-SESSION: Session key is not present.' in /Users/elesh/Source/contrib/libphutil/src/conduit/ConduitFuture.php:54
Stack trace:
#0 /Users/elesh/Source/contrib/libphutil/src/future/FutureProxy.php(60): ConduitFuture->didReceiveResult(Array)
#1 /Users/elesh/Source/contrib/libphutil/src/future/FutureProxy.php(37): FutureProxy->getResult()
#2 /Users/elesh/Source/contrib/libphutil/src/conduit/ConduitClient.php(57): FutureProxy->resolve()
#3 /Users/elesh/Source/contrib/arcanist/src/workflow/ArcanistFeatureWorkflow.php(130): ConduitClient->callMethodSynchronous('differential.qu...', Array)
#4 /Users/elesh/Source/contrib/arcanist/src/workflow/ArcanistFeatureWorkflow.php(84): ArcanistFeatureWorkflow->checkoutBranch(Array)
#5 /Users/elesh/Source/contrib/arcanist/scripts/arcanist.php(378): ArcanistFeatureWorkflow->run()
#6 {main}
Branch D11892 set up to track local branch master.
Switched to a new branch 'D11892'

Versions
arcanist d8182cf55d501b1359f6f91bc0b75b50baa08037 (25 Feb 2015)
libphutil 124e5a41e0864ea68f7c921aafb01c5d457623a2 (25 Feb 2015)

Is this supposed to work, or have I misunderstood what it does?

For D11892 as used in the example above, I expected to see a branch named graceful-mod get created with the contents of the revision.

Event Timeline

elesh raised the priority of this task from to Needs Triage.
elesh updated the task description. (Show Details)
elesh added a project: Arcanist.
elesh added a subscriber: elesh.

ERR-INVALID-SESSION means there's an issue with the phabricator session, and should probably not be silently ignored there.

try running arc install-certificate to recreate your session key, and test it by running echo {} | arc call-conduit --trace user.whoami.

I think this is a problem with logged-out users, anonymous access, and arc patch.

We do some sketchy stuff in arc patch to try to let logged-out users access public data but it has never really worked entirely correctly.

FWIW, the user.whoami call that @avivey mentioned above returns the username and email address that I use for phabricator login.

Not sure if related, but few days ago I wanted to install certificate and I received following error:

arc install-certificate
Trying to connect to server...
LOGIN TO PHABRICATOR
Open this page in your browser and login to Phabricator if necessary:

    https://secure.phabricator.com/conduit/login/ <---- I believe this should point to my local phabricator address?

Then paste the API Token on that page below.

    Paste API Token from that page: cli-5oy7updvniekjhnvupyrxfi365pj
Usage Exception: The token "cli-5oy7updvniekjhnvupyrxfi365pj" is not a valid API Token. The server returned this response when trying to use it as a token: ERR-INVALID-AUTH: API token "cli-5oy7updvniekjhnvupyrxfi365pj" is not valid.