sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Github Integration Broken

Open geofferyj opened this issue 1 year ago • 22 comments

Self-Hosted Version

24.5.1

CPU Architecture

x86_64

Docker Version

26.1.3

Docker Compose Version

2.27.0

Steps to Reproduce

follow the instructions to add github integration from here

Expected Result

after following the instructions, I expect that on the integrations page, when I click on add integration it should begin the integration flow

Actual Result

after setting all the configurations, re-running ./install.sh

in the integrations page, when Add Installation button is clicked, it just redirects me to the home page of my self hosted sentry. and I can't login again as the login page is missing.

https://github.com/getsentry/self-hosted/assets/15072297/93c3ec15-f6de-4324-83a8-3b4029723e06

https://github.com/getsentry/self-hosted/assets/15072297/e842a330-4408-451d-a501-03e072a87b02

Please take a look at the videos above.

Event ID

No response

geofferyj avatar Jun 07 '24 04:06 geofferyj

Hello, the GitHub integration is not broken. The docs is just misleading for now. There is a PR waiting to be merged here: https://github.com/getsentry/develop/pull/1235/files -- you should follow that one, add that additional config. I've pinged the related codeowners yet I don't get any response either, so we'll have to make do for now.

aldy505 avatar Jun 10 '24 06:06 aldy505

I don't know if I am doing something wrong but the integration still didn't work, SSO works now though.

when registration is enabled, signin with email and password is unavailable I thought the integration flow will be the same as hosted sentry, clicking on add integration just takes you to the github app then back. please refer to the video below (PS. No detrimental info in the video)

https://github.com/getsentry/self-hosted/assets/15072297/3c909796-e05c-4882-b20f-9d32b7265e28

geofferyj avatar Jun 10 '24 10:06 geofferyj

I've taken a look at the docs PR up above. The integration flow is not the same as SaaS Sentry here, have you confirmed that you have set the appropriate callback urls?

hubertdeng123 avatar Jun 11 '24 20:06 hubertdeng123

yes I have confirmed that the URLs are correct.

geofferyj avatar Jun 11 '24 22:06 geofferyj

Based on the behavior, it seems like perhaps there may be an error there somewhere, since it is redirecting you back without completing installation. What is the url you are being redirected to after clicking install and authorize?

hubertdeng123 avatar Jun 13 '24 21:06 hubertdeng123

it takes me back to home

here are the relevant URLs configured

public link: https://github.com/apps/penilabs-monitoring home-url:https://monitoring.penilabs.com

callback URLs: - https://monitoring.penilabs.com/auth/sso/ - https://monitoring.penilabs.com/extensions/github/setup/

webhook-url: https://monitoring.penilabs.com/extensions/github/webhook/

Update: if I remove https://monitoring.penilabs.com/auth/sso/, integration works but sso stops working then I add it back and everything seems to be working how

does the order of the callbacks matter?

geofferyj avatar Jun 14 '24 04:06 geofferyj

Update: if I remove https://monitoring.penilabs.com/auth/sso/, integration works but sso stops working then I add it back and everything seems to be working how

So it works when you reverse the order of the callback URLs? I do not believe order should matter, but I am also not super well-versed in the specifics of this extension or the GitHub API.

azaslavsky avatar Jun 17 '24 21:06 azaslavsky

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Jul 09 '24 07:07 getsantry[bot]

@aldy505 @azaslavsky why is this closed? It still doesn't work in 24.7.1. The app is installed, and callbacks are configured as per the documentation, but Sentry still shows it as "Not installed", and the integration isn't working.

Image

Image

Image

Image

leshik avatar Jul 25 '24 17:07 leshik

@aldy505 @azaslavsky why is this closed?

All issues that has no activities within 2 weeks and have "Waiting For: Community" label will be closed by the bot.

It still doesn't work in 24.7.1. The app is installed, and callbacks are configured as per the documentation, but Sentry still shows it as "Not installed", and the integration isn't working.

Can you show what's being logged at the web container during the time you pressed the "Add Installation" button? sudo docker compose logs -t -n 1000 web. But I'd also guess there is a wrong configuration somewhere.

aldy505 avatar Jul 26 '24 00:07 aldy505

Can you show what's being logged at the web container during the time you pressed the "Add Installation" button? sudo docker compose logs -t -n 1000 web. But I'd also guess there is a wrong configuration somewhere.

@aldy505 here it is:

