Private Bors-ng returning 400 Internal server error

I have managed to have bors-ng run on Docker (Mesos orchestrator), successfully connect and migrate the postgres database and start listening for requests on :4000 . I can connect to the dashboard using the PUBLIC_HOST url.

14:48:18.282 [info] Running BorsNG.Endpoint with Cowboy using http://0.0.0.0:4000

The following ENV variables are populated:

"GITHUB_INTEGRATION_PEM": "<secret>",
"PUBLIC_HOST": "bors.<secret>.com",
"DATABASE_URL": "<secret>",
"DATABASE_USE_SSL": "false",
"GITHUB_CLIENT_ID": "<secret>",
"ALLOW_PRIVATE_REPOS": "true",
"SECRET_KEY_BASE": "<secret>",
"PORT": "4000",
"GITHUB_CLIENT_SECRET": "<secret>",
"GITHUB_WEBHOOK_SECRET": "<secret>",
"GITHUB_INTEGRATION_ID": "<secret>",
"MIX_ENV": "prod"

I’m having an issue where every call made from GitHub to the bors webhook is returning 400 Internal Server Error. I can see the errors both in the GitHub App -> advanced, and in the stdout of the bors-ng container.

14:49:01.971 request_id=ci0rdqnna0cdmju8pgb2mkeri7l2uhlp [info] POST /webhook/url
14:49:01.975 request_id=ci0rdqnna0cdmju8pgb2mkeri7l2uhlp [info] Sent 400 in 3ms
15:00:00.747 request_id=qbod94t9cg4lov1kefag2rlv53b55kfs [info] POST /webhook/url
15:00:00.747 request_id=qbod94t9cg4lov1kefag2rlv53b55kfs [info] Sent 400 in 183µs
15:00:04.671 request_id=c4f7ql0k97g9f9gtj99n6kb6vpp3g71s [info] POST /webhook/url
15:00:04.671 request_id=c4f7ql0k97g9f9gtj99n6kb6vpp3g71s [info] Sent 400 in 230µs

For every delivery, GitHub gets the following response:

Headers
cache-control: max-age=0, private, must-revalidate
Connection: keep-alive
Content-Length: 21
content-type: text/html; charset=utf-8
date: Mon, 19 Mar 2018 14:49:01 GMT
server: Cowboy
x-request-id: ci0rdqnna0cdmju8pgb2mkeri7l2uhlp

Body
Internal server error

I have tried removing/setting a webhook secret, adding/removing MIX_ENV=prod, verifying the variables were populated using docker inspect and I’m not sure what else I need to check.

1 Like

It’s not supposed to be /webhook/url – It’s supposed to be /webhook/github

True, I’ve modified the url to be /webhook/github, thanks! I now get 404 Page not found when I comment “bors try” on a PR. When I delete the comment, bors returns a 200.

1 Like

Remove the repo from GitHub’s UI, then re-add it.

@vathanalen did it work?

2 posts were split to a new topic: Bors fails to merge if master is updated while a build is running

Yes, removing and re-adding the repo did the trick.