Code Monkey home page Code Monkey logo

Comments (5)

sampaiodiego avatar sampaiodiego commented on July 24, 2024

you need to configure your MongoDB as Replica Set.. you can follow this official tutorial: https://docs.mongodb.com/manual/tutorial/deploy-replica-set/

If you want to give Rocket.Chat on a deployment not designed for production, you can use MongoDB without configuring it as replica set. to do that just removes the MONGO_OPLOG_URL env var from you startup.

I'll be closing the issue since this is not an issue with Rocket.Chat nor its Official imagem.

from docker.official.image.

achaiah avatar achaiah commented on July 24, 2024

Hi @sampaiodiego, could you please be more specific in your reply? How could I run Rocket.Chat with a single instance of MongoDB? I have a docker-compose.yml file but it does not specify any MONGO_OPLOG_URL and still I get the same issue as above.

Thanks

from docker.official.image.

sampaiodiego avatar sampaiodiego commented on July 24, 2024

hi @achaiah .. starting from version 1.0 we have removed the possibility to run Rocket.Chat without using a replica set.

that means you'll need to set the MONGO_OPLOG_URL env var.. you can have a single MongoDB as replica set, please the tutorial I've shared before https://docs.mongodb.com/manual/tutorial/deploy-replica-set/

from docker.official.image.

clpacheco90 avatar clpacheco90 commented on July 24, 2024

I got the same error and its occurring because rocket.chat starts first then the replicaset containers.
So I add the command on docker-compose file:

...
    image: "rocket.chat"
    command: >
      bash -c
        "for i in `seq 1 30`; do
          node main.js &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"    
...

https://github.com/RocketChat/Rocket.Chat/blob/develop/docker-compose.yml

from docker.official.image.

AllardKrings avatar AllardKrings commented on July 24, 2024

Hi, I am having the same problem.

Situation:

I run Rocketchat with a 3-fold Mongo-replicaset: Pods named mongodb-0, mongodb-1 and mongodb-2. . It works fine.

But after a power interupt on the cluster Mongo-DB has changed wich member of the replicaset is the Primary. Before the power interupt Mongo-0 is the primary, after the power interrupt Mongo-2 has become Primary.

Because the Rocketchat configuration expect mongodb-0 to be the primary:

        - name: MONGO_OPLOG_URL
           value: mongodb://**mongodb-0.**mongodb:27017/local?replSet=rs0

this results the following error in the Rocketchat logs:

/app/bundle/programs/server/node_modules/fibers/future.js:313
throw(ex);
^

MongoError: not master and slaveOk=false
at MessageStream.messageHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/connection.js:272:20)
at MessageStream.emit (events.js:314:20)
at processIncomingData (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at MessageStream.Writable.write (_stream_writable.js:318:11)
at Socket.ondata (_stream_readable.js:718:22)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (stream_readable.js:272:9)
at Socket.Readable.push (stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
operationTime: Timestamp { bsontype: 'Timestamp', low: 2, high
: 1663192744 },
ok: 0,
code: 13435,
codeName: 'NotMasterNoSlaveOk',
'$clusterTime': {
clusterTime: Timestamp { bsontype: 'Timestamp', low: 2, high
: 1663192744 },
signature: {
hash: Binary {
_bsontype: 'Binary',
sub_type: 0,
position: 20,
buffer: Buffer(20) [Uint8Array] [
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0
]
},
keyId: 0
}
},
[Symbol(errorLabels)]: Set { 'RetryableWriteError' }

Does anybody know how to solve this?

from docker.official.image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.