web-1  | 00:36:30 [INFO] sentry.access.api: api.access (method='GET' view='sentry.web.frontend.organization_integration_setup.OrganizationIntegrationSetupView' response=302 user_id='1' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/organizations/wevention-yupi/integrations/github/setup/' caller_ip='189.141.190.105' user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.07597708702087402 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
web-1  | 00:36:31 [INFO] sentry.access.api: api.access (method='GET' view='sentry.web.frontend.pipeline_advancer.PipelineAdvancerView' response=302 user_id='1' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/extensions/github/setup/' caller_ip='189.141.190.105' user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=1.0010111331939697 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')

leshik avatar Jul 26 '24 00:07 leshik

@aldy505 I'd be happy if there was a misconfiguration somewhere, but I triple-checked with the docs. Is there anything else I can do to troubleshoot the issue?

leshik avatar Jul 27 '24 16:07 leshik

I really hope it's a config issue. @aldy505 could you help with that?

noma4i avatar Jul 29 '24 04:07 noma4i

@leshik @noma4i I can't really help out here since I've done the GitHub integration just once on my Sentry instance. The best bet is to just create a new issue, adding the steps you've done and the container logs, then we can ping the integration team (the one that handles the third-party integration stuff).

Nit: I don't like continuing on this issue because I don't really like the idea of reusing issues that have vague titles. For this one: "Github Integration Broken", which part is broken?

aldy505 avatar Jul 29 '24 04:07 aldy505

which part is broken?

The code/issues integration. Authentication part works.

leshik avatar Jul 29 '24 13:07 leshik

https://github.com/getsentry/self-hosted/issues/3247

noma4i avatar Aug 07 '24 06:08 noma4i

Auto-routing to @getsentry/product-owners-settings-integrations for triage ⏲️

getsantry[bot] avatar Aug 07 '24 23:08 getsantry[bot]

edit: see my comment below

cathteng avatar Aug 08 '24 00:08 cathteng

Any updates on that?

noma4i avatar Aug 11 '24 05:08 noma4i

Small update that @cathteng is investigating this issue.

leedongwei avatar Aug 22 '24 23:08 leedongwei

@noma4i This seems unrelated to https://github.com/getsentry/sentry/issues/76018

Can you try it with the config I posted above? Without the extra callback URL (but with the optional post-installation setup URL)?

cathteng avatar Aug 26 '24 16:08 cathteng

@leshik do you have the extra post-setup URL? I think you commented on the issue linked to this one, which is unrelated to this issue.

cathteng avatar Aug 26 '24 21:08 cathteng

@leshik do you have the extra post-setup URL? I think you commented on the issue linked to this one, which is unrelated to this issue.

I tried all the options. Without the setup callback URL, clicking the button opens a window with the same Sentry page instead of Github app.

leshik avatar Aug 28 '24 02:08 leshik

I reconfigured my GitHub app for local development. I have the following settings and was not able to reproduce the error.

Image

If you are able to share more details about what you are attempting that might help. e.g. what flow do you see when you click Add Installation? If you are seeing the screen with "Configure" then the app should already be installed -- please check the "Configurations" tab on the GitHub integration page. You may need to uninstall the app and then reinstall.

cathteng avatar Aug 28 '24 04:08 cathteng

@cathteng more details are here with the video, and the setup is exact same as yours.

leshik avatar Aug 28 '24 17:08 leshik

@leshik if you see the screen with "Configure" it means the app is already installed, possibly on another organization. We don't support connecting multiple sentry instances with a single Github organization. Can you please try uninstalling the GIthub app and retrying the installation process from Sentry?

cathteng avatar Aug 28 '24 17:08 cathteng

@cathteng It's the same organization. We tried this setup at least 3 times from the beginning, with different GitHub accounts. The result is 100% reproducible and is described in the ticket with the video I mentioned.

leshik avatar Aug 28 '24 17:08 leshik

I am able to reproduce the issue when the GItHub app is already installed on the GitHub organization / user. If I remove the GitHub app from the organization / user, then I am able to see the Install button. Do you still see "Configure" even if you completely uninstall the GitHub app in GitHub?

https://github.com/user-attachments/assets/c28c1b20-fa98-4550-8ff4-fbe54c8b8bdb

cathteng avatar Aug 28 '24 17:08 cathteng

I am able to reproduce the issue when the GItHub app is already installed on the GitHub organization / user. If I remove the GitHub app from the organization / user, then I am able to see the Install button.

Yeah, that helped. After uninstalling and then installing again it seems working. Weird, because that same process was already done previously from that same GitHub integration page. Thanks.

leshik avatar Aug 28 '24 18:08 leshik