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

Quite confusing log message #2137

Closed
lforst opened this issue Sep 2, 2024 · 9 comments · Fixed by #2143
Closed

Quite confusing log message #2137

lforst opened this issue Sep 2, 2024 · 9 comments · Fixed by #2143
Assignees

Comments

@lforst
Copy link
Member

lforst commented Sep 2, 2024

WARN 2024-09-02 14:41:35.566111677 +00:00 Using https://sentry.io (embedded in token) rather than manually-configured URL https://sentry.io. To use https://sentry.io, please provide an auth token for this URL.

I am getting this in our Changelog Vercel logs. https://vercel.com/sentry/changelog/DT2tEb1huCLLTUm7DzDaWawhZHzi#L159

IMO, if the manually provided URL, and the URL in the auth token are matching, we should not print this message.

cc @szokeasaurusrex

@szokeasaurusrex
Copy link
Member

strange – I thought I was only printing this when the two URLs are different, but I will double check

@szokeasaurusrex
Copy link
Member

Okay, looks like in one of the places we emit this message we check whether the URLs are different, but in the other spot, we don't:

sentry-cli/src/config.rs

Lines 74 to 83 in 288382f

let url = if token_url.is_empty() {
default_url
} else {
if !default_url.is_empty() {
log::warn!(
"Using {token_url} (embedded in token) rather than manually-configured URL {default_url}. \
To use {default_url}, please provide an auth token for this URL."
);
}
token_url.into()

Should be a pretty simple fix to add this check, thanks for raising @lforst!

@szokeasaurusrex szokeasaurusrex self-assigned this Sep 2, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Sep 4, 2024
@dmadridy
Copy link

dmadridy commented Sep 4, 2024

Hey, just got this message as well when configuring Sentry. Let me know when its solved. Thanks!

@szokeasaurusrex
Copy link
Member

@dmadridy hopefully we will get a fix out this week!

@getsantry getsantry bot removed the status in GitHub Issues with 👀 3 Sep 5, 2024
szokeasaurusrex added a commit that referenced this issue Sep 5, 2024
Previously, we warned about a mismatch between the auth token URL and the manually configured URL even when they were the same. We also sometimes issued the warning when no URL was manually configured (i.e. when the default https://sentry.io/ was used).

Now, we only warn when the two are actually different and we also only warn if a URL was actually manually configured.

Fixes #2137
szokeasaurusrex added a commit that referenced this issue Sep 5, 2024
Previously, we warned about a mismatch between the auth token URL and the manually configured URL even when they were the same. We also sometimes issued the warning when no URL was manually configured (i.e. when the default https://sentry.io/ was used).

Now, we only warn when the two are actually different and we also only warn if a URL was actually manually configured.

Fixes #2137
szokeasaurusrex added a commit that referenced this issue Sep 5, 2024
Previously, we warned about a mismatch between the auth token URL and the manually configured URL even when they were the same. We also sometimes issued the warning when no URL was manually configured (i.e. when the default https://sentry.io/ was used).

Now, we only warn when the two are actually different and we also only warn if a URL was actually manually configured.

Fixes #2137
@szokeasaurusrex
Copy link
Member

@dmadridy @lforst, the fix has been released in Sentry CLI v2.35.0.

@absolutegravitas
Copy link

yeesh... What is the actual patch and what does this mean? I have a repo https://github.com/midday-ai/v1 whose deployment to vercel fails because of this unnecessarily confusing message . Upgrading packages for that repo doesnt fix the issue (it's got @sentry/nextjs package).

  • do i remove https prefix?
  • do i provide auth token again?
  • do i remove the https suffix towards the end?

yeesh

Image

@lforst
Copy link
Member Author

lforst commented Sep 9, 2024

@absolutegravitas The log message is confusing but it should not fail your build. You can basically ignore it.

@vonox7
Copy link

vonox7 commented Dec 12, 2024

@szokeasaurusrex I'm using sentry-cli 2.39.1, however I still get the warning when calling sentry-cli --url https://example.org/ sourcemaps upload --org example --project example-project ./dist/example-project:

WARN 2024-12-12 12:57:54.724962 +01:00 Using https://example.org (embedded in token) rather than manually-configured URL https://example.org/. To use https://example.org/, please provide an auth token for this URL.

Note the missing trailing slash in the first url (embedded in token): I created the token via https://example.org/settings/arivo/auth-tokens/new-token/. However, when adding the sentry-cli to my Angular project with npx @sentry/wizard@latest -i sourcemaps (version 3.36.0) the wizard added the following line to the package.json, which contains the trailing slash on the url:

"sentry:sourcemaps": "sentry-cli sourcemaps inject --org example --project example-project ./dist/example-project && sentry-cli --url https://example.org/ sourcemaps upload --org example --project og-frontend-cx ./dist/example-project".

So the workaround is to remove in package.json the trailing slash from the url:
https://example.org/ --> https://example.org.

@szokeasaurusrex
Copy link
Member

szokeasaurusrex commented Dec 12, 2024

@vonox7 this seems to be a bug/unintended behavior in the Sentry Wizard. If you are providing an auth token which embeds a URL, the Sentry Wizard should preferably avoid specifying any URL in the package.json, since Sentry CLI always will just use the URL embedded in the token.

I will raise this with the correct team


Update: discussed with the team. The behavior will likely stay the same in the Sentry Wizard for now due to backwards-compatibility concerns, but we can improve the logic for comparing the URLs in the Sentry CLI. In the meantime, you can safely ignore this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants