-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Debug logs not displayed when database connection cannot be made #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Actually, if I narrow my database instance "allow IP ranges" to something really restrictive (i.e. only my local machine's IP) I get a 502 bad gateway error (similar to mentioned here: #660). If I open the instance up to all IPs, then I get the issue I've described above. So I guess what I really want to know is how to get debug info when I land at |
Ok, an update. The issue was indeed due to a poorly configured database connection. Once I resolved the database connection issue I was able to login without the error. My particular issue was that I was passing the wrong |
Thanks for the report. I agree we need additional debug error handling for authentication flows, as mostly it's just around database interactions right now (which also assumes you are using a database, and doesn't help with debugging oAuth problems). |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep ot open. Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I am getting an error during sign in that results in landing at
/api/auth/signin?error=Callback
after the call. I have narrowed this down to being a database connection issue (if I removedatabase: {...}
from myoptions
I am able to sign in successfully). I havedebug: true
in myoptions
yet when I get returned back to/api/auth/signin?error=Callback
there are no debug logs. If I disable the database connection (as mentioned above) I do see the debug logs, so it would appear that when I am unable to make a db connection something is preventing the error logs from being logged.Steps to reproduce
Steps to reproduce the behavior.
Expected behavior
A clear and concise description of what you expected to happen.
I should see the debug logs for the failed db connection in the console.
Screenshots or error logs
If applicable add screenshots or error logs to help explain the problem.
Instead I only get a status 200:

Additional context
Add any other context about the problem here.
This is on a Vercel deployment attempting to connect to a postgres hosted on Digital Ocean. The issue doesn't exist when developing locally.
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
The text was updated successfully, but these errors were encountered: