Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoError: not master and slaveOk=false #50

Closed
Dremor opened this issue Jun 6, 2018 · 6 comments
Closed

MongoError: not master and slaveOk=false #50

Dremor opened this issue Jun 6, 2018 · 6 comments

Comments

@Dremor
Copy link

Dremor commented Jun 6, 2018

I'm trying to make RocketChat work with a MongoDB replicaset, but I get the following error:

Exception in callback of async function: MongoError: not master and slaveOk=false

    at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)

    at queryCallback (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/cursor.js:212:36)

    at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18

    at _combinedTickCallback (internal/process/next_tick.js:131:7)

    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Exception in setInterval callback: MongoError: not master

    at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)

    at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:497:72

    at authenticateStragglers (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:443:16)

    at Connection.messageHandler (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:477:5)

    at Socket.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:333:22)

    at emitOne (events.js:116:13)

    at Socket.emit (events.js:211:7)

    at addChunk (_stream_readable.js:263:12)

    at readableAddChunk (_stream_readable.js:250:11)

    at Socket.Readable.push (_stream_readable.js:208:10)

    at TCP.onread (net.js:594:20)

Looks like Rocket.Chat don't allow to read from a replica. Would it be possible to change this behaviour?

@Dremor
Copy link
Author

Dremor commented Jun 12, 2018

Bad configuration on my part, sorry.

@Dremor Dremor closed this as completed Jun 12, 2018
@ghost
Copy link

ghost commented Nov 6, 2018

Any chance you could reveal what the bad configuration happened to be?

@zolbayars
Copy link

Bad configuration on my part, sorry.

This exact issue is happening. What was the configuration?

@mabushey
Copy link

Bad configuration = Braindead idea to use Mongo.

@sampaiodiego
Copy link
Member

for those who have the same issue, its a MongoDB misconfiguration.. you guys need to configure it in Replica Set mode. There is an official tutorial explaining how to do that: https://docs.mongodb.com/manual/tutorial/deploy-replica-set/

@Dremor
Copy link
Author

Dremor commented Feb 20, 2019

I agree with @sampaiodiego answer, it was a ReplicaSet misconfiguration. I unfortunately don't remember the details, as this notification was buried under all the other ones. I'll try to replicate it if I have the time to do so, but cannot promise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants