Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

"Unkown Error" when connecting to secondary server in replica set. #133

Open
codazoda opened this issue Aug 28, 2013 · 10 comments
Open

"Unkown Error" when connecting to secondary server in replica set. #133

codazoda opened this issue Aug 28, 2013 · 10 comments
Labels

Comments

@codazoda
Copy link

I'm running 6 Mongo servers. Only one of those is the primary (which changes from time to time). I'm able to connect to the primary server using Genghis, but I'm not able to connect to any of the secondary servers. When I do, I get an "Unknown Error" at the top and a waiting indicator that never finishes.

screen shot 2013-08-28 at 9 33 41 am

@bobthecow
Copy link
Owner

Do you mind checking your JavaScript console or Network tab and looking for errors for me?

@codazoda
Copy link
Author

In the Javascript console I have the following:

GET http://dropbox.dev/ksl/genghis/genghis.php/servers/mongodb-rs1.ksl.com/databases 500 (Internal Server Error)
Uncaught Error: A "url" property or function must be specified

Here's the response from the network tab, which you might find useful. In particular, the "500: not master and slaveOk=false" error. According to the interwebs, this is the same error I would get if I tried to read from a slave if I hadn't run rs.slaveOk() in a console (which prevents you from accidentally treating "eventually consistent" data as if it were current). Maybe that could be added as a command you initially send to mongo on connection.

<title>Genghis — 500: not master and slaveOk=false</title>

500: not master and slaveOk=false

If you think you've reached this message in error, please press 0 to speak with an operator. Otherwise, hang up and try again.

Genghis, by Justin Hileman.

@bobthecow
Copy link
Owner

Gotcha. Just add ?slaveOk=true to the end of your server URI, and you should be good.

@codazoda
Copy link
Author

Not sure where to put it. I tried adding ?slaveOk=true to the end of the server config and I get this.

screen shot 2013-08-29 at 1 35 43 pm

Then I tried adding it, manually, to the URL after clicking that link and I get this.

screen shot 2013-08-29 at 1 36 37 pm

@bobthecow
Copy link
Owner

Yeah, that should have worked :-/

@theartoflogic
Copy link

I have v2.3.8 and I tried adding ?slaveOk=true but I get an error: "Unsupported connection option - slaveOk"

In the (PHP) code I see a switch statement that explicitly calls out "slaveOk" in one of the cases that throws the "Unsupported connection option..." exception. Is connecting to a slave now explicitly disabled?

@bobthecow
Copy link
Owner

You're absolutely right. I'd forgotten that slaveOk support was dropped because Genghis doesn't have a read-only mode.

@pierre-b
Copy link

+1. I also have this "Error: A "url" property or function must be specified", even when I select the primary server.
Just updated to the 2.6.1 version of mongodb, any coincidence ? Thx

@shordeaux
Copy link

I have something similar but before this error, I have another one:

500: PHP error:  Genghis_Json::doEncode(): The 'sec' property is read-only

@bobthecow
Copy link
Owner

@shordeaux Yours is definitely an error, but is completely unrelated :)

Commenting on your pull request.

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

No branches or pull requests

5 participants