Closed Lezhek closed 1 month ago
Error "MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo" happens when the bot can't connect to MongoDB. But it often happens when the IP address is incorrectly specified.
You are trying to run bot in Docker? And what did you put in MONGO_URI?
I had to rename docker mongo container from aicbot-mongo to mongo and bot fetched it.
Also you can set MONGO_URI to mongodb://aicbot-mongo:27017 And I need to update the README.
Also you can set MONGO_URI to mongodb://aicbot-mongo:27017 And I need to update the README.
it's in readme just the wrong section of it you should've moved it to the bottom section
If i replace example in setup.MD of MongoURI to "Docker: mongodb://aicbot-mongo:27017 or Local: mongodb://localhost:27017", its be enough?
Who are you? User (who just use bot from discord)/developer/admin (who download all bot stuff to host)?
User
Description
[ 21/09/2024 | 16:08:09 ] [ MongoDB ] Connecting to MongoDB, please wait [ 21/09/2024 | 16:08:39 ] [ MongoDB | ERROR ] Connection error while connecting: MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo [ 21/09/2024 | 16:08:39 ] [ ERROR ] MongooseServerSelectionError: getaddrinfo ENOTFOUND mongo at _handleConnectionErrors (/bot/node_modules/.pnpm/mongoose@8.6.3_socks@2.8.3/node_modules/mongoose/lib/connection.js:900:11) at NativeConnection.openUri (/bot/node_modules/.pnpm/mongoose@8.6.3_socks@2.8.3/node_modules/mongoose/lib/connection.js:851:11) at async Module.mongoHandler (file:///bot/build/handlers/Mongo.handler.js:13:9) at async handlersLoad (file:///bot/build/handlersLoad.js:17:13) at async file:///bot/build/main.js:19:1 { reason: TopologyDescription { type: 'Unknown', servers: Map(1) { 'mongo:27017' => [ServerDescription] }, stale: false, compatible: true, heartbeatFrequencyMS: 10000, localThresholdMS: 15, setName: null, maxElectionId: null, maxSetVersion: null, commonWireVersion: 0, logicalSessionTimeoutMinutes: null }, code: undefined } [ 21/09/2024 | 16:08:39 ] [ Handlers ] Bot is shutting down, because handler loading throw error npm notice npm notice New patch version of npm available! 10.8.2 -> 10.8.3 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3 npm notice To update run: npm install -g npm@10.8.3 npm notice
Steps To Reproduce
Wiki intall section
How reliably can you recreate this issue using your steps above?
Always