Astra-Development / Discord-Bot-List-v3

Free Discord Bot List Server List Website
https://discord.gg/sQQFSnQhdt
MIT License
57 stars 37 forks source link

i need some help #23

Open BallisticOK opened 1 month ago

BallisticOK commented 1 month ago

i keep getting this Error /home/container/node_modules/mongodb/src/mongo_client.ts:609 if (callback) return callback(error); ^ Error Error: Error connecting to db: mongodb+srv URI cannot have port number at /home/container/node_modules/connect-mongodb-session/index.js:88:17 at Function.connect (/home/container/node_modules/mongodb/src/mongo_client.ts:609:28) at new MongoDBStore (/home/container/node_modules/connect-mongodb-session/index.js:86:25) at module.exports (/home/container/index.js:120:19) at Client.<anonymous> (/home/container/client.js:53:36) at Client.emit (node:events:531:35) at Client.emit (node:domain:488:12) at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:387:17) at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:370:10) and idk how to fix this cuz i need to use a port cuz i run the db on a custom port

BallisticOK commented 1 month ago

ok i think i fixed that i set my mongo to my domain but now im getting this js Error /home/container/node_modules/mongodb/src/connection_string.ts:81 if (err) return callback(err); ^ Error Error: Error connecting to db: querySrv ENOTFOUND _mongodb._tcp.mdb.mydomain at /home/container/node_modules/connect-mongodb-session/index.js:88:17 at /home/container/node_modules/mongodb/src/utils.ts:466:9 at /home/container/node_modules/mongodb/src/mongo_client.ts:459:25 at /home/container/node_modules/mongodb/src/operations/connect.ts:43:33 at QueryReqWrap.callback (/home/container/node_modules/mongodb/src/connection_string.ts:81:21) at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/callback_resolver:45:10)

BallisticOK commented 1 month ago

i know this is annoying and im sorry

but im getting this now

Error  /home/container/node_modules/mongodb/src/cmap/connection.ts:438
          //callback(new MongoServerError(document));
                   ^
 Error  MongoServerError: The $changeStream stage is only supported on replica sets
    at Connection.onMessage (/home/container/node_modules/mongodb/src/cmap/connection.ts:438:20)
    at MessageStream.<anonymous> (/home/container/node_modules/mongodb/src/cmap/connection.ts:256:56)
    at MessageStream.emit (node:events:519:28)
    at MessageStream.emit (node:domain:488:12)
    at processIncomingData (/home/container/node_modules/mongodb/src/cmap/message_stream.ts:193:14)
    at MessageStream._write (/home/container/node_modules/mongodb/src/cmap/message_stream.ts:70:5)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at MessageStream.Writable.write (node:internal/streams/writable:508:10)
    at Socket.ondata (node:internal/streams/readable:1007:22) {
  ok: 0,
  code: 40573,
  codeName: 'Location40573',
  [Symbol(errorLabels)]: Set(0) {}
johnandreopoulos commented 1 month ago

i keep getting this Error /home/container/node_modules/mongodb/src/mongo_client.ts:609 if (callback) return callback(error); ^ Error Error: Error connecting to db: mongodb+srv URI cannot have port number at /home/container/node_modules/connect-mongodb-session/index.js:88:17 at Function.connect (/home/container/node_modules/mongodb/src/mongo_client.ts:609:28) at new MongoDBStore (/home/container/node_modules/connect-mongodb-session/index.js:86:25) at module.exports (/home/container/index.js:120:19) at Client.<anonymous> (/home/container/client.js:53:36) at Client.emit (node:events:531:35) at Client.emit (node:domain:488:12) at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:387:17) at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:370:10) and idk how to fix this cuz i need to use a port cuz i run the db on a custom port

To fix the error:

  1. Locate your MongoDB connection string in your configuration or environment variables.
  2. Remove the port number from the connection string. It should look like mongodb+srv://username:password@cluster0.mongodb.net/mydatabase.
  3. Save the changes and restart your application.

This will resolve the issue with the MongoDB connection.

johnandreopoulos commented 1 month ago

i know this is annoying and im sorry

but im getting this now

Error  /home/container/node_modules/mongodb/src/cmap/connection.ts:438
          //callback(new MongoServerError(document));
                   ^
 Error  MongoServerError: The $changeStream stage is only supported on replica sets
    at Connection.onMessage (/home/container/node_modules/mongodb/src/cmap/connection.ts:438:20)
    at MessageStream.<anonymous> (/home/container/node_modules/mongodb/src/cmap/connection.ts:256:56)
    at MessageStream.emit (node:events:519:28)
    at MessageStream.emit (node:domain:488:12)
    at processIncomingData (/home/container/node_modules/mongodb/src/cmap/message_stream.ts:193:14)
    at MessageStream._write (/home/container/node_modules/mongodb/src/cmap/message_stream.ts:70:5)
    at writeOrBuffer (node:internal/streams/writable:570:12)
    at _write (node:internal/streams/writable:499:10)
    at MessageStream.Writable.write (node:internal/streams/writable:508:10)
    at Socket.ondata (node:internal/streams/readable:1007:22) {
  ok: 0,
  code: 40573,
  codeName: 'Location40573',
  [Symbol(errorLabels)]: Set(0) {}

To fix the error, set up MongoDB as a replica set and use the following code:

  1. Start MongoDB with the --replSet option:

    mongod --replSet rs0
  2. Initiate the replica set:

    mongo
    rs.initiate()
BallisticOK commented 1 month ago

i cant set my thing to replica im using pterodactyl