Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3277

The error message "Error reading from input stream" at AsyncStreamHelper.java:202 is misleading

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Error Handling, GridFS
    • None
    • Fully Compatible

      The errormessage "Error reading from input stream" at AsyncStreamHelper.java:202 is misleading, in my case the error occured while writing to the output stream.

       

      com.mongodb.MongoGridFSException: Error reading from input stream
       at com.mongodb.async.client.gridfs.helpers.AsyncStreamHelper$4.write(AsyncStreamHelper.java:204) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.reactivestreams.client.internal.GridFSAsyncStreamHelper$2$1.apply(GridFSAsyncStreamHelper.java:104) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.reactivestreams.client.internal.GridFSAsyncStreamHelper$2$1.apply(GridFSAsyncStreamHelper.java:101) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.async.client.SingleResultCallbackSubscription.requestInitialData(SingleResultCallbackSubscription.java:38) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.AbstractSubscription.tryRequestInitialData(AbstractSubscription.java:151) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.AbstractSubscription.request(AbstractSubscription.java:84) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.reactivestreams.client.internal.ObservableToPublisher$1$1.request(ObservableToPublisher.java:50) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.reactivestreams.client.internal.GridFSAsyncStreamHelper$4$1.onSubscribe(GridFSAsyncStreamHelper.java:218) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.reactivestreams.client.internal.ObservableToPublisher$1.onSubscribe(ObservableToPublisher.java:39) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.async.client.SingleResultCallbackSubscription.<init>(SingleResultCallbackSubscription.java:33) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.Observables$2.subscribe(Observables.java:78) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.reactivestreams.client.internal.ObservableToPublisher.subscribe(ObservableToPublisher.java:36) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.reactivestreams.client.internal.GridFSAsyncStreamHelper$4.write(GridFSAsyncStreamHelper.java:213) ~[mongodb-driver-reactivestreams-1.11.0.jar:na]
       at com.mongodb.async.client.gridfs.GridFSBucketImpl$8.onResult(GridFSBucketImpl.java:664) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSBucketImpl$8.onResult(GridFSBucketImpl.java:657) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$3.onResult(GridFSDownloadStreamImpl.java:142) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$3.onResult(GridFSDownloadStreamImpl.java:138) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl.checkAndFetchResults(GridFSDownloadStreamImpl.java:191) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl.processResults(GridFSDownloadStreamImpl.java:264) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl.access$1000(GridFSDownloadStreamImpl.java:41) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$6.onResult(GridFSDownloadStreamImpl.java:229) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$6.onResult(GridFSDownloadStreamImpl.java:217) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:136) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:100) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl.checkAndFetchResults(GridFSDownloadStreamImpl.java:217) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl.access$400(GridFSDownloadStreamImpl.java:41) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$5.onResult(GridFSDownloadStreamImpl.java:212) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.async.client.gridfs.GridFSDownloadStreamImpl$5.onResult(GridFSDownloadStreamImpl.java:205) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.async.client.OperationExecutorImpl$1$1.onResult(OperationExecutorImpl.java:82) ~[mongodb-driver-async-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.operation.FindOperation$3.onResult(FindOperation.java:807) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.operation.OperationHelper$ReferenceCountedReleasingWrappedCallback.onResult(OperationHelper.java:364) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.operation.CommandOperationHelper$2.onResult(CommandOperationHelper.java:406) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:227) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:85) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:395) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:372) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:667) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:634) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:510) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:507) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.completed(AsynchronousChannelStream.java:220) ~[mongodb-driver-core-3.10.2.jar:na]
       at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.completed(AsynchronousChannelStream.java:203) ~[mongodb-driver-core-3.10.2.jar:na]
       at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) ~[na:na]
       at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) ~[na:na]
       at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) ~[na:na]
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
       at java.base/java.lang.Thread.run(Thread.java:835) ~[na:na]
      Caused by: java.lang.NullPointerException: null
       at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.doWrite(Http11OutputBuffer.java:530) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:110) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:189) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.coyote.Response.doWrite(Response.java:599) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:329) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.OutputBuffer.appendByteArray(OutputBuffer.java:736) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.OutputBuffer.append(OutputBuffer.java:665) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:376) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:354) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:96) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
       at com.mongodb.async.client.gridfs.helpers.AsyncStreamHelper$4.write(AsyncStreamHelper.java:202) ~[mongodb-driver-async-3.10.2.jar:na]
       ... 55 common frames omitted

            Assignee:
            Unassigned Unassigned
            Reporter:
            wutzebaer Peter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: