bulldozer
bulldozer copied to clipboard
Could not refresh token
I just tried to run bulldozer and I'm getting the following or similar errors when receiving events from Github:
Get https://api.github.com/repos/celo-org/celo-monorepo/pulls?per_page=100&state=open: could not refresh installation id 524951's token: received non 2xx response status "404 Not Found" when fetching https://api.github.com/installations/524951/access_tokens
The installation ID is correct, so I'm not sure what the difficulty is, and I'm quite new to Golang. Are there any points for debugging this?
It looks like this is an issue with URL generation: according to the API docs, your URL is missing an /app/
section.
From this blog post, GitHub announced they were removing the old route on September 4, 2018.
However, we're currently running Bulldozer (and other apps) targeting the palantir
organization on github.com and I haven't seen this error yet, so I'm not sure why you've run into it here.
https://github.com/bradleyfalzon/ghinstallation/pull/17 updates the library we use for authentication, but hasn't merged yet. We could also work around this by updating the BaseURL
we configure in the transport, but I'm not sure how to do this in a way that's compatible with both github.com and GitHub Enterprise (which may not have the API change yet).
As a test, and assuming you are running or building from source, can you try this?
- Open
vendor/github.com/palantir/go-githubapp/githubapp/client_creator.go
- Replace lines 169 and 180 with:
itr.BaseURL = strings.TrimSuffix(c.v3BaseURL, "/") + "/app"
- Rebuild and redeploy the server
Fwiw, I'm using the provided docker image if that makes a difference. I'll try to build with your suggestions, thank you!
I couldn't really figure out how to build it from scratch, so for now, I'll just wait for upstream to get fixed
☝️ I got the same issue and tried @bluekeyes's approach, but it also fails with a similar error message.
It looks like the change to ghinstallation
merged last week, so we can try upgrading to that now. But I have to admit that I'm still quite confused by this issue: we've been using the current release of Bulldozer against both github.com and GitHub Enterprise 2.16.5 without any issues. Maybe the API change only applies to application created after a certain date?
@erickmendonca if you have a build environment working, can you try upgrading the library?
./godelw run-dep -- ensure -update github.com/bradleyfalzon/ghinstallation
If that works, I'll have to verify that it still works against GitHub Enterprise as well before including it in a release.
I got the same error today and I found out that in addition to update the api url to https://api.github.com/app
, in the config file the integration_id
value must be App id
value of your app.
You can find it on the General
tab of your application (Settings > Developer settings > GitHub Apps > {your app} > General
I got the same error today and I found out that in addition to update the api url to
https://api.github.com/app
, in the config file theintegration_id
value must beApp id
value of your app. You can find it on theGeneral
tab of your application (Settings > Developer settings > GitHub Apps > {your app} > General
@tanvn Did this resolve the issue for you?
@ashishb Yes ! I did resolve the issue. And actual I am using the bulldozer:1.5.0 docker image, and there is no need to update the API url, only fill out the settings for bulldozer.yml is ok.