chdsbd / kodiak

🔮 A bot to automatically update and merge GitHub PRs

Home Page:https://kodiakhq.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Self-hosted not working in heroku

tamalsaha opened this issue · comments

Thanks for this incredibly useful too. I tried to deploy this in heroku following your instructions. But it does not work. And I am not sure how to debug. One thing I noticed in heorku applications logs is that I seeting lots of 400 status codes like below:

2021-01-30T22:52:01.104454+00:00 app[web.1]: INFO uvicorn:httptools_impl.py:436 ('10.52.12.238', 14061) - "POST /api/github/hook HTTP/1.1" 400
2021-01-30T22:52:01.104958+00:00 heroku[router]: at=info method=POST path="/api/github/hook" host=kodiak-appscode.herokuapp.com request_id=1ab16619-028b-4d6d-96ea-669e05382261 fwd="140.82.115.148" dyno=web.1 connect=0ms service=2ms status=400 bytes=190 protocol=https

Do you have any ideas/hints on how to debug this?

My guess is there's a problem with the private key or app ID. You can view web hook API responses in the GitHub UI:
Screen Shot 2021-01-30 at 6 06 56 PM

https://github.com/settings/apps/your-app-name-here/advanced

I'd also try setting up Sentry and configuring the SENTRY_DSN environment variable as mentioned in the docs: https://kodiakhq.com/docs/self-hosting

Thanks, @chdsbd . I am seeing {"detail":"Missing required signature: X-Hub-Signature"} error in Github webhook logs.

GitHub-Apps-kodiak-appscode

You need to setup a secret token for the web hook. Kodiak uses the token to verify the authenticity of the web hook requests.

https://docs.github.com/en/developers/webhooks-and-events/securing-your-webhooks#setting-your-secret-token

Screen Shot 2021-01-30 at 6 40 35 PM

Thank you! It is working now.

@tamalsaha @chdsbd Could let me know what is environment variable name that needs to be declared in Heroku side for webhook secret?
Screen Shot 2022-04-10 at 12 57 12 am