nixpkgs-review: GitHub token seems to be required now, with bad error message

When I try to run nix-review now I get an HTTP 401 Unauthorized error. I’m not giving nix-review a token, and it should only be accessing public data by default, so I don’t know why it’s failing. The error is rather obtuse as it’s just a very long stack trace but it’s definitely coming from the call to the GitHub API.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Since 3.0.0, #435 makes regular nixpkgs-review pr (without posting the result) always need a GitHub token to work, or it fails with a unclear error message complaining about “not a working tree” following by a 403 Forbidden error.

-> Attempting to fetch eval results from GitHub actions
$ git worktree remove -f /home/<user>/.cache/nixpkgs-review/pr-368839-2/nixpkgs
fatal: '/home/<user>/.cache/nixpkgs-review/pr-368839-2/nixpkgs' is not a working tree
Failed to remove worktree at /home/oxa/.cache/nixpkgs-review/pr-368839-2/nixpkgs. Please remove it manually. Git failed with: 128
Traceback (most recent call last):
[..]
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/urllib/request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

IIUC, it’s because we now use --eval=ofborg as default. Could we fallback to local eval when no token is set? Or, at least fail-fast and mention that a token required in this case?

Maybe, I should just removing hub/gh token parsing.

Yes I do. I’m rather surprised that nixpkgs-review would be reading .config/hub.

Do you have by chance an out-of-date token in cat $HOME/.config/hub?