Problem with connection to DB in stable-1.6

25 views
Skip to first unread message

Victor Brylew

unread,
Aug 6, 2010, 7:37:40 AM8/6/10
to mongodb-user
Hello,

After latest update of Ubuntu mongodb-stable package I have a problem
with query execution from my Rails application. Everything was
workable yesterday but now I got "Trying to connect directly to slave;
if this is what you want, specify :slave_ok => true." message.
Few technical details:
Linux 2.6.32-24-generic x86_64 GNU/Linux
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
Rails 2.1.2
mongodb-stable 20100805

Please tell me if you have any ideas how can I fix this.

Eliot Horowitz

unread,
Aug 6, 2010, 9:29:15 AM8/6/10
to mongod...@googlegroups.com
are you trying to connecting to a slave?
Can you give a little more info about your setup?

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Victor Brylew

unread,
Aug 6, 2010, 1:28:25 PM8/6/10
to mongodb-user
No. I'm connecting to the master. I'm using standard Ruby drivers for
connection. Error happens during method 'new' execution with two
arguments passed in (host and port).
Setup is very simple. One master. No slaves. Rails application and
Mongo server runs on same box. Standard 27017 port is used.

One interesting thing I found after my first post is normal connection
to the DB using mongo console (v 1.6.0). If I use 'use <DB_name>'
command then everything works fine.

Eliot Horowitz

unread,
Aug 6, 2010, 1:30:54 PM8/6/10
to mongod...@googlegroups.com
What version of the ruby driver? Can you try a new one?

iragsdale

unread,
Aug 6, 2010, 2:34:42 PM8/6/10
to mongodb-user
I also just tried upgrading to 1.6.0, and it doesn't work with the
1.0.3 ruby driver - it thinks it is connecting to slave even though
this server is a master and isn't part of a replication set. I was
using 1.5.7 with the 1.0.3 driver, which was working fine - I didn't
expect to see incompatibilities with 1.6.0, since 1.5.7 was supposed
to be a final candidate. It would be really helpful if the release
notes let us know that new drivers were required.

- Ian

Kyle Banker

unread,
Aug 6, 2010, 2:48:09 PM8/6/10
to mongod...@googlegroups.com
Right, the issue there is that the response from the ismaster command changed. Please upgrade to 1.0.7.

Ian Ragsdale

unread,
Aug 6, 2010, 2:53:44 PM8/6/10
to mongod...@googlegroups.com
I know now that I need to update my driver, and I'll do that when I get the chance.

My point was that I didn't see any notice or warning that I would be forced to upgrade my driver for the new version, which was especially unexpected because I was upgrading from a release candidate.  It's a communication issue, not a technical one - it would be really nice if server changes that break compatibility were noted, especially this late in the release cycle.

- Ian

Adam Fields

unread,
Sep 6, 2010, 10:55:35 AM9/6/10
to mongodb-user
I saw this problem as well, and in this particular case upgrading all
of the potential clients that may connect is a big hassle that needs
to be planned for. As far as I can tell, this incompatibility isn't
even listed in the release notes for 1.6.2, and it should be right at
the top.

On Aug 6, 2:53 pm, Ian Ragsdale <ian.ragsd...@gmail.com> wrote:
> I know now that I need to update my driver, and I'll do that when I get the chance.
>
> My point was that I didn't see any notice or warning that I would be forced to upgrade my driver for the new version, which was especially unexpected because I was upgrading from a release candidate.  It's a communication issue, not a technical one - it would be really nice if server changes that break compatibility were noted, especially this late in the release cycle.
>
> - Ian
>
> On Aug 6, 2010, at 1:48 PM, Kyle Banker wrote:
>
>
>
> > Right, the issue there is that the response from the ismaster command changed. Please upgrade to 1.0.7.
>
Reply all
Reply to author
Forward
0 new messages