Closed mintmatica closed 7 months ago
What SEO items did you add?
Can you track down the actual error in Vercel logs?
im going to back out all my updates. what's odd, is im getting the same exact thing if i try logging into your admin page. I obviously dont have the login/pass, but this is exactly what im seeing.
Its like the callback URL cant be found for some reason....
Matt
Very interesting. I was able to log in and out my site just now without issue. However we did have a regression at some point where we stopped properly catching the auth error necessary to tell the user their login/password is wrong. This was fixed but may have regressed again.
Can you verify that all auth environment variables are available in production? I believe there's 3, and a 4th meant only for development.
I dont think its due to incorrect login/pass. When I enter the correct credentials, immediately, it throws the 500 error and white screen. This did start occurring in the last couple of days. Ill try to back out my changes in the meantime and see if that helps.
Here are all my current vercel environment variables: env variables pnet.pdf
Try having your Vercel logs open when you sign in. You might see more info, like a "credential" error, at the time you see a 500
.
Regarding environment variables, is there a reason you have both AUTH_SECRET
and NEXT_AUTH_SECRET
?
added both, just to see if that could fix the issue. Again, im not an experienced dev over here :).
I wonder if this is a DNS issue - Im able to log in via Vercel no problem to the same deployment thats on the vercel.app domain. Super odd.
Very interesting. That is possible. Are you sure the custom domain version works over HTTPS? And that it points to the same deployment as the vercel.app version?
correct, i just tested a couple times. screenshot below.
When trying to login:
pantaleone.net - doesnt work Second link (vercel) - works Third link (vercel) - works
I did just change my DNS last night from Hostinger to Vercel. will investigate more in the AM and report back.
Matt
OK—that leads me to lean toward it being DNS-related as well.
In the meantime, you might want to try syncing your fork. I posted a couple commits tonight that might help you debug.
This continues to be a super weird one. Here are the various troubleshooting steps i've done without success. As a reminder, my main domain - pantaleone.net - will not let me log into /admin. I AM able to login on vercel.app domains.
Troubleshooting steps performed:
Im going to try a couple more things with my old webhost, Hostinger to see if its on their side.
Let me know if you have any other thoughts, else, I'll report back.
Cheers, Matt
What's the content for all four of those POST errors (in some cases it may be beneath your screenshot on the lower right)?
Can you confirm you're using the latest code from main
?
If you diff your app from main
does anything auth-related pop up?
Some DNS questions: who's your DNS host? are you using a service like Cloudflare which might intercept/proxy traffic? Is www.pantaleone.net your primary domain or is it just pantaleone.net without the www? Might your DNS service forward root traffic to www traffic or vice versa?
heres the second log:
3rd:
4th (I also pasted the full log below)
d: Read more at https://errors.authjs.dev#credentialssignin at Object.l (/var/task/.next/server/chunks/4692.js:6:101883) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async c (/var/task/.next/server/chunks/4692.js:6:115329) at async c (/var/task/.next/server/chunks/4692.js:6:94922) at async s (/var/task/.next/server/chunks/4692.js:340:58128) at async i (/var/task/.next/server/chunks/5438.js:1:1953) at async /var/task/nodemodules/.pnpm/next@14.0.4@babel+core@7.23.7_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:406 at async rm (/var/task/nodemodules/.pnpm/next@14.0.4@babel+core@7.23.7_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:5703) at async rD (/var/task/nodemodules/.pnpm/next@14.0.4@babel+core@7.23.7_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:22546) at async J (/var/task/nodemodules/.pnpm/next@14.0.4@babel+core@7.23.7_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:25253) { type: 'CredentialsSignin', kind: 'signIn' }
on your other ?'s:
Not using the latest code from main, thats the next step
If you diff your app from main does anything auth-related pop up? - Not sure, but all the logs appear to be auth related.
On DNS - I pointed everything to Vercel on Saturday except the name servers on accident. I just pointed the name servers over.
oh, and on the 'www' non www - i just followed Vercels reco when adding a domain. Im not directing traffic elsewhere.
I see CredentialsSignin
at the top of one of your logs which is most likely an email/password mismatch. If there's a safe way to do it, I would make sure your ENV vars match your email/password credentials. I wonder if it's a case of those environment variables landing in different domains linked to different environments? Might those differ in Production vs Preview?
The latest auth code does a better job catching that particular error—make sure you're running the latest. If so, and there's a CredentialsSignin
exception, you should no longer have a server crash but rather a red note presented like this:
You could also carefully add some server-side logging in src/auth/index.ts
to make sure your email/password checks are comparing the right values:
Closing for now. Let me know if you discover anything else that could help us debug.
Any idea why im getting a 500 server error when trying to log in? All I did was add some SEO items and push to my main domain.
What super weird is that if I try to login on a vercel domain, everything works fine. this url works: https://pantaleone-bnn51uosa-my-team-98901580.vercel.app/admin
This URL does not and throws the errors: https://pantaleone.net/admin
Pulling my hair out on this, but I have been using the vercel domain as my "admin domain"....