bulldozer icon indicating copy to clipboard operation
bulldozer copied to clipboard

Installation Not Working Properly

Open shammishailaj opened this issue 5 years ago • 4 comments

Hi

I have installed bulldozer via docker. For more details on how it is being run see issue no: #117

Post Installation I have created a Github App with the following permissions:

Repository administration - Access: Read-only Repository contents - Access: Read-only Repository metadata - Access: Read-only Pull requests - Access: Read & Write

Events Subscribed

Pull request Pull request review Pull request review comment


How I wish to use bulldozer

In my current set-up, I have a repository with 10+ branches and 10 of which (say B1 - B10) are mapped to 10 different development environments. Developers push code on these environments to get it tested via software testers.

Now, in this set-up, code-review is not possible as everyone is allowed to push to the master branch as the repository is not being operated in Github's organization mode. for this we wish to move this repository to organization mode.

Now, once we move it to organization mode, our CD tool (Deploybot) shall start to fail as the repository URL shall change. For development environments, we have automated deployments. Once the repository is moved to organization structure, these automated deployments for development environments would not stay fully automated as a PR would need to be created by the developer which would need to be approved by someone post which it would be deployed by Deploybot.

We want that our automated deployments do not get hampered by our movement to organization mode for development environments. Hence, we need bulldozer to auto-merge PRs for all the branches except the master branch.

Although, this is not happening as bulldozer is failing with HTTP 500. I understand that there could be some issue with the permissions that I have set-up. But I have no idea which all permissions should I grant in order for bulldozer to work. Please see the logs below:

{"level":"error","rid":"bjr5onvhkhle77578ueg","github_event_type":"pull_request","github_delivery_id":"c0ce93b0-86bf-11e9-82f7-8c4c8228258f","error":"failed to get pull request OWNER/REPO#129: Get https://api.github.com/repos/OWNER/REPO/pulls/129: could not refresh installation id 1100173's token: received non 2xx response status "404 Not Found" when fetching https://api.github.com/installations/1100173/access_tokens\ngithub.com/palantir/bulldozer/server/handler.(*PullRequest).Handle\n\t/go/src/github.com/palantir/bulldozer/server/handler/pull_request.go:61\ngithub.com/palantir/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp.(*eventDispatcher).ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go:118\ngithub.com/palantir/bulldozer/vendor/goji%2eio.dispatch.ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/goji.io/dispatch.go:17\ngithub.com/palantir/bulldozer/vendor/goji%2eio.(*dispatch).ServeHTTP\n\t:1\ngithub.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear.Recover.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear/hatpear.go:107\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear.Catch.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear/hatpear.go:60\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.AccessHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:180\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.RequestIDHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:169\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/palantir/go-baseapp/baseapp.NewMetricsHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/palantir/go-baseapp/baseapp/middleware.go:55\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.NewHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:30\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/goji%2eio.(*Mux).ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/goji.io/mux.go:74\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1847\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333","time":"2019-06-04T11:56:15.646437006Z","message":"Unexpected error handling webhook request"}

Please help.

shammishailaj avatar Jun 04 '19 14:06 shammishailaj

Hey @shammishailaj,

The permissions and event subscriptions for the app are all listed under the deployments section of the README.md.

However, based on that error message you might have used the wrong identifier for the installation ID (or the webhook/ private key may be incorrect).

asvoboda avatar Jun 04 '19 14:06 asvoboda

Thanks @asvoboda. Giving all those permissions did help. Now my PR got auto-approved and merged.

But, I am still getting error logs on the docker container:

{"level":"error","rid":"bjrmmonhkhle774nr0j0","github_event_type":"push","github_delivery_id":"49a6d020-8761-11e9-8dc1-f3b08d972715","error":"failed to determine open pull requests matching the push change: failed to list pull requests for repository OWNER/REPO: Get https://api.github.com/repos/OWNER/REPO/pulls?per_page=100&state=open: could not refresh installation id 0's token: received non 2xx response status "404 Not Found" when fetching https://api.github.com/installations/0/access_tokens\ngithub.com/palantir/bulldozer/pull.ListOpenPullRequests\n\t/go/src/github.com/palantir/bulldozer/pull/pull_requests.go:80\ngithub.com/palantir/bulldozer/pull.ListOpenPullRequestsForRef\n\t/go/src/github.com/palantir/bulldozer/pull/pull_requests.go:50\ngithub.com/palantir/bulldozer/server/handler.(*Push).Handle\n\t/go/src/github.com/palantir/bulldozer/server/handler/push.go:63\ngithub.com/palantir/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp.(*eventDispatcher).ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/palantir/go-githubapp/githubapp/dispatcher.go:118\ngithub.com/palantir/bulldozer/vendor/goji%2eio.dispatch.ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/goji.io/dispatch.go:17\ngithub.com/palantir/bulldozer/vendor/goji%2eio.(*dispatch).ServeHTTP\n\t:1\ngithub.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear.Recover.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear/hatpear.go:107\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear.Catch.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/bluekeyes/hatpear/hatpear.go:60\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.AccessHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:180\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.RequestIDHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:169\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/palantir/go-baseapp/baseapp.NewMetricsHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/palantir/go-baseapp/baseapp/middleware.go:55\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog.NewHandler.func1.1\n\t/go/src/github.com/palantir/bulldozer/vendor/github.com/rs/zerolog/hlog/hlog.go:30\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/palantir/bulldozer/vendor/goji%2eio.(*Mux).ServeHTTP\n\t/go/src/github.com/palantir/bulldozer/vendor/goji.io/mux.go:74\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1847\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333","time":"2019-06-05T07:12:34.378611964Z","message":"Unexpected error handling webhook request"}

Any idea why this might be happening?

shammishailaj avatar Jun 05 '19 07:06 shammishailaj

In the first error message you had set the installation id to 1100173, but the logs suggest this is now set to 0. The value should be set to the number that exists as the App ID on the github app settings page: https://github.com/settings/apps/<app-name>

asvoboda avatar Jun 06 '19 08:06 asvoboda

I have the integration_id set as as 32XXX which is what is set-up in bulldozer.yml's github section.

I am not sure where is this installation ID coming from.

shammishailaj avatar Jun 06 '19 09:06 shammishailaj