[JAVA-1892] Failed to authenticate to database Created: 15/Jul/15  Updated: 11/Sep/19  Resolved: 16/Jul/15

Status: Closed
Project: Java Driver
Component/s: Connection Management
Affects Version/s: 3.0.2
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: jaehee song Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Red Hat Enterprise Linux Server release 6.5 (Santiago)
org.springframework.data
spring-data-mongodb
1.2.0.Release



 Description   

One of developer has an issue of accessing to MongoDB instance (ver 3.0.3) from one of app server. Port 27017 is opened from the app server to the mongodb intance.
using mongo -u -p --authnticatiionDatabase I can access to the database. So it seems OK with credidencial.

He is using Spring Data MongoDB 1.2.0
Below is the error message

[‎7/‎15/‎2015 3:17 PM] Pearce, Jim:
No Title
19:37:40.257 [tomcat-http--7] DEBUG o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolving exception from handler [public org.springframework.http.ResponseEntity<c om.visa.ip.vcpc.domain.CRGetPC<com.visa.ip.vcpc.model.PaymentControl>> com.visa.ip .vcpc.controller.VCPCController.createPaymentControl(com.visa.ip.vcpc.model.Paymen tControl,java.lang.String,java.lang.String) throws java.lang.Exception]: org.sprin gframework.data.mongodb.CannotGetMongoDbConnectionException: Failed to authenticat e to database [vcpc], username = [vcpc_dev], password = [v********!]

Thanks,



 Comments   
Comment by jaehee song [ 16/Jul/15 ]

Our developer upgraded the Java driver and reported that it is working now.

You may resolve this ticket. Thanks for your help on this.

Thanks

Comment by Jeffrey Yemin [ 15/Jul/15 ]

That's a very old version of Spring Data. Any idea what version of the Java driver you're using it with? If you're connecting to a fresh MongoDB 3.0 installation, you'll need to use at minimum 2.13 or 3.0 version of the driver, as the default authentication mechanism changed in MongoDB 3.0, and that mechanism is only support in 2.13 and 3.0 of the Java driver.

See http://docs.mongodb.org/manual/release-notes/3.0-scram/ for further details.

Generated at Thu Feb 08 08:55:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.