sm0oek
sm0oek•4mo ago

Connection to database never establishes

Hi, I'm having issues connecting to my convex backend. It seems the websocket connection never succeeds. This was working fine yesterday. Can anyone tell what's happening? I've attached screenshots of the console. I'm following the otp auth flow with resend from the docs. I can add additional context if needed. Any assistance is much appreciated. Thanks!
No description
No description
No description
11 Replies
Convex Bot
Convex Bot•4mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
sshader
sshader•4mo ago
I see AuthProviderDiscoveryFailed which sounds like your deployment is unhappy with your auth.config.ts -- what does it look like? Or alternatively what does https://dashboard.convex.dev/deployment/settings/authentication in the dashboard look like?
Convex Dashboard
Manage your Convex apps
sm0oek
sm0oekOP•4mo ago
No description
sm0oek
sm0oekOP•4mo ago
No description
sshader
sshader•4mo ago
Cool -- have you fully set up Convex Auth? In particular do you have an http.ts file + do you see an entry for http on the functions tab of the dashboard?
sm0oek
sm0oekOP•4mo ago
yes
No description
No description
sshader
sshader•4mo ago
Hmm can you try something like this? https://discord.com/channels/1019350475847499849/1269592730422480957/1269961178260701184 I think Hono + Convex Auth might not be working together very well here (auth.addHttpRoutes adds a few endpoints at your .convex.site, and when we try and validate your auth JWT, we try and hit those endpoints, and when that fails we get the "AuthProviderDiscoveryFailed" message)
sm0oek
sm0oekOP•4mo ago
well, i'm no longer getting the perpetual connection issues and it fails instantly. had to type cast things as any because ts was yelling at me.
No description
No description
No description
sshader
sshader•4mo ago
Next things I'd check (in order): * do curl https://jovial-wildebeest-179.convex.site/.well-known/openid-configuration and curl https://jovial-wildebeest-179.convex.site/.well-known/jwks.json work * the latter should be the JWKS environment variable on your Convex deployment, and the start of it should look something like {"keys":[{"use":"sig","kty":"RSA", * try doing https://labs.convex.dev/auth/setup/manual#configure-private-and-public-key again to get a fresh key
Manual Setup - Convex Auth
Authentication library for your Convex backend
sm0oek
sm0oekOP•4mo ago
huzaaa! turns out i was missing the curly braces for the JWKS environment variable 🥲 thanks a lot for your support!
sshader
sshader•4mo ago
Yay! There's something in the works to make this easier to spot + debug, but glad it seems happier now

Did you find this page helpful?