getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.62k stars 4.13k forks source link

GitHub Integration: Unable to install GitHub Integration #18335

Closed roman-stelmakh-emesa closed 3 years ago

roman-stelmakh-emesa commented 4 years ago

I tried to install GitHub Integration on on-premise Sentry using this page https://docs.sentry.io/server/integrations/github/ After config.yml was changed and Sentry was reloaded, I went to /settings/${organization}/integrations and clicked Install GitHub Integration. I was redirected to my GitHub app, and I installed it and allowed all repositories. Then I was redirected back to the Sentry home page. There is no GitHub Integration on the integrations page, and a button Install is still there. However GitHub App show successful payload deliveries to /extensions/github/webhook/ and their statuses are always 204.

jakana-rbx commented 4 years ago

I am having the same problem.

As the docs say, I have setup the following keys:

github-app.id: ##### github-app.webhook-secret: ##### github-app.name: ##### github-app.private-key: ##### github-app.client-id: ##### github-app.client-secret: #####

As I continued debugging the issue I learned, from reviewing source, and this issue, that the webhook secret isn't actually optional and so added this as well.

jakana-rbx commented 4 years ago

@roman-stelmakh-emesa have you had any luck with this?

roman-stelmakh-emesa commented 4 years ago

@jakana-imb No, the problem still exists . I also set webhook secret, but it didn't help.

jakana-rbx commented 4 years ago

Thanks for getting back to me, same here. I'll post back if we ever get it working.

dehy commented 4 years ago

I have exactly the same problem. the /extensions/github/setup/ page redirect then to the homepage without any further setup.

Sentry 9.1.2 on docker

dehy commented 4 years ago

I fixed my problem (on sentry 9.1.2):

Unlike the official documentation says (which may be for sentry 10.0), I changed my User authorization callback URL from ${urlPrefix}/auth/sso/ to ${urlPrefix}/extensions/github/setup/, as indicated in https://github.com/getsentry/sentry/issues/12670#issuecomment-484165388

jakana-rbx commented 4 years ago

Interesting. I just tried that and get an error when the app redirects to the auth callback.

robbi5 commented 4 years ago

Had the same problem while trying to configure SSO with GitHub, logs showed {"message":"Resource not accessible by integration","documentation_url":"https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user"}.

Turns out, the required user:email scope seems not to be usable with an GitHub App, as the source says.

I finally had to create a seperate GitHub OAuth Integration and put the credentials from there as GITHUB_APP_ID and GITHUB_API_SECRET into sentry/sentry.conf.py.

djgalloway commented 3 years ago

Had the same problem while trying to configure SSO with GitHub, logs showed {"message":"Resource not accessible by integration","documentation_url":"https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user"}.

Turns out, the required user:email scope seems not to be usable with an GitHub App, as the source says.

I finally had to create a seperate GitHub OAuth Integration and put the credentials from there as GITHUB_APP_ID and GITHUB_API_SECRET into sentry/sentry.conf.py.

@robbi5 Did you create another "GitHub App" or just an OAuth App? Asking because I was able to get GitHub integration working by using a GitHub App but can't get SSO going.

EDIT: For anyone else struggling with this, you only need an OAuth App; not a GitHub App. https://github.com/organizations/YOURORG/settings/applications. But yeah, adding those variables to sentry/sentry.conf.py was the missing link for me.

BYK commented 3 years ago

@djgalloway the instructions on https://develop.sentry.dev/self-hosted/sso/#github-auth should set this up for both. Do you think they are accurate or misleading?

djgalloway commented 3 years ago

@djgalloway the instructions on https://develop.sentry.dev/self-hosted/sso/#github-auth should set this up for both. Do you think they are accurate or misleading?

I think what happened was I upgraded my on-premise sentry over a month ago and when I tried finding the GitHub SSO docs, I didn't find any. I hadn't bothered to search again the second time around I tried setting it up (last week) and by then, the docs had been written and committed :smile:

The docs are perfect though. Thank you!

BYK commented 3 years ago

Closing this then until somebody says docs are not perfect anymore 😁