java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Unable to load data from Mongodb to Pig
    via by Unknown author,
  • I have a testing setup where I SSH tunnel from my local machine to a machine in a different VPC that hosts a mongo hidden secondary. It seems to be impossible to read from that secondary without given the driver access to the primary as well. I get the following exception when I try: {{ feature-dev 20:00:43.216 INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=localhost:27018, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 2]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=10440806} feature-dev 20:00:43.224 INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 4]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=9489844, setName='mongo1', hosts=[10.0.0.126:27017, 10.0.0.124:27017, 10.0.0.125:27017], passives=[], arbiters=[], primary='10.0.0.124:27017', tagSet=TagSet{[]}} feature-dev[ERROR] com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}] feature-dev[ERROR] at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:370) feature-dev[ERROR] at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:104) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:97) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:85) feature-dev[ERROR] at com.mongodb.operation.CommandWriteOperation.execute(CommandWriteOperation.java:55) feature-dev[ERROR] at com.mongodb.Mongo.execute(Mongo.java:745) feature-dev[ERROR] at com.mongodb.Mongo$2.execute(Mongo.java:728) feature-dev[ERROR] at com.mongodb.DB.executeCommand(DB.java:583) feature-dev[ERROR] at com.mongodb.DBCollection.getStats(DBCollection.java:1858) feature-dev[ERROR] at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByStats(MongoSplitterFactory.java:73) feature-dev[ERROR] at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:113) ... }} (can send full stack trace if necessary. Unable to attach it) I'm able to read from the primary fine. Is this behaviour unavoidable? Can the driver not function without being able to query the primary for some reason? Do I need a testing setup that has access to both primary and hidden secondary?
    via by Ratan Sebastian,
  • I have a testing setup where I SSH tunnel from my local machine to a machine in a different VPC that hosts a mongo hidden secondary. It seems to be impossible to read from that secondary without given the driver access to the primary as well. I get the following exception when I try: {{ feature-dev 20:00:43.216 INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=localhost:27018, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 2]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=10440806} feature-dev 20:00:43.224 INFO org.mongodb.driver.cluster - Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 0, 4]}, minWireVersion=0, maxWireVersion=3, maxDocumentSize=16777216, roundTripTimeNanos=9489844, setName='mongo1', hosts=[10.0.0.126:27017, 10.0.0.124:27017, 10.0.0.125:27017], passives=[], arbiters=[], primary='10.0.0.124:27017', tagSet=TagSet{[]}} feature-dev[ERROR] com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches PrimaryServerSelector. Client view of cluster state is {type=REPLICA_SET, servers=[{address=localhost:27017, type=REPLICA_SET_SECONDARY, roundTripTime=10.6 ms, state=CONNECTED}] feature-dev[ERROR] at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:370) feature-dev[ERROR] at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71) feature-dev[ERROR] at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:104) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:97) feature-dev[ERROR] at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:85) feature-dev[ERROR] at com.mongodb.operation.CommandWriteOperation.execute(CommandWriteOperation.java:55) feature-dev[ERROR] at com.mongodb.Mongo.execute(Mongo.java:745) feature-dev[ERROR] at com.mongodb.Mongo$2.execute(Mongo.java:728) feature-dev[ERROR] at com.mongodb.DB.executeCommand(DB.java:583) feature-dev[ERROR] at com.mongodb.DBCollection.getStats(DBCollection.java:1858) feature-dev[ERROR] at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByStats(MongoSplitterFactory.java:73) feature-dev[ERROR] at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:113) ... }} (can send full stack trace if necessary. Unable to attach it) I'm able to read from the primary fine. Is this behaviour unavoidable? Can the driver not function without being able to query the primary for some reason? Do I need a testing setup that has access to both primary and hidden secondary?
    via by Ratan Sebastian,
    • java.io.IOException: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=am0101.test.com:27101, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='dmdbxcc_write', source='dxccdb01', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server am0101.test.com:27101. The full response is { "ok" : 0.0, "code" : 18, "errmsg" : "Authentication failed." }}}, {address=am0102.test.com:27101, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='dmdbxcc_write', source='dxccdb01', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server am0102.test.com:27101. The full response is { "ok" : 0.0, "code" : 18, "errmsg" : "Authentication failed." }}}] at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:260) at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:68) at org.apache.hadoop.hive.ql.io.HiveInputFormat.addSplitsForGroup(HiveInputFormat.java:298) at org.apache.hadoop.hive.ql.io.HiveInputFormat.getSplitsInternal(HiveInputFormat.java:412) at org.apache.hadoop.hive.ql.io.HiveInputFormat.getSplits(HiveInputFormat.java:330) at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getCombineSplits(CombineHiveInputFormat.java:311) at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getSplitsInternal(CombineHiveInputFormat.java:519) at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getSplits(CombineHiveInputFormat.java:463) at org.apache.hadoop.mapreduce.JobSubmitter.writeOldSplits(JobSubmitter.java:328) at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:320) at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:196) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1290) at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1287) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapreduce.Job.submit(Job.java:1287) at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:575) at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:570) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:570) at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:561) at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:429) at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:137) at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:160) at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85) at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1618) at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1379) at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1192) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1019) at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1009) at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:201) at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:153) at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:364) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:712) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:631) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:570) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=am0101.test.com:27101, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='dmdbxcc_write', source='dxccdb01', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server am0101.test.com:27101. The full response is { "ok" : 0.0, "code" : 18, "errmsg" : "Authentication failed." }}}, {address=am0102.test.com:27101, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='dmdbxcc_write', source='dxccdb01', password=<hidden>, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server am0102.test.com:27101. The full response is { "ok" : 0.0, "code" : 18, "errmsg" : "Authentication failed." }}}] at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:369) at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101) at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75) at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71) at com.mongodb.binding.ClusterBinding.getReadConnectionSource(ClusterBinding.java:63) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:89) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:84) at com.mongodb.operation.CommandReadOperation.execute(CommandReadOperation.java:55) at com.mongodb.Mongo.execute(Mongo.java:772) at com.mongodb.Mongo$2.execute(Mongo.java:759) at com.mongodb.DB.executeCommand(DB.java:653) at com.mongodb.DBCollection.getStats(DBCollection.java:2083) at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByStats(MongoSplitterFactory.java:73) at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:113) at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:240) ... 44 more

    Users with the same issue

    rsprangemeijer
    2 times, last one,
    rocday
    1 times, last one,
    pulse00
    1 times, last one,
    Dunmer
    1 times, last one,
    Alireza Mohamadi
    8 times, last one,
    16 more bugmates