"Error: Unable to fork: Not Found!" encountered with bump-formula-pr

Hello! I am trying to update the formula for PyInvoke with

brew \
  bump-formula-pr \
  --strict \
  --message="Update pyinvoke to 1.3.0 with brew bump-formula-pr" \
  --url="https://github.com/pyinvoke/invoke/archive/1.3.0.tar.gz" \
  --sha256="2cb989c037945be3c13ed92e2a955f5f6489a39dbbc8bd2ee8d5712b8fad135e"

This is the result

==> **replace /^ revision \d+\n(\n( head "))?/m with "\\2"**

==> **replace /https:\/\/github\.com\/pyinvoke\/invoke\/archive\/1\.2\.0\.tar\.g**

==> **replace "266003d33a8b3a565268e33aa0f9767b9441cf1476a20258f929768ee5acd390"**

Error: Unable to fork: Not Found!

Any thoughts? Thanks in advance!

What happens when you run hub fork?

I had to install hub.

> cd (brew --repository)
nwh@nwh-macbook /u/l/Homebrew> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
> git remote 
origin
> hub fork
github.com username: nwh
github.com password for nwh (never stored): 
two-factor authentication code: 
Updating nwh
From https://github.com/Homebrew/brew
 * [new branch]          master     -> nwh/master
new remote: nwh
> git remote -v
nwh	git@github.com:nwh/brew.git (fetch)
nwh	git@github.com:nwh/brew.git (push)
origin	https://github.com/Homebrew/brew (fetch)
origin	https://github.com/Homebrew/brew (push)

After this, the bump-formula-pr command still resulted in Error: Unable to fork: Not Found!.

Did I miss a GitHub authentication step? I was trying to follow this and the last PR which updated PyInvoke.

Thanks,
Nick

I ended up following the manual instructions. In doing so, I created a fork for homebrew-core, which I did not have before. Had that existed, maybe the bump-formula-pr subcommand would have worked? Anyway, the PR is here. Thanks!

Yeah, normally it should work correctly with just the bump-formula-pr command, but in that case you needed to run hub fork in the $(brew --repo homebrew/core) repository. Glad to hear it worked out!

In case this is useful to other people, the Error: Unable to fork: Not Found!. error message when using bump-formula-pr was, in my case, caused by insufficient permissions for the personal Github token used by brew (from HOMEBREW_GITHUB_API_TOKEN).
After updating the token to give it public_repo permissions (so it can check my repos and see that I had a fork) it worked fine.

Pyinvoke has released version 1.4.1. I am still having trouble using bump-formula-pr.
I use fish as a shell if that has any impact on this. I executed hub fork as
suggested by jonchang (see: https://github.com/nwh/homebrew-core).

nw_henderson at nwh-home-macbook in /u/l/H/L/T/h/homebrew-core
↪ cd (brew --repo homebrew/core)
nw_henderson at nwh-home-macbook in /u/l/H/L/T/h/homebrew-core
↪ pwd
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
nw_henderson at nwh-home-macbook in /u/l/H/L/T/h/homebrew-core
↪ git remote -v
nwh	git@github.com:nwh/homebrew-core.git (fetch)
nwh	git@github.com:nwh/homebrew-core.git (push)
origin	https://github.com/Homebrew/homebrew-core (fetch)
origin	https://github.com/Homebrew/homebrew-core (push)

I use set -x HOMEBREW_GITHUB_API_TOKEN ... with my API token (which has full repo
permissions).

nw_henderson at nwh-home-macbook in /u/l/H/L/T/h/homebrew-core
↪ brew bump-formula-pr \
    --url=https://github.com/pyinvoke/invoke/archive/1.4.1.tar.gz \
    --sha256=ac5880fb5d21f06cc1b29f89736cb8a43b85abea9204b4bb4277458ae025d0b7
  
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> replace /https:\/\/github\.com\/pyinvoke\/invoke\/archive\/1\.4\.0\.tar\.gz/ with "htt
==> replace "84b26e567cfab58ee85e18f7d095c3db3ec16c8f594d6bcc1270e36ff5e70ade" with "ac588
Error: Unable to fork: Not Found!

Are there any other configuration variables that affect bump-formula-pr?

What happens when you run hub fork within the homebrew directory?

This time around I had a fork of homebrew/core, but not homebrew

↪ cd (brew --repo)
nw_henderson at nwh-home-macbook in /u/l/Homebrew
↪ hub fork
github.com username: nwh
github.com password for nwh (never stored): ...
two-factor authentication code: ...
Updating nwh
From https://github.com/Homebrew/brew
 * [new branch]          master     -> nwh/master
new remote: nwh
nw_henderson at nwh-home-macbook in /u/l/Homebrew
↪ hub fork
existing remote: nwh
nw_henderson at nwh-home-macbook in /u/l/Homebrew
↪ cd (brew --repository homebrew/core)
nw_henderson at nwh-home-macbook in /u/l/H/L/T/h/homebrew-core
↪ hub fork
existing remote: nwh

Did this get solved? I’m also using Fish, and also getting similar results.

Never had this issue (with fish). Did you try the steps above?

I think so, the only thing I didn’t do was manually make a fork of brew itself. I played with the permissions on the PAT, and installed and used hub to add a fork (though I should already have had one). I also went to an old computer that I’ve used this on before, and it had the same issue. Is there something special with the token permissions that is different now?

Not as far as I know.