Random ReplicaSetNoPrimary errors when using Mongoose #4269
Unanswered
josh-byster
asked this question in
General
Replies: 1 comment 3 replies
-
Hi @josh-byster this doesn't look like a Vercel platform error to me, especially since your functions are responding fast (50ms) and still resulting in an error. Have you checked with the MongoDB Atlas folks to see if they know what's going on? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
A little under 5% of requests or so yield the following error, and it seems to only (seemingly randomly) happen sometimes after cold starts and almost always just goes away after a page refresh:
The error message is not exactly accurate since I have all IPs whitelisted, however it must have to do with the
ReplicaSetNoPrimary
.I connect to Mongoose as follows in my
app.js
file, which serves as the entrypoint:Details of the Lambda execution show the following:
However, Mongoose has a
serverSelectionTimeoutMS
defaulted to 30s, so it doesn't seem to make sense why this would spend 50ms and then timeout.Beta Was this translation helpful? Give feedback.
All reactions