I realize this may have been a bad idea, but I'm trying to use Monger with MongoDB 3.0.3.
I spun up a new RedHat instance on AWS.
Installed the latest MongoDB.
Spun up my Clojure app.
And got this message:
#<IllegalArgumentException java.lang.IllegalArgumentException: Could not authenticate with MongoDB. Either database name or credentials are invalid. Database name: xxxxxx, username: xxxxxxx>
I've checked the credentials many times, and they appear correct. My code that connects looks like this:
(let [credentials (read-string (slurp "/etc/salesslick"))
uri (str "mongodb://" (:username credentials) ":" (:password credentials) "@" (:host credentials) "/" (:db credentials))
{ :keys [conn db] } (mg/connect-via-uri uri)]
Is there anything obvious here that should fail?
If I ssh to the server and run "mongo" then I can use the credentials to log in and go to a secured database and then make an insert and a find, so I know the credentials work.
I have not yet opened port 27017. I am not sure if I need to do that. Is this the error I would get if the problem was the with the port?