Bailey
07/17/2023, 6:32 PMverifySession({ sessionRequired: false })
that is used on every API call, and some of these requests will cause an ECONNRESET
error for a request that calls /apiversion
. As far as I'm aware, I'm not calling this API intentionally anywhere.
I can cause an ECONNRESET
error by calling UserMetadata.getUserMetadata
multiple times. After calling an API that uses this function, it fails after ~50 total metadata calls for 5-10 seconds and then results in an ECONNRESET
error. It then works as intended for 1/2 more attempts until it fails again. Other than this specific API, I'm only using getUserMetadata
in the createNewSession
override within Session.init(...)
, but this function isn't triggered when I get the randomly occurring ECONNRESET
error. It also isn't failing to call /apiversion
, it fails to call /recipe/user/metadata?userId=.....
Example (~6 seconds total):
- Frontend attempts to load page that calls the backend once
- The first API call the backend logs is OPTIONS /token/user/email/verify 204 1.119 ms - 0
- (/token
is the apiBasePath)
- This call attempts to load for ~5 seconds until it fails and ECONNRESET
error is announced
- It tries again and is successful in calling GET /token/user/email/verify 200 19541.619 ms - 54
Notes:
- /token/user/email/verify
with a status of 200 and/or 204 can occur without throwing any errors.
- Previously I had an issue with 204 errors due to caching that was fixed by using app.disable('etag');
months ago.