-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.2
-
Component/s: Connection Management
-
Labels:None
-
Environment:Linux
Hi,
I am getting "Query failed with error code 133" error which looks like comes when there is no primary node available. For this to handle i tried to set ServerSelectionTimeout/SocketTimeout/SoketkeepAlive it didnt work. Can you please tell me which option do i need to give while creating the mongoClient object, So that i can handle the exception with some timeout in my application. Below is the error:
nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 133 and error message 'could not find host matching read preference { mode: "primary", tags: [ {} ] } fo
r set shard_B_0' on server mongo001-mongos-b-0:27018; nested exception is com.mongodb.MongoQueryException: Query failed with error code 133 and error message 'could not find host
matching read preference { mode: "primary", tags: [ {} ] } for set shard_B_0' on server XYZ:27018
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)