Getting ConnectTimeoutError #12734
Unanswered
abedhariri
asked this question in
Help
Replies: 1 comment
-
This error ( 1. Check Network Connectivity
2. Check Nginx ConfigurationYour Nginx reverse proxy is missing server {
server_name www.taskapm.com taskapm.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Add timeout settings
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/taskapm.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/taskapm.com/privkey.pem;
} After updating, restart Nginx: sudo systemctl restart nginx 3. Increase NextAuth TimeoutModify your NextAuth configuration to set a higher fetch timeout: export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [
Github({
clientId: process.env.AUTH_GITHUB_ID,
clientSecret: process.env.AUTH_GITHUB_SECRET,
httpOptions: {
timeout: 60000, // 60 seconds
}
}),
Google({
clientId: process.env.AUTH_GOOGLE_ID,
clientSecret: process.env.AUTH_GOOGLE_SECRET,
httpOptions: {
timeout: 60000, // 60 seconds
}
}),
],
debug: true,
trustHost: true,
}); 4. Check Digital Ocean Firewall
5. Check Docker NetworkSince you're running inside a Docker container, it might be a DNS issue:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone
This is my first question here, if I am missing anything please tell me.
I have a nextjs v15 hosted on digital ocean on a droplet using docker (standalone). I implemented next-auth v5 a while back (3month ago), it was working fine untill 2 weeks ago, when it started not working. I am unable to sign in with credentials, google or github. It is important to mention I am using nginx as a reverse_proxy. the setup is working fine local but not in prod.
Here is my auth file
Here is my nginx conf
Package.json
Here are the envs I am using. I have double checked if the are being set and they are.
AUTH_SECRET
AUTH_TRUST_HOST
AUTH_GITHUB_ID
AUTH_GITHUB_SECRET
AUTH_GOOGLE_ID
AUTH_GOOGLE_SECRET
Here is the error I am getting in production
[auth][error] CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror
[auth][cause]: TypeError: fetch failed
at node:internal/deps/undici/undici:13502:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async tW (/app/.next/standalone/.next/server/chunks/466.js:368:14205)
at async rK (/app/.next/standalone/.next/server/chunks/466.js:368:33428)
at async rQ (/app/.next/standalone/.next/server/chunks/466.js:368:40473)
at async r9 (/app/.next/standalone/.next/server/chunks/466.js:368:52077)
at async ne (/app/.next/standalone/.next/server/chunks/466.js:368:56815)
at async te.do (/app/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
at async te.handle (/app/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
at async doRender (/app/.next/standalone/node_modules/next/dist/server/base-server.js:1455:42)
[auth][details]: {
"name": "ConnectTimeoutError",
"code": "UND_ERR_CONNECT_TIMEOUT",
"provider": "github"
}
Beta Was this translation helpful? Give feedback.
All reactions