Auth Provider Discovery Failed
Has anyone recieved this error while self-hosting? I am using coolify to host convex and my front-end is a next.js app. Everything has been working with my app before when I was using convex cloud but I wanted to try self hosting instead and now I keep getting this error when trying to register/login/check if a user is authenticated. I obscured the url for security reasons. Any ideas would be great!
Returning false from isAuthenticated because Error: {"code":"AuthProviderDiscoveryFailed","message":"Auth provider discovery of https://%2A%2A%2A%2A%2A/http failed: 404 Not Found
24 Replies
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!
Have you tried the auth debug steps? https://docs.convex.dev/auth/debug
Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
Yea nothing seems to work
When I try to register an account or log in I do get these in the chrome console

Auth should be completely working as it was 100% working when I was using convex cloud idk if I am just missing something or a step with convex auth and self hosting but I followed the guide exactly
This is my middleware.ts file for next.js
And this shows up in my next.js npm run dev terminal after attempting to register/login

Can you share the rest of the error in that last screenshot
The beginning part has the actual error message
It was too long had to upload as a txt file hope that is fine
This maybe be helpful too so I will post it. On ly convex dashboard settings for URL & Deploy keys I have these so I created the CONVEX_SITE_URL environment variable matching that url and it seems that from that error message it is trying to hit that http actions url

And here is the authentication settins on my convex dashboard, this url matches the CONVEX_SITE_URL

I also tried manually opening this url and entering my admin token and it does says 404

What domain is in your auth.config.ts? That's the Convex dashboard 404 html printed out in the error, which makes me think the auth domain is convex.dev or a subdomain of convex.dev.
You can dm if you want to keep it private
Okay thanks! I will send you a dm
I have this exact same problem
Have you found a solution?
I have not found a solution for this. I gave up for the time being I may try again soon though. If you figure it out though I would love to hear how
Actually it works now
I sent a patch to both coolify and dokploy
they merged
so you can use either, it was because both were using older versions of convex
@radix Did you need to open any ports on your vps for convex to work with coolify? I saw your pull request and manually created the docker compose file to see if that worked for me but I'm still running into that same issue
It may also be my environment variables using the wrong url or something simple
I didn't need to open any ports on my VPS. Right now I am using dokploy but I can send you my docker compose if you want
I feel somehow middleware is not able to act (I am going through a similar issue if not the same) completely for the authentication thus nextjs is trying to hit an otherwise expected endpoint such as api/auth instead. I think we try to provide convexAuth before it is ready. May be something to think about in the docu tutorial where we all get our reference from.
Would you be able to sent me your docker compose file?
Yup
ENV VARS:
Then in Dokploy
Thanks a ton for this! Finally auth is working
Haha that's great!