self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Self hosted login opens wrong url

Open JeremiaAu opened this issue 1 year ago • 11 comments

Environment

self-hosted Sentry

Windows Computer sentry-cli-Windows-x86_64.exe version 2.30.5

Steps to Reproduce

Using the command Line:

sentry-cli-Windows-x86_64.exe --url https://sentry.example.com/ login

This helps you signing in your sentry-cli with an authentication token. If you do not yet have a token ready we can bring up a browser for you to create a token now.

Sentry server: sentry.example.com Open browser now? [y/n] y

Expected Result

Relevant Settings Page pops up.

e.g.: https://sentry.example.com/settings/account/api/auth-tokens/ or: https://sentry.example.com/settings/[org-slug]/auth-tokens/

Actual Result

"Page Not Found" https://sentry.example.com/orgredirect/organizations/:orgslug/settings/auth-tokens/

JeremiaAu avatar Apr 23 '24 12:04 JeremiaAu

@JeremiaAu what version of Sentry self-hosted are you using? If you are on an older version, it is possible that the sentry-cli login command is not compatible with your self-hosted instance, since the URL for generating a token is different in the older version.

szokeasaurusrex avatar Apr 23 '24 13:04 szokeasaurusrex

I use the most recent version: 24.4.1

JeremiaAu avatar Apr 23 '24 14:04 JeremiaAu

Okay, thanks for confirming, @JeremiaAu.

I was able to reproduce this problem by running the Sentry development server locally, then running the login command directed at the development server's URL, like so:

sentry-cli --url=http://localhost:8000 login

I suspect that this issue is caused by a problem in the Sentry backend, not the CLI, since the command works fine against Sentry SaaS. So, I am transferring this issue to the getsentry/sentry repository, so the team that maintains the Sentry backend can try to investigate this issue.

To whoever triages this issue in getsentry/sentry: please reach out to me if you determine that any changes are needed in the CLI.

szokeasaurusrex avatar Apr 23 '24 15:04 szokeasaurusrex

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Apr 23 '24 15:04 getsantry[bot]

Just to be clear: the literal URL it is redirecting to is https://sentry.example.com/orgredirect/organizations/:orgslug/settings/auth-tokens/, or does it actually correctly sub in your org slug for :orgslug?

azaslavsky avatar Apr 26 '24 17:04 azaslavsky

Yes, that is the literal URL.

JeremiaAu avatar Apr 26 '24 18:04 JeremiaAu

@szokeasaurusrex Since you have context here, do you have a recommendation on which team this issue should go to? This is a self-hosted specific issue but we don't work with this part of the codebase.

hubertdeng123 avatar Apr 30 '24 00:04 hubertdeng123

I think it would be easiest for the sentry-cli team to replace the current URL with the following one, since it has no orgslug: https://sentry.example.com/settings/account/api/auth-tokens/

JeremiaAu avatar Apr 30 '24 12:04 JeremiaAu

@szokeasaurusrex What do you think about this?

hubertdeng123 avatar May 01 '24 21:05 hubertdeng123

Does any one have temporary solution for this ?

houssemamiri-logient avatar May 29 '24 21:05 houssemamiri-logient

Does any one have temporary solution for this ?

You could just create the file by hand: https://docs.sentry.io/cli/configuration/#to-authenticate-manually

JeremiaAu avatar May 29 '24 21:05 JeremiaAu