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

Does not support standard Mongo connection string #126

Open
satyavh opened this issue Sep 1, 2018 · 2 comments
Open

Does not support standard Mongo connection string #126

satyavh opened this issue Sep 1, 2018 · 2 comments

Comments

@satyavh
Copy link

satyavh commented Sep 1, 2018

The standard Mongo connection-string is described here:
https://docs.mongodb.com/manual/reference/connection-string/

However, if you pass a connection string to MONGO_URL of this format:
mongodb://user:pass@host:port,host:port/database?replicaSet=name

This will result in:

> [0] Error: double colon in host identifier
> [0]     at module.exports (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/url_parser.js:90:13)
> [0]     at connect (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/mongo_client.js:486:16)
> [0]     at Function.MongoClient.connect (/usr/src/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/mongo_client.js:250:3)
> [0]     at new MongoConnection (packages/mongo/mongo_driver.js:168:11)
> [0]     at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
> [0]     at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
> [0]     at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
> [0]     at new AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
> [0]     at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)

This refers to the host:port,host:port part of the above connection string

You can try this out by creating a mlab.com replica set and use the provided connecting-string. It will not work. As such this package currently does not work with mLab.

FYI:
the exact same connection string works fine with Meteor-up and Galaxy. I wanted to try this package out because I love Now.sh, but unfortunately I got stuck here.

@nabiltntn
Copy link

I am using mlab too with the same URL format and it's working with the following configuration: Meteor 1.7 , MongoDB : 3.6

Maybe you need to use simple quote around connection string:

MONGO_URL='mongodb://user:pass@host:port,host:port/database?replicaSet=name'

@jkrup
Copy link
Owner

jkrup commented Sep 27, 2018

Hey @satyavh, did @nabiltntn 's comment work for you? It definitely seems like an issue of the terminal not escaping some of the special characters. Another way around that is to use now secrets and then reference it with @MONGO_URL: https://github.com/jkrup/meteor-now#using-meteor_settings

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

3 participants