getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.89k stars 1.77k forks source link

[On-Premise 24.8.0] Email invitation links become invalid immediately after sending #3305

Open kostik2022 opened 2 months ago

kostik2022 commented 2 months ago

Environment self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce send an invitation email from /settings/sentry/members/ with "Resend Invitation".

click Join your team button in the received mail

Expected Result The invitation link must function properly.

Actual Result A message will appear on the web page that opens. "This organization invite link is no longer valid.

Product Area Settings - Members

Link No response

DSN No response

Version 24.8.0

Look like it was mentioned in https://github.com/getsentry/self-hosted/issues/2561. I faced this issue after upgrade from 23.5.1. NONE of hard stops are missed.

kostik2022 commented 2 months ago

...workaround with Incognito browser mode not works.

hubertdeng123 commented 2 months ago

Are there any logs that could be useful here? I am unable to reproduce this

MarkCorneth commented 1 month ago

Any updates regarding this issue? Or maybe a workaround by accepting/updating without the link?

MarkCorneth commented 1 month ago

Are there any logs that could be useful here? I am unable to reproduce this

I've checked what happens during the accept invitation process and the page loads normally but the next request (/api/0/accept-invite) returns a bad request response indicating the link is incorrect. I checked the database but the link is there in the sentry_organizationmember table. There is an exception in the Django request.

Logs from docker

web-1   | 08:53:55 [INFO] sentry.access.api: api.access (method='GET' view='sentry.web.frontend.react_page.GenericReactPageView' response=200 user_id='1' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/' caller_ip='PERSONAL_IP' user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.09740138053894043 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:55 +0000] "GET /accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/ HTTP/1.0" 200 7665 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:55 +0000] "GET /_static/1726649266/sentry/js/ads.js HTTP/1.0" 200 33 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:55 +0000] "GET /_static/1726649266/sentry/images/sentry-loader.svg HTTP/1.0" 200 1009 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:57 +0000] "GET /api/0/internal/health/ HTTP/1.0" 200 0 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:57 +0000] "GET /_static/1726649266/sentry/images/favicon.png HTTP/1.0" 200 853 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
web-1   | 08:53:57 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.assistant.AssistantEndpoint' response=200 user_id='1' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/api/0/assistant/' caller_ip='PERSONAL_IP' user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.047925710678100586 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:57 +0000] "GET /api/0/assistant/ HTTP/1.0" 200 1082 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:57 +0000] "GET /_static/1726649266/sentry/images/favicon-dark.png HTTP/1.0" 200 852 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
web-1   | 08:53:57 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.accept_organization_invite.AcceptOrganizationInvite' response=400 user_id='1' is_app='False' token_type='None' is_frontend_request='True' organization_id='None' auth_id='None' path='/api/0/accept-invite/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/' caller_ip='PERSONAL_IP' user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.02385258674621582 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
web-1   | 08:53:57 [WARNING] django.request: Bad Request: /api/0/accept-invite/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/ (status_code=400 request=<WSGIRequest: GET '/api/0/accept-invite/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/'>)
nginx-1 | PERSONAL_IP - - [18/Sep/2024:08:53:57 +0000] "GET /api/0/accept-invite/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/ HTTP/1.0" 400 33 "https://REDACTED/accept/21/9c0608d29c0f1fc1880e1c5f2f433f8072f28f799f6e29ca73a10b68c91faf2d/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "PERSONAL_IP"
hubertdeng123 commented 1 month ago

Hmmm, maybe the system url prefix is wrong then? I'm not quite sure what else might be the case here. It may be useful to enable debug mode for logging. You can do this here: https://develop.sentry.dev/application/config/#logging

MarkCorneth commented 1 month ago

I've checked the config, but the url-prefix is configured to match the domain where sentry is accessed:

./sentry/config.yml:system.internal-url-prefix: 'http://web:9000'
./sentry/config.yml:system.url-prefix: "https://sentry.OUR_DOMAIN"

I've also enabled LOGGING['default_level'] = 'DEBUG' to the ./sentry/sentry.conf.py file, but I'm not seeing more information in the docker container logs.

MarkCorneth commented 1 month ago

I'm using the latest version Sentry 24.9.0

hubertdeng123 commented 1 month ago

Unfortunately, I don't have any more ideas then.

getsantry[bot] commented 1 week ago

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 🥀

BYK commented 3 days ago

@MarkCorneth were you able to resolve this issue?

MarkCorneth commented 3 days ago

@BYK No, still not able to get the link working. My best guess is that a database migration failed during updating the version of Sentry