Galaxy DB Connection To App

It has been a while since I have deployed a Meteor app (Back when Heroku was still cool). Galaxy support is extremely non existent unless you are onboarding a new account.

I am just trying to connect my DB to my app, both which are provided by galaxy. My app is deployed through git and has a settings.json of

{
  "public": {
    "appName": "Local Legends Live",
    "environment": "production"
  },
  "galaxy.meteor.com": {
    "env": {
      "MONGO_URL": "mongodb://MY_DB_USER_NAME:MY_DB_PASSWORD@locallegends_locallegends-01.mongodb.galaxy-cloud.io:30078,locallegends_locallegends-02.mongodb.galaxy-cloud.io:30078,locallegends_locallegends-03.mongodb.galaxy-cloud.io:30078/DB_NAME?replicaSet=locallegends_locallegends",
      "ROOT_URL": "https://locallegendslive.meteorapp.com",
      "NODE_ENV": "production"
    }
  }
}

I am able to connect externally via MongoDB Compass.

My build is successful but no I am getting the following error no matter what adjustments I make

MongoServerError: Authentication failed.

errorClass [Error]: [An error occurred when creating an index for collection "users: Authentication failed.]

I have added the users collection to the collection inside the db and even imported data to it.

to top it off going to app > settings reads “The content you were looking for could not be found”

Any hints to fix would be helpful - I am deploying through git

Hey @nicholasbydesign, this sounds similar to an issue I had before. If your DB user was created with authSource=admin, try adding &authSource=admin to your MONGO_URL. Also, make sure your DB username and password are URL-encoded if they contain special characters. Sometimes setting retryWrites=false in the URL can help with Galaxy connections. Finally, double-check that your DB user has readWrite permissions on the database; Compass might connect fine with broader privileges than your app uses.

1 Like

Hello,

Exactly what @metrich said, authSource=admin will solve your problem.

Best Regards,

1 Like

Hello,

Everything @philippeoliveira said and it should work with no problems.

Best Regards,

1 Like

Thank you all for the help and you time in the support chat @philippeoliveira

It is now connected :partying_face:

1 Like