Skip to content

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

Closed

Description

@ktarmyshov

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 git@github.com: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

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 7, 2025
  2. 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?)[/+] on May 7, 2025
  3. lforst commented on May 8, 2025

    @lforst
    Contributor

    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.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 8, 2025
  5. ktarmyshov commented on May 8, 2025

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

  6. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 8, 2025
  7. reopened this on May 8, 2025
  8. lforst commented on May 8, 2025

    @lforst
    Contributor

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

  9. lforst commented on May 9, 2025

    @lforst
    Contributor

    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

  10. self-assigned this
    on Jul 8, 2025
  11. added theissue type on Jul 8, 2025
  12. Lms24 commented on Jul 8, 2025

    @Lms24
    Member

    Hey @ktarmyshov quick update: I opened and merged #16840 to avoid getting the 400 response. Coincidentally, this also came up in #16818 so I think it was a valuable fix. The fix should go out with the next SDK release sometime later this week.

  13. ktarmyshov commented on Jul 8, 2025

    @ktarmyshov
    Author

    @Lms24 thank you!

  14. github-actions commented on Jul 9, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #16840, which was included in the 9.36.0 release.

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

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions