java.lang.IllegalArgumentException: 'ok' should never be null...

JIRA | Nazar Volynets | 3 years ago
  1. 0

    Invalid exception in case of mongos lost connection to all config servers. STR: 1. Deploy mongo sharded cluster 2. Periodically write the data into mongo sharded cluster by using Mongo Java Driver & mongos instance 3. Kill all mongod config servers (mongod --config) 4. Execute the next command in mongos (through mongo shell) to clear current cluster information cached by a mongos & reload all sharded cluster metadata from the config database: {code} > db.adminCommand("flushRouterConfig"); {code} The next invalid exception will be observed on Java side (Mongo Java Driver): {code} java.lang.IllegalArgumentException: 'ok' should never be null... at com.mongodb.CommandResult.ok(CommandResult.java:43) at com.mongodb.CommandResult.throwOnError(CommandResult.java:109) at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:102) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:142) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:115) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:248) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204) at com.mongodb.DBCollection.insert(DBCollection.java:76) at com.mongodb.DBCollection.insert(DBCollection.java:60) at com.mongodb.DBCollection.insert(DBCollection.java:119) at com.llnw.edge.query.loader.UniquenessDaoImpl.insertAsStringSafe(UniquenessDaoImpl.java:76) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:69) at com.llnw.edge.query.loader.RetryTemplate.doExecute(RetryTemplate.java:245) at com.llnw.edge.query.loader.RetryTemplate.execute(RetryTemplate.java:138) at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy0.insertAsStringSafe(Unknown Source) at com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask$7.add(UniquenessLoadManager.java:329) at com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask.run(UniquenessLoadManager.java:385) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) {code} But Mongo shell (connected to mongos) returns the next exception: {code} Mon Nov 4 18:49:10 uncaught exception: error { "$err" : "error loading initial database config information :: caused by :: all servers down!", "code" : 8002 } {code} Expected Result: Any exception from mongo related exceptions stack instead of IllegalArgumentException.

    JIRA | 3 years ago | Nazar Volynets
    java.lang.IllegalArgumentException: 'ok' should never be null...
  2. 0

    Insert error on Mongo Java driver 3.x ... "IllegalArgumentException ... cluster can not be null"

    GitHub | 2 years ago | colmmcdonnell
    java.lang.IllegalArgumentException: cluster can not be null
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Store multiple JSON documents (in row arrays format with nested JSON key-value objects) in MongoDB

    Stack Overflow | 3 years ago | user1264304
    java.lang.IllegalArgumentException: BasicBSONList can only work with numeric keys, not: [_id]
  5. 0

    Jackson Serialize Map to List

    Stack Overflow | 3 years ago | user1236874
    java.lang.IllegalArgumentException: can't serialize class CustomObject

  1. poroszd 3 times, last 4 months ago
  2. rp 1 times, last 5 months ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    'ok' should never be null...

    at com.mongodb.CommandResult.ok()
  2. MongoDB Java Driver
    DBCollection.insert
    1. com.mongodb.CommandResult.ok(CommandResult.java:43)
    2. com.mongodb.CommandResult.throwOnError(CommandResult.java:109)
    3. com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:102)
    4. com.mongodb.DBTCPConnector.say(DBTCPConnector.java:142)
    5. com.mongodb.DBTCPConnector.say(DBTCPConnector.java:115)
    6. com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:248)
    7. com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:204)
    8. com.mongodb.DBCollection.insert(DBCollection.java:76)
    9. com.mongodb.DBCollection.insert(DBCollection.java:60)
    10. com.mongodb.DBCollection.insert(DBCollection.java:119)
    10 frames
  3. com.llnw.edge
    UniquenessDaoImpl.insertAsStringSafe
    1. com.llnw.edge.query.loader.UniquenessDaoImpl.insertAsStringSafe(UniquenessDaoImpl.java:76)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3. java.lang.reflect.Method.invoke(Method.java:597)
    3 frames
  5. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    3 frames
  6. Spring Retry
    RetryOperationsInterceptor$1.doWithRetry
    1. org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:69)
    1 frame
  7. com.llnw.edge
    RetryTemplate.execute
    1. com.llnw.edge.query.loader.RetryTemplate.doExecute(RetryTemplate.java:245)
    2. com.llnw.edge.query.loader.RetryTemplate.execute(RetryTemplate.java:138)
    2 frames
  8. Spring Retry
    RetryOperationsInterceptor.invoke
    1. org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:90)
    1 frame
  9. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    4. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    4 frames
  10. Unknown
    $Proxy0.insertAsStringSafe
    1. $Proxy0.insertAsStringSafe(Unknown Source)
    1 frame
  11. com.llnw.edge
    UniquenessLoadManager$AddUUIDTask.run
    1. com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask$7.add(UniquenessLoadManager.java:329)
    2. com.llnw.edge.query.loader.UniquenessLoadManager$AddUUIDTask.run(UniquenessLoadManager.java:385)
    2 frames
  12. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    6. java.lang.Thread.run(Thread.java:662)
    6 frames