RocketChat / Rocket.Chat.Embedded.arm64

An open source journey bringing the latest Rocket.Chat releases to the arm64 universe
MIT License
24 stars 15 forks source link

MongoError: not master #7

Open haath opened 3 years ago

haath commented 3 years ago

Hello,

I used your dockerfile to build the latest rocket.chat and also started Mongo with your compose recommendations.

I also ran rs.initiate() so the db should be initialized.

But I'm getting the following error at the startup of rocket.chat:

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

MongoError: not master and slaveOk=false
    at Connection.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/pool.js:451:61)
    at Connection.emit (events.js:311:20)
    at processMessage (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:452:10)
    at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/connection/connection.js:621:15)
    at Socket.emit (events.js:311:20)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:209:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1605988825 },
  ok: 0,
  code: 13435,
  codeName: 'NotMasterNoSlaveOk',
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 1605988825 },
    signature: { hash: [Binary], keyId: 0 }
  },
  name: 'MongoError'
}

Any tips?

vvuk commented 1 year ago

I believe the issue here is that rocketchat is starting up too quickly -- after this error in my log, I see:

compose-mongo-1               | 2023-03-24T22:46:49.183+0000 I REPL     [rsSync-0] transition to primary complete; database writes are now permitted

I hacked the entry point in the dockerfile to do /bin/sh -c "sleep 10 && node main.js"; dirty but works.