what might give me IllegalArgumentException java.lang.IllegalArgumentException: Could not authentica

18 views
Skip to first unread message

Lawrence Krubner

unread,
Jun 12, 2015, 3:51:18 AM6/12/15
to clojure...@googlegroups.com
I realize this may have been a bad idea, but I'm trying to use Monger with MongoDB 3.0.3. 

Today I: 

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? 











Michael Klishin

unread,
Jun 12, 2015, 3:53:35 AM6/12/15
to Monger, a Clojure MongoDB driver
2015-06-04 12:45 GMT+03:00 Lawrence Krubner <lawr...@rollioforce.com>:
I have not yet opened port 27017. I am not sure if I need to do that.

How would clients not connecting from localhost access your MongoDB node if you don't?

I can't comment on the error message but knowing how insane MongoDB Java driver was before 3.0,
I wouldn't be too surprised.
--
Reply all
Reply to author
Forward
0 new messages