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

Wrong "local" database detection in case replica set was configured incorrectly #10923

Open
ostrolucky opened this issue Feb 18, 2020 · 11 comments
Open

Comments

@ostrolucky
Copy link

@ostrolucky ostrolucky commented Feb 18, 2020

I spent lot of time today debugging this message when setting up rocketchat. I was sure I am setting MONGO_OPLOG_URL env variable correctly, but this this package kept complaining. So I followed your comment at

// https://docs.mongodb.com/manual/reference/command/isMaster/
and figured out these things

> db.runCommand({isMaster:1})
{
	"ismaster" : false,
	"secondary" : false,
	"info" : "Does not have a valid replica set config",
	"isreplicaset" : true,
	"maxBsonObjectSize" : 16777216,
	"maxMessageSizeBytes" : 48000000,
	"maxWriteBatchSize" : 100000,
	"localTime" : ISODate("2020-02-18T16:15:35.063Z"),
	"logicalSessionTimeoutMinutes" : 30,
	"connectionId" : 53,
	"minWireVersion" : 0,
	"maxWireVersion" : 8,
	"readOnly" : false,
	"ok" : 1,
	"$clusterTime" : {
		"clusterTime" : Timestamp(1582041152, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	},
	"operationTime" : Timestamp(0, 0)
}
> rs.conf()
2020-02-18T16:15:47.876+0000 E  QUERY    [js] uncaught exception: Error: Could not retrieve replica set config: {
	"operationTime" : Timestamp(0, 0),
	"ok" : 0,
	"errmsg" : "no replset config has been received",
	"code" : 94,
	"codeName" : "NotYetInitialized",
	"$clusterTime" : {
		"clusterTime" : Timestamp(1582041152, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
}

So as you can see problem isn't because of wrongly specified database in env variable, but replication set not being initialized. Your code should be fixed to handle such state, because as of now it guides user to incorrect thing.

@stale
Copy link

@stale stale bot commented Mar 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Mar 21, 2020
@ostrolucky
Copy link
Author

@ostrolucky ostrolucky commented Mar 21, 2020

.

@stale stale bot removed the stale-bot label Mar 21, 2020
@stale
Copy link

@stale stale bot commented Apr 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Apr 22, 2020
@ostrolucky
Copy link
Author

@ostrolucky ostrolucky commented Apr 22, 2020

.

@stale stale bot removed the stale-bot label Apr 22, 2020
@stale
Copy link

@stale stale bot commented May 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label May 24, 2020
@ostrolucky
Copy link
Author

@ostrolucky ostrolucky commented May 24, 2020

.

@ruhci28
Copy link

@ruhci28 ruhci28 commented Jul 19, 2020

Hii, can i work on this .?

@ostrolucky
Copy link
Author

@ostrolucky ostrolucky commented Jul 19, 2020

Please do

@filipenevola
Copy link
Member

@filipenevola filipenevola commented Aug 10, 2020

hi @ruhci28 sure! Go ahead!

@Maxgit3
Copy link

@Maxgit3 Maxgit3 commented Oct 16, 2020

Is this issue still open? I would be willing to look into this.

@ostrolucky
Copy link
Author

@ostrolucky ostrolucky commented Oct 17, 2020

Please do

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

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.