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

Still not able to connect to MongoHQ hosted databases after 2.3.0 #100

Closed
ygbr opened this issue Apr 4, 2013 · 17 comments
Closed

Still not able to connect to MongoHQ hosted databases after 2.3.0 #100

ygbr opened this issue Apr 4, 2013 · 17 comments
Labels

Comments

@ygbr
Copy link

ygbr commented Apr 4, 2013

Hi,

I have a MongoHQ hosted database (MongoDB 2.4.1) (large) and I still can't connect using the standard dsn:

user:pass@server:port/database

I always get the following error:

Connections error: unauthorized

I have also tried adding the mongodb:// prefix to the URI but it changes nothing.

I have bson_ext installed and I'm running the latest 2.3.0 on Mac OS X 10.8.3

@bobthecow
Copy link
Owner

Do you have special characters in any of the DSN chunks that need to be URI escaped?

@ygbr
Copy link
Author

ygbr commented Apr 4, 2013

not really... my username an password are all alphanumeric standard chars...

@elia
Copy link

elia commented Apr 12, 2013

I seem to have the same problem with mongolab.com, like if tries to get admin access

@bobthecow
Copy link
Owner

Is it possible you're running into the same issue as Meteor hosted mongo instances have?

See #102

@elia
Copy link

elia commented Apr 15, 2013

@bobthecow don't think so, the password is static

@jcurtis
Copy link

jcurtis commented Apr 17, 2013

Same issue here (MongoLab), was just working fine in 2.3.0 mere minutes ago.

@bobthecow
Copy link
Owner

@jcurtis So v2.3.0 was working with MongoLab, and now it's not? Or now v2.3.1 isn't?

@jcurtis
Copy link

jcurtis commented Apr 17, 2013

Yes v2.3.0 was working with MongoLab, then I did a gem update to bring Genghis up to v2.3.1 plus dependency updates. After that there were authentication errors when trying to connect to the database.

Bonus: I downgraded Geng to v2.3.0 and there are still authentication errors leading me to believe it's a problem with one of the dependencies I updated.

@bobthecow
Copy link
Owner

@jcurtis That's great to know. Do you happen to still have that terminal window open so you can see what updated? Do you mind checking what versions of bson, bson_ext, mongo and sinatra gems you were last using?

gem list | grep 'bson\|mongo\|sinatra'

@jcurtis
Copy link

jcurtis commented Apr 17, 2013

bson (1.8.5, 1.8.4, 1.8.2, 1.7.1)
bson_ext (1.8.5, 1.8.2)
mongo (1.8.5, 1.8.2, 1.7.1)
sinatra (1.4.2, 1.3.4)
sinatra-contrib (1.4.0, 1.3.2)
sinatra-mustache (0.1.0, 0.0.6)

Looks like they we're all updated when I did the upgrade.

@bobthecow
Copy link
Owner

Thanks. I'll dig into this when I get a minute.

@bobthecow
Copy link
Owner

This works:

bson (1.8.2)
mongo (1.8.2)
sinatra (1.3.4)
sinatra-contrib (1.3.2)
sinatra-mustache (0.1.0)

This works:

bson (1.8.2)
mongo (1.8.2)
sinatra (1.4.2)
sinatra-contrib (1.4.0)
sinatra-mustache (0.1.0)

... so the latest versions of all dependencies besides bson and mongo work just fine.

This works:

bson (1.8.5)
mongo (1.8.2)

And that's the latest version of every gem except mongo. I.e., it's gotta be the mongo gem.

This works:

mongo (1.8.3)

But this fails!

mongo (1.8.4)

So something changed in v1.8.4 of the mongo gem which is keeping us from connecting to MongoHQ databases.

Thanks for pointing me in this direction, @jcurtis

I'll keep digging :)

@bobthecow
Copy link
Owner

The result of the Mongo uri parser changing unexpectedly in 1.8.4. This commit, specifically.

Hooray SemVer!

I'm releasing a workaround in v2.3.4 — out later this afternoon — but the real fix is to expect the mongo gem to make backwards compatiblity breaks in point releases and start requiring an explicit version for Genghis. I hate to do it, but this — and several past issues — really leaves me no choice.

@bobthecow
Copy link
Owner

v2.3.4 has been released. Please upgrade and check it out!

@jcurtis
Copy link

jcurtis commented Apr 20, 2013

image
Glad I could help. Love the app btw.

@brndnblck
Copy link

Sorry for the issues here guys.

This read-only method on MongoClient is actually not documented publicly and was intended primarily for internal use which is why we mistakenly made the change in that version, but the fact that it's not marked private makes that all a moot point. It shouldn't have happend. :-/

@bobthecow
Copy link
Owner

@jcurtis Thank you :)

@brandonblack No worries, this sort of thing happens. Thanks for everything you and the rest of the driver team do.

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