Page MenuHomePhabricator

Arc upgrade returns success message when it failed
Closed, ResolvedPublic

Description

~/git/core $ arc upgrade
Upgrading libphutil...
error: cannot open .git/FETCH_HEAD: Permission denied

Upgrading arcanist...
error: cannot open .git/FETCH_HEAD: Permission denied

Updated! Your copy of arc is now up to date.

The update above failed, but the message falsely claims Arcanist is up to date.

Event Timeline

leonpalm updated the task description. (Show Details)
leonpalm added a project: Arcanist.
leonpalm added a subscriber: cspeckmim.
leonpalm added a subscriber: leonpalm.

What are the steps to reproduce the error?

From the IRC @leonpalm had indicated that

The issue itself was quickly resolved. Was a file permissions problem.

Sounded like the location of the arcanist/libphutil may not have been writable by the user running arc upgrade

Yes, correct. Calling arc upgrade with sudo succeeded the second time around.

This error handling block is incorrect:

try {
  phutil_passthru('git pull --rebase');
} catch (Exception $ex) {
  phutil_passthru('git rebase --abort');
  throw $ex;
}

phutil_passthru() returns the error code (like exec_manual()); it does not throw on failure (like execx()).

It looks like I wrote this wrong in D2435. The use in the try assumes it throws while the use in the catch assumes it does not, so I think I just did this wrong.

angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Oct 22 2015, 5:51 PM
angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Oct 22 2015, 9:11 PM
angie moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Apr 21 2016, 10:22 PM