Getting DNS name not found error

Hi Team,

I am getting this error while running the test case, few minutes back it is working fine and suddenly I start getting this error.
Successfully able to connect to cluster through compass and shell.
I have not changed any configuration since I download the mflix application.


Test set: mflix.api.daos.GetCommentsTest

Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 5.597 s <<< FAILURE! - in mflix.api.daos.GetCommentsTest
testGetMovieComments(mflix.api.daos.GetCommentsTest) Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mongoClient’ defined in mflix.config.MongoDBConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method ‘mongoClient’ threw exception; nested exception is com.mongodb.MongoConfigurationException: Unable to look up SRV record for host cluster0.9tbhc.mongodb.net
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method ‘mongoClient’ threw exception; nested exception is com.mongodb.MongoConfigurationException: Unable to look up SRV record for host cluster0.9tbhc.mongodb.net
Caused by: com.mongodb.MongoConfigurationException: Unable to look up SRV record for host cluster0.9tbhc.mongodb.net
Caused by: javax.naming.NameNotFoundException: DNS name not found [response code 3]

Are there any changes that happened in between this time? Like VPN, firewall, or any code changes?

Kanika

Thanks @kanikasingla
Nice catch, yes it’s the VPN that is causing the problem.