Github integration problem

Hi! I am trying to set up github integration with sentry according to this doc:

When I click Install on github application setup, I see screen with 500 error. Logs looks like:

sentry_1    | 16:37:48 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'https://hostname/extensions/github/setup/?installation_id=xxxxx&setup_action=install' ip_address=u'xx.xx.xx.xx' method=u'GET')
sentry_1    | 16:37:48 [INFO] sentry.identity: identity.token-exchange-error (pipeline_state=u'xxx' error=u'invalid_state')

In my config.yml I have:

github-app.id: 12345
github-app.name: 'sentry-apptest'
github-app.private-key: "key here"
github-app.client-id: 'clientid'
github-app.client-secret: 'secret'

What is the best way to debug and fix this error?

Can you provide more details around at which step this issue happens?

Also giving more details about your Sentry instance like its version, whether you are using our on-premise repo or a custom installation, whether you are using HTTPS etc. would all help.

Hi! This happens right after I click ‘Install’ in github app popup window. I see error in browser and error in logs.

I do use SSL, in my config I have env SENTRY_USE_SSL=1.
I run with docker-compose with ‘image: sentry’.
I use nginx as proxy and manage certs with lets encrypt. Nginx config is from official docs.

After this error github app is installed on the account, but in sentry there are no integrations installed.

What else should I add?

@BYK Any ideas?

I’ve seen this happen when the hostnames used for integration and actual hostnames assumed by the services does not match, for example you connect to sentry via CNAME, or shortned name that is in the search path (http://sentry oppose to http://sentry.company.internal).

This can also happen if one side uses TLS, and the other one doesn’t, or the certs cannot be validated.

1 Like

How can I debug this? Where I can set or at least see this name?
Certs are from LE and handled by nginx.

I manually had to modify the python code to dump out the response body to see what the issue was.

Could you please tell me few tricks about it? Not so experienced with python.

I suggested a few things to check first, verify they do not fix the problem.

Thing is I have no idea how to check these things. Any advices on how to check them?

maybe any other useful thought about how to find the problem?