Trouble connecting dev meteor 1.2.1 app to Compose.io production mongo database


#1

I am on Windows 7, trying to connect to the production mongo instance of our app. I have created a batch file to run, but the message I receive is:

“Error: URL must be in the format mongodb://user:pass@host:post/dbname”

Here is the batch file (compose.bat) that I run from the folder above app:

cd app
set MONGO_URL="mongodb://uuuuu:ppppp@aws-us-east-1-portal.14.dblayer.com:11111/ddddd"
meteor
set MONGO_URL=

where uuuuu is the bare username, ppppp is the bare password and ddddd is the database name on Compose. 11111 here is the port of the first member of the replica set on compose

The actual mongodb string I use is the same one that I use in mup.json to deploy.

What I am wondering is the issue of mongoDB versions (3.2 on compose, 2.6? on meteor) and also the port that mongo/meteor is listening on. How do these figure into the connection process?

I’ve spend a few hours on things that google suggests, both here in the forums and elsewhere, but for some reason, I can’t get past the connection problem.

Any help, greatly appreciated.

Fraser


#2

Have you confirmed the environment variable is properly set by running echo %MONGO_URL%? Also, are you using any special characters in your username/password that might affect setting the environment variable properly? If the same connection string works when defined with mup, then the variable must not be getting set properly somehow.


#3

Thank you hwillson for your observation that this should work. I confirmed that the MONGO_URL was indeed set.

So it must be something else.

Turns out the quotes were the problem. I removed them as below and was back in business.

set MONGO_URL=mongodb://uuuuu:ppppp@aws-us-east-1-portal.14.dblayer.com:11111/ddddd

Many thanks. That’s the second piece of excellent advice I have had from you. You answered both of my questions on the forum.

Best of luck in your own work.

Fraser