Lawyer_Coder
Lawyer_Coder

Reputation: 223

Meteor Deployment to Galaxy MONGO_URL must be set in environment

I am attempting to deploy to Meteor Galaxy using Monglab as my backend DB. The Mongolab account is set up properly and the username and password are all working properly. I constantly get a MONGO_URL must be set in environment

My Code: settings.json

{
    "galaxy.meteor.com": {
        "env": {
        "ROOT_URL": "http://<myapp>.meteorapp.com/", 
        "MONGO_URL":"mongodb://<login>:<password>@ds012345.mlab.com:12345/<db>"
        }
    }
}

Deployment Command

$ meteor deploy <myapp>.meteorapp.com --settings <pathto>/settings.json

This is the error message I receive:

p67c 2016-03-27 08:41:09 04:00/app/bundle/programs/server/node_modules/fibers/future.js:245
p67c 2016-03-27 08:41:09-04:00  throw(ex);
p67c 2016-03-27 08:41:09-04:00  ^
p67c 2016-03-27 08:41:10-04:00 Error: MONGO_URL must be set in environment
p67c 2016-03-27 08:41:10-04:00 at Object.<anonymous> (packages/mongo/remote_collection_driver.js:36:1)
p67c 2016-03-27 08:41:10-04:00 at Object.defaultRemoteCollectionDriver (packages/underscore/underscore.js:750:1)
p67c 2016-03-27 08:41:10-04:00 at new Mongo.Collection (packages/mongo/collection.js:102:1)
p67c 2016-03-27 08:41:10-04:00 at AccountsServer.AccountsCommon (accounts_common.js:23:18)
p67c 2016-03-27 08:41:10-04:00 at new AccountsServer (accounts_server.js:16:5)
p67c 2016-03-27 08:41:10-04:00 at Package (globals_server.js:5:12)
p67c 2016-03-27 08:41:10-04:00 at /app/bundle/programs/server/packages/accounts-base.js:1814:4
p67c 2016-03-27 08:41:10-04:00 at /app/bundle/programs/server/packages/accounts-base.js:1825:3
p67c 2016-03-27 08:41:10-04:00 at /app/bundle/programs/server/boot.js:242:10
p67c 2016-03-27 08:41:10-04:00 at Array.forEach (native)

Your advice and guidance is very much appreciated. Thank you.

Upvotes: 4

Views: 2286

Answers (3)

user5292841
user5292841

Reputation:

I was deploying to the eu-west Galaxy site eu-west-1.galaxy.meteor.com but my deployed Galaxy app still crashed with the "MONGO_URL must be set in environment" message until I used galaxy.meteor.com in the settings.json file in both places (see user2690440's post above).

Upvotes: 0

Lawyer_Coder
Lawyer_Coder

Reputation: 223

Thanks hexsprite. That actually worked. Well, I had entered it as a variable on the command line. What I needed to do was to enter that as part of my settings.json and POW! it worked. Thank you

{
    "galaxy.meteor.com": {
        "env": {
            "ROOT_URL": "http://<myapp>.meteorapp.com/", 
            "DEPLOY_HOSTNAME":"galaxy.meteor.com",    
            "MONGO_URL": "mongodb://<login>:<password>@ds0012345.mlab.com:12345/mydata"
 }

} }

Upvotes: 3

Jordan Baker
Jordan Baker

Reputation: 4635

You need to specify to deploy to Galaxy by using the environment variable DEPLOY_HOSTNAME.

Otherwise it will try to deploy to the old Meteor hosting service, IIRC.

Try this:

DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy <myapp>.meteorapp.com --settings <pathto>/settings.json

Upvotes: 3

Related Questions