Uploaded image for project: 'Kafka Connector'
  1. Kafka Connector
  2. KAFKA-145

org.bson.BsonInvalidOperationException: Value expected to be of type DOCUMENT is of unexpected type NULL

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0
    • Affects Version/s: 1.2.0
    • Component/s: Source
    • None
    • Environment:
      kafka version: 2.6

      My source connector terminating with this error.

      [2020-08-20 20:05:52,666] ERROR WorkerSourceTask{id=mongo-source-assets-mongos-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:187)
      org.bson.BsonInvalidOperationException: Value expected to be of type DOCUMENT is of unexpected type NULL
      at org.bson.BsonValue.throwIfInvalidType(BsonValue.java:419)
      at org.bson.BsonValue.asDocument(BsonValue.java:47)
      at org.bson.BsonDocument.getDocument(BsonDocument.java:136)
      at com.mongodb.kafka.connect.source.MongoSourceTask.poll(MongoSourceTask.java:189)
      at org.apache.kafka.connect.runtime.WorkerSourceTask.poll(WorkerSourceTask.java:289)
      at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:256)
      at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:185)
      at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:235)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:830)
      [2020-08-20 20:05:52,667] ERROR WorkerSourceTask{id=mongo-source-assets-mongos-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:188)
      [2020-08-20 20:05:52,667] INFO Stopping MongoDB source task (com.mongodb.kafka.connect.source.MongoSourceTask:223)
      [2020-08-20 20:05:52,669] INFO Closed connection [connectionId

      {localValue:3}

      ] to 10.74.3.104:27017 because the pool has been closed. (org.mongodb.driver.connection:71)
      [2020-08-20 20:05:52,669] INFO [Producer clientId=connector-producer-mongo-source-assets-mongos-0] Closing the Kafka producer with timeoutMillis = 30000 ms. (org.apache.kafka.clients.producer.KafkaProducer:1189)

      Can someone please take a look at this error and tell me if this is something expected?

      Thanks,

      Rajaramesh

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            yaramati@adobe.com Rajaramesh Yaramati
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: