webwhiz-ai / webwhiz

WebWhiz allows you to create an AI chatbot that knows everything about your product and can instantly respond to your customer's queries.
https://www.webwhiz.ai/
GNU Affero General Public License v3.0
929 stars 158 forks source link

Support mongodb authentication #219

Open runephilosof-abtion opened 3 months ago

runephilosof-abtion commented 3 months ago

I tried enabling authentication on mongodb and included it in mongodb_url=mongodb://username:password@mongodb:27017/' but got this error

MongoServerError: Command createIndexes requires authentication
    at Connection.onMessage (/node_modules/mongodb/lib/cmap/connection.js:201:30)
    at MessageStream.<anonymous> (/node_modules/mongodb/lib/cmap/connection.js:59:60)
    at MessageStream.emit (node:events:517:28)
    at MessageStream.emit (node:domain:489:12)
    at processIncomingData (/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
    at MessageStream._write (/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.ondata (node:internal/streams/readable:809:22)
    at Socket.emit (node:events:517:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
cpwallah commented 3 months ago

hi @runephilosof-abtion this happens in 2 cases majorly 1st you did not do error handling in codes and 2nd connection permission issue as you allow only specific access try these 2 thing i am sure that your error will get sorted