MongooseError: Operation 'accounts.findOne()' buffering timed out after 10000ms

My code worked for localhost. Code: GitHub

When I was deploying it for Render and had set the MONGO_URI environment variable, I encountered the following warning:

Jun 25 10:47:50 AM > node server.js
Jun 25 10:47:50 AM
Jun 25 10:48:01 AM Listening on 10000
Jun 25 10:48:01 AM (node:62) UnhandledPromiseRejectionWarning: MongoServerError: bad auth : authentication failed
Jun 25 10:48:01 AM at Connection.onMessage (/opt/render/project/src/node_modules/mongodb/lib/cmap/connection.js:202:26)
Jun 25 10:48:01 AM at MessageStream. (/opt/render/project/src/node_modules/mongodb/lib/cmap/connection.js:61:60)
Jun 25 10:48:01 AM at MessageStream.emit (events.js:376:20)
Jun 25 10:48:01 AM at processIncomingData (/opt/render/project/src/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
Jun 25 10:48:01 AM at MessageStream._write (/opt/render/project/src/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
Jun 25 10:48:01 AM at writeOrBuffer (internal/streams/writable.js:358:12)
Jun 25 10:48:01 AM at MessageStream.Writable.write (internal/streams/writable.js:303:10)
Jun 25 10:48:01 AM at TLSSocket.ondata (internal/streams/readable.js:745:22)
Jun 25 10:48:01 AM at TLSSocket.emit (events.js:376:20)
Jun 25 10:48:01 AM at addChunk (internal/streams/readable.js:309:12)
Jun 25 10:48:01 AM (Use node --trace-warnings ... to show where the warning was created)
Jun 25 10:48:01 AM (node:62) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v20.3.1 Documentation). (rejection id: 1)
Jun 25 10:48:01 AM (node:62) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Jun 25 10:48:03 AM Your service is live :tada:

If the login/create web request is now called, in my case from Unity, I get the following error message:

Jun 25 10:50:38 AM login called
Jun 25 10:50:48 AM (node:62) UnhandledPromiseRejectionWarning: MongooseError: Operation accounts.findOne() buffering timed out after 10000ms
Jun 25 10:50:48 AM at Timeout. (/opt/render/project/src/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:185:23)
Jun 25 10:50:48 AM at listOnTimeout (internal/timers.js:555:17)
Jun 25 10:50:48 AM at processTimers (internal/timers.js:498:7)
Jun 25 10:50:48 AM (node:62) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (Same link as above, the forum only allows 2). (rejection id: 2)

I am new to node.js and appreciate any help!

Hi there,

This Stack Overflow thread has a number of suggestions to try to resolve the authentication error – I would start there. The most common explanation appears to be You should use user password, not account password. It also looks like the buffering error is related to the auth error, because a connection hasn’t been established with MongoDB yet. Ultimately, it is unlikely this is a Render issue.

Regards,
Mike


Render Support Engineer, MT (UTC-6)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.