nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.18k stars 3.36k forks source link

502: BAD_GATEWAY #1021

Closed ats1999 closed 3 years ago

ats1999 commented 3 years ago

502: BAD_GATEWAY While doing GitHub OAuth, i got this.

An error occurred with this application.
This is an error with the application itself, not the platform.

502: BAD_GATEWAY
Code: NO_RESPONSE_FROM_FUNCTION
ID: bom1::dc4x6-1609474836212-36479d781165

If you are a visitor, contact the website owner or try again later.
If you are the owner, check the logs for the application error.
Developer Documentation →

Reproduction visit https://bdevg.com/api/auth/signin then choose a sign with Github

Vercel function logs

[GET] /api/auth/callback/github?code=248bb9c03e85a89c3070&state=6d154f358c1546618487d1cd81bb4c1686b91a60d135507093fcbbb4930ec29b
15:20:25:95
Status:
-1
Duration:
10010.81ms
Memory Used:
74 MB
ID:
dc4x6-1609474825954-f73eb9e7144f
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
2021-01-01T04:20:36.092Z 02b5d489-c291-43b5-a9d3-6deff015db6a Task timed out after 10.01 seconds
[POST] /api/auth/signin/github
15:20:24:95
Status:
302
Duration:
82.08ms
Memory Used:
66 MB
ID:
dc4x6-1609474824954-55d2910131f0
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
[GET] /api/auth/error?error=oAuthCallback
15:19:15:43
Status:
200
Duration:
3.68ms
Memory Used:
62 MB
ID:
dc4x6-1609474755430-c761c6296b2a
User Agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
[GET] /api/auth/error?error=oAuthCallback
15:19:15:07
Status:
200
Duration:
3.63ms
Memory Used:
62 MB
ID:
dc4x6-1609474755070-1bd8ee28d530
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 Edg/85.0.564.41
[GET] /api/auth/callback/google
15:19:14:02
Status:
302
Duration:
5.69ms
Memory Used:
62 MB
ID:
dc4x6-1609474754021-902653bead5f
User Agent:
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
2021-01-01T04:19:14.153Z    e1ad9526-d2f5-4a48-8f2c-8c98fd8a7f87    ERROR   [next-auth][error][callback_oauth_error] Error: Invalid state returned from oAuth provider
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:46:27
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:26:103)
    at _next (/var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:194)
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:364
    at new Promise (<anonymous>)
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:97
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:143:17
    at /var/task/bdevg/node_modules/next-auth/dist/server/routes/callback.js:58:31
    at Generator.next (<anonymous>) 
https://next-auth.js.org/errors#callback_oauth_error
[GET] /api/auth/error?error=oAuthCallback
15:19:13:81
Status:
200
Duration:
3.83ms
Memory Used:
62 MB
ID:
46tlr-1609474753656-842d690ca3e2
User Agent:
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
[GET] /api/auth/error?error=oAuthCallback
15:19:13:44
Status:
200
Duration:
46.42ms
Memory Used:
62 MB
ID:
p6rrr-1609474753295-3caf0ab0a8c3
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
[GET] /api/auth/callback/google
15:19:12:60
Status:
302
Duration:
47.13ms
Memory Used:
120 MB
ID:
p6rrr-1609474752350-528a3121442e
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
2021-01-01T04:19:12.731Z    f5774683-208d-49fb-b8d7-46a852e6fdda    ERROR   [next-auth][error][callback_oauth_error] Error: Invalid state returned from oAuth provider
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:46:27
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:26:103)
    at _next (/var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:194)
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:364
    at new Promise (<anonymous>)
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:28:97
    at /var/task/bdevg/node_modules/next-auth/dist/server/lib/oauth/callback.js:143:17
    at /var/task/bdevg/node_modules/next-auth/dist/server/routes/callback.js:58:31
    at Generator.next (<anonymous>) 
https://next-auth.js.org/errors#callback_oauth_error
[POST] /api/auth/signin/google
15:15:27:33
Status:
302
Duration:
1440.54ms
Memory Used:
119 MB
ID:
dc4x6-1609474527333-0021bfe4f74f
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Loaded env from .env.production
[POST] /api/auth/signin/google
15:15:26:82
Status:
302
Duration:
1458.67ms
Memory Used:
118 MB
ID:
dc4x6-1609474526822-bef9b75a6e5c
User Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Loaded env from .env.production