Skip to content

SvelteKit Demo + Sentry wizard: Sentry.diagnoseSdkConnectivity() bad request (is this actually expected?) #16226

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

Open
3 tasks done
ktarmyshov opened this issue May 7, 2025 · 4 comments

Comments

@ktarmyshov
Copy link

ktarmyshov commented May 7, 2025

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/sveltekit

SDK Version

"version": "9.16.1",

Framework Version

SvelteKit, latest

Link to Sentry event

N/A

Reproduction Example/SDK Setup

Browser exception, tried to wrap into try/catch - no effect
There is no exception, just bad request and undefined is returned.

Console.output

+page.svelte:17 
            
            
POST https://o447951.ingest.sentry.io/api/1337/envelope/?sentry_version=7&sentry_key=1337&sentry_client=sentry.javascript.browser%2F1.33.7 400 (Bad Request)
window.fetch @ fetcher.js:66
(anonymous) @ fetch.ts:81
tt @ diagnose-sdk.ts:27
(anonymous) @ +page.svelte:17
En @ utils.js:39
(anonymous) @ lifecycle.js:51
pn @ runtime.js:1017
$effect @ lifecycle.js:51
bt @ runtime.js:414
be @ runtime.js:580
_n @ runtime.js:706
xt @ runtime.js:677
setTimeout
(anonymous) @ browserapierrors.ts:106
(anonymous) @ client.js:2369
r @ helpers.ts:116
requestAnimationFrame
(anonymous) @ browserapierrors.ts:112
Z.type @ client.js:2368
(anonymous) @ client.js:2367
r @ helpers.ts:116

Steps to Reproduce

git clone [email protected]:kt-npm-modules/svelte-adapter-azure-swa.git
cd svelte-adapter-azure-swa
npm ci:all
cd tests/demo
npm run build
npm run preview

Click through Home, About, Sverdle, and "Sentry Example"

Expected Result

I suppose no error should happen for calling this method created by wizard

Actual Result

Bad request + uncatchable error

@ktarmyshov ktarmyshov added the Bug label May 7, 2025
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 7, 2025
@ktarmyshov ktarmyshov changed the title SvelteKit Demo + Sentry wizard: Sentry.diagnoseSdkConnectivity() bad request + uncatchable exception SvelteKit Demo + Sentry wizard: Sentry.diagnoseSdkConnectivity() bad request (is this actually expected?) May 7, 2025
@lforst
Copy link
Member

lforst commented May 8, 2025

This request failing is more or less intended. The diagnoseSdkConnectivity() function is simulating a request to the Sentry ingestion endpoint to figure out whether Sentry is reachable and more importantly whether there are any ad blockers active in the browser. We're not sending an actual payload to Sentry, we're just testing for connectivity - which would be blocked in the case of ad blockers. Does the failed request show up in the browser? Yes. Does it matter? No.

It obviously confused you so I am thinking we should maybe do something about it.

My main idea would be to have some rule in our infra that always 200s for a particular set of org/project/client-key combination.

@ktarmyshov
Copy link
Author

Just a comment to sentry sample page from wizard and in document will do - expect bad request but it's fine ignore.

lol wasted time 😂🤦 of two or more ppl. No need for rules.

You are right, I was thinking smth wrong with my setup.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 8, 2025
@lforst lforst reopened this May 8, 2025
@lforst
Copy link
Member

lforst commented May 8, 2025

Gonna reopen cause I think this is indeed confusing and we can fix it.

@lforst
Copy link
Member

lforst commented May 9, 2025

current state: I raised internally that we may want to have a hardcoded rule in nginx that always returns a 200 with a specific message for exactly POST https://o1337.ingest.sentry.io/api/1337/envelope/?sentry_version=1337&sentry_key=1337&sentry_client=sentry.javascript.browser%2F1.33.7

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

No branches or pull requests

2 participants