org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1]

JIRA | Eduardo Mayer | 2 years ago
  1. 0

    MongoDb Java driver - MongoException$Network: Read operation to server localhost:27017 failed

    Stack Overflow | 2 years ago | Eduardo Mayer
    org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1]
  2. 0

    We started getting the below error intermittently during the last week. So far we could not trace this problem to anything in particular. The query in particular is an aggregation to a collection which has around 400k objects. We have the same application running for different clients and it started happening to clients which have passed that 400k mark. I ran the query directly and it took about 1.5 seconds. The same exact exception took place when we were iterating over the results of another aggregation: DBCursor cursor = db.cMD.find([colaborador: [$in: listP], data: data], [colab: 1, _id: 0]) def listW = [] while (cursor.hasNext()) { <-- (Exception happened here) def resultMap = cursor.next().toMap() listW.add(resultMap.colab) } 2015-05-20 14:03:43,511 [quartzScheduler_Worker-6] ERROR listeners.ExceptionPrinterJobListener - Exception occurred in job: Grails Job org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1] at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111) at grails.plugins.quartz.QuartzDisplayJob.execute(QuartzDisplayJob.groovy:27) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:300) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:271) at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:84) at com.mongodb.DB.command(DB.java:317) at com.mongodb.DB.command(DB.java:296) at com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:99) at com.mongodb.DBCollection.aggregate(DBCollection.java:1571) at com.gmongo.internal.Patcher._invoke(Patcher.groovy:49) at com.gmongo.internal.Patcher$__patchInternal_closure1.doCall(Patcher.groovy:38) at OUR APPLICATION CODE at GrailsMelodyGrailsPlugin$_closure4_closure16_closure17.doCall(GrailsMelodyGrailsPlugin.groovy:184) at OUR APPLICATION CODE at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:102) ... 3 more Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.read(SocketInputStream.java:152) at java.net.SocketInputStream.read(SocketInputStream.java:122) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.bson.io.Bits.readFully(Bits.java:48) at org.bson.io.Bits.readFully(Bits.java:35) at org.bson.io.Bits.readFully(Bits.java:30) at com.mongodb.Response.<init>(Response.java:42) at com.mongodb.DBPort$1.execute(DBPort.java:141) at com.mongodb.DBPort$1.execute(DBPort.java:135) at com.mongodb.DBPort.doOperation(DBPort.java:164) at com.mongodb.DBPort.call(DBPort.java:135) at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:292) ... 16 more

    JIRA | 2 years ago | Eduardo Mayer
    org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1]
  3. 0

    We started getting the below error intermittently during the last week. So far we could not trace this problem to anything in particular. The query in particular is an aggregation to a collection which has around 400k objects. We have the same application running for different clients and it started happening to clients which have passed that 400k mark. I ran the query directly and it took about 1.5 seconds. The same exact exception took place when we were iterating over the results of another aggregation: DBCursor cursor = db.cMD.find([colaborador: [$in: listP], data: data], [colab: 1, _id: 0]) def listW = [] while (cursor.hasNext()) { <-- (Exception happened here) def resultMap = cursor.next().toMap() listW.add(resultMap.colab) } 2015-05-20 14:03:43,511 [quartzScheduler_Worker-6] ERROR listeners.ExceptionPrinterJobListener - Exception occurred in job: Grails Job org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1] at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111) at grails.plugins.quartz.QuartzDisplayJob.execute(QuartzDisplayJob.groovy:27) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:300) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:271) at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:84) at com.mongodb.DB.command(DB.java:317) at com.mongodb.DB.command(DB.java:296) at com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:99) at com.mongodb.DBCollection.aggregate(DBCollection.java:1571) at com.gmongo.internal.Patcher._invoke(Patcher.groovy:49) at com.gmongo.internal.Patcher$__patchInternal_closure1.doCall(Patcher.groovy:38) at OUR APPLICATION CODE at GrailsMelodyGrailsPlugin$_closure4_closure16_closure17.doCall(GrailsMelodyGrailsPlugin.groovy:184) at OUR APPLICATION CODE at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:102) ... 3 more Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.read(SocketInputStream.java:152) at java.net.SocketInputStream.read(SocketInputStream.java:122) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at org.bson.io.Bits.readFully(Bits.java:48) at org.bson.io.Bits.readFully(Bits.java:35) at org.bson.io.Bits.readFully(Bits.java:30) at com.mongodb.Response.<init>(Response.java:42) at com.mongodb.DBPort$1.execute(DBPort.java:141) at com.mongodb.DBPort$1.execute(DBPort.java:135) at com.mongodb.DBPort.doOperation(DBPort.java:164) at com.mongodb.DBPort.call(DBPort.java:135) at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:292) ... 16 more

    JIRA | 2 years ago | Eduardo Mayer
    org.quartz.JobExecutionException: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1 [See nested exception: com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database application1]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Need @JsonScalaEnumeration to determine key type when it is present (only for full test suite run)

    GitHub | 2 years ago | kgignatyev
    com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database mcytravel
  6. 0

    graylog web and server not working port 9000 is not running

    GitHub | 7 months ago | nithiya123
    com.mongodb.MongoException$Network: Read operation to server localhost:27017 failed on database graylog2

    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. com.mongodb.MongoException$Network

      Read operation to server localhost:27017 failed on database application1

      at com.mongodb.DBTCPConnector.innerCall()
    2. MongoDB Java Driver
      DBCollection.aggregate
      1. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:300)
      2. com.mongodb.DBTCPConnector.call(DBTCPConnector.java:271)
      3. com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:84)
      4. com.mongodb.DB.command(DB.java:317)
      5. com.mongodb.DB.command(DB.java:296)
      6. com.mongodb.DBCollectionImpl.aggregate(DBCollectionImpl.java:99)
      7. com.mongodb.DBCollection.aggregate(DBCollection.java:1571)
      7 frames
    3. com.gmongo.internal
      Patcher$__patchInternal_closure1.doCall
      1. com.gmongo.internal.Patcher._invoke(Patcher.groovy:49)
      2. com.gmongo.internal.Patcher$__patchInternal_closure1.doCall(Patcher.groovy:38)
      2 frames