Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self hosted login opens wrong url #2998

Open
JeremiaAu opened this issue Apr 23, 2024 · 11 comments
Open

Self hosted login opens wrong url #2998

JeremiaAu opened this issue Apr 23, 2024 · 11 comments

Comments

@JeremiaAu
Copy link

JeremiaAu commented Apr 23, 2024

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/

@szokeasaurusrex
Copy link
Member

@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.

@JeremiaAu
Copy link
Author

I use the most recent version: 24.4.1

@szokeasaurusrex
Copy link
Member

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 szokeasaurusrex transferred this issue from getsentry/sentry-cli Apr 23, 2024
@getsantry
Copy link

getsantry bot commented Apr 23, 2024

Assigning to @getsentry/support for routing ⏲️

@dalnoki dalnoki transferred this issue from getsentry/sentry Apr 25, 2024
@azaslavsky
Copy link
Contributor

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?

@JeremiaAu
Copy link
Author

JeremiaAu commented Apr 26, 2024

Yes, that is the literal URL.

@hubertdeng123
Copy link
Member

@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.

@JeremiaAu
Copy link
Author

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/

@hubertdeng123
Copy link
Member

@szokeasaurusrex What do you think about this?

@houssemamiri-logient
Copy link

Does any one have temporary solution for this ?

@JeremiaAu
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Waiting for: Product Owner
Status: No status
Development

No branches or pull requests

5 participants