I have a single IP address that is causing me to have 10,000+ errors due to Clerk JS not being able to refresh a token 😬 I have alerted the clerk team in their Discord channel, but I figured I would bring it to the attention of the Sentry team. This happened overnight and the errors keep pouring in every couple of seconds. The odd thing is, I don't have active users at the moment on my site when these errors are coming in.
#Getting over 10,000 errors from a single user
26 messages · Page 1 of 1 (latest)
Disable your DSN to stop the flood
Also maybe even straight up replace the DSN to prevent the errors still piling up after you re-enable to for a while.
Great! You can re-enable it later if you want or just delete it and create a new one and deploy that.
Yea I think the issue is someone has a tab just opened in their browser and just left it open... Clerk so far has said the error message is usually associated with a dev instance but Sentry shows it's on production and the replay URL is my production URL.
I have no experience with Clerk but I have made the mistake myself of an infinite retry loop and this sounds about right. Especially if you have replays it should be pretty clear what is happening and someone just having a tab open will certainly happen for some people.
Yea it started 22 hours ago 😭 and the reply was just someone viewing an article so they moved around from pages protected by Clerk.js (auth) to a page that was not protected by auth 😅
Fun times 😦
Hopefully you are all good now on the Sentry side
Let us know if there is anything else we can help you with!
Will do
They’re suggesting I enable rate limiting but that’s not possible as this is a free tier correct?
Alex is there a way to get the full error? It seems like the error being displayed in Sentry is cut off
Correct. Rate limiting is only on business plans and up. There is spike protection but that eventually will loose it’s use after a while (when it’s no longer a spike but a constant stream).
You can download the event json that might contain more info but I don’t think so.
@cerulean fern Can you share a link to the event? I'd like to take a look whether we can improve the capturing of the error somehow via the SDK.
Sentry
ClerkJS: Token refresh failed (error='ClerkJS: Network error at "https://clerk.redshirtsports.xyz/v1/client/sessions/sess_2kZYnszPVqvKjErjlmL6FKhZ9U8/tokens?_clerk_js_version=5.14.0" - TypeError: NetworkError when attempting to fetch resource.. Pleas... app:///npm/@clerk/clerk-js@5/dist/clerk.browser.js /changing-the-narrative-socon-football-202...
Sentry
ClerkJS: Token refresh failed (error='ClerkJS: Network error at "https://clerk.redshirtsports.xyz/v1/client/sessions/sess_2kFpjTb2ooMchwbPkEPucws1G74/tokens?_clerk_js_version=5.14.0" - TypeError: Load failed. Please try again.') app:///npm/@clerk/clerk-js@5.14.0/dist/clerk.browser.js /studio/structure/b0bcf343-7ea8-44ed-808d-23e918d6310e;1a8963f...
And then this one came in last night https://james-singleton.sentry.io/share/issue/28eaa40c0e5540b3ae8f43a81af5ee83/
Sentry
The operation is insecure. SecurityError app:///npm/@clerk/clerk-js@5.14.0/dist/clerk.browser.js acquireLockAndRun /socon-football-2024-key-non-conference-games
Thanks! Yeah we have a limit for error messages (which I absolutely hate since errors are literally Sentry's thing).
I'll try to get the ball rolling to allow for longer messages.
As a workaround you can add this to your Sentry.init() calls:
beforeSend(event, hint) {
if (hint.originalException) {
event.extra = event.extra || {};
event.extra.full_error_message = String(hint.originalException)
}
return event;
},
It should dump the entire raw stacktrace into your issue events.