Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-8074

MongoDb connector crushes on incremental snapshot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • None
    • 2.7.0.Final
    • mongodb-connector
    • None
    • False
    • None
    • False

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      io.debezium.connector.mongodb.MongoDbConnector
      3.7.0

      What is the connector configuration?

          tasks.max: 1
          mongodb.connection.string: 'mongodb+srv:***'
          topic.prefix: 'fleet-mongo'
          collection.include.list: 'dev_fleetprodb.debezium_signal,dev_fleetprodb.eventdata'
          database.include.list: dev_fleetprodb
          capture.mode: change_streams_update_full
          skipped.operations: 'none'
          transforms: 'RegexReroute'
          transforms.RegexReroute.type: 'org.apache.kafka.connect.transforms.RegexRouter'
          transforms.RegexReroute.regex: '.*'
          transforms.RegexReroute.replacement: 'debezium_test_fleet_mongo'
          key.converter: 'org.apache.kafka.connect.storage.StringConverter'
          key.converter.schemas.enable: 'false'
          value.converter: org.apache.kafka.connect.json.JsonConverter
          value.converter.schemas.enable: 'false'
          signal.enabled.channels: 'source'
          signal.data.collection: 'dev_fleetprodb.debezium_signal'

      What is the captured database version and mode of deployment?

      MongoDb in Atlas cloud. Version 5.0.26

      What behavior do you expect?

      After inserting a signal into the signal collection the connector performs incremental snapshot and proceeds with cdc changes

      What behavior do you see?

      After inserting a signal into the signal collection the connector crushes and never recovers (until delete and recreate offsets storage topic)

      The signal collection element:

      {"_id":\{"$oid":"6697b7b7d470bc6750689664"}

      ,"type":"execute-snapshot","data":{"data-collections":["dev_fleetprodb.eventdata"],"type":"incremental"}}

       

      The offset topic event:

      { "sec": 1721219402, "ord": 1, "incremental_snapshot_correlation_id": "6697b7b7d470bc6750689664", "resume_token": "gQAAAAJfZGF0YQBxAAAAO***", "incremental_snapshot_maximum_key": "aced000570", "incremental_snapshot_collections": "[\{\"incremental_snapshot_collections_id\":\"dev_fleetprodb.eventdata\",\"incremental_snapshot_collections_additional_condition\":null}

      ]", "incremental_snapshot_primary_key": "aced000570" }

      Do you see the same behaviour using the latest released Debezium version?

      yes

      Do you have the connector logs, ideally from start till finish?

      ERROR [debezium-connector-fleet-mongo|task-0] Producer failure (io.debezium.pipeline.ErrorHandler) [debezium-mongodbconnector-fleet-mongo-change-event-source-coordinator]
      io.debezium.DebeziumException: Database error while executing incremental snapshot for table 'DataCollection{id=dev_fleetprodb.eventdata, additionalCondition=, surrogateKey=}'
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.readChunk(MongoDbIncrementalSnapshotChangeEventSource.java:343)
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.init(MongoDbIncrementalSnapshotChangeEventSource.java:269)
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.init(MongoDbIncrementalSnapshotChangeEventSource.java:76)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$initStreamEvents$7(ChangeEventSourceCoordinator.java:328)
          at java.base/java.util.Optional.ifPresent(Optional.java:178)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.initStreamEvents(ChangeEventSourceCoordinator.java:328)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:302)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:203)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:143)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          at java.base/java.lang.Thread.run(Thread.java:840)
      Caused by: io.debezium.DebeziumException: Error while attempting to emit window open for chunk 'c3492866-47cd-4ebf-99fc-e7a6b3c02d80'
          at io.debezium.connector.mongodb.connection.MongoDbConnections.lambda$eventSourcingErrorHandler$1(MongoDbConnections.java:53)
          at io.debezium.connector.mongodb.connection.MongoDbConnection.execute(MongoDbConnection.java:111)
          at io.debezium.connector.mongodb.connection.MongoDbConnection.execute(MongoDbConnection.java:88)
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.emitWindowOpen(MongoDbIncrementalSnapshotChangeEventSource.java:216)
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.readChunk(MongoDbIncrementalSnapshotChangeEventSource.java:290)
          ... 13 more
      Caused by: java.lang.NullPointerException: Cannot invoke "io.debezium.connector.mongodb.CollectionId.dbName()" because "collectionId" is null
          at io.debezium.connector.mongodb.snapshot.MongoDbIncrementalSnapshotChangeEventSource.lambda$emitWindowOpen$0(MongoDbIncrementalSnapshotChangeEventSource.java:219)
          at io.debezium.connector.mongodb.connection.MongoDbConnection.lambda$execute$0(MongoDbConnection.java:89)
          at io.debezium.connector.mongodb.connection.MongoDbConnection.execute(MongoDbConnection.java:105)
          ... 16 more

              Unassigned Unassigned
              mdubovik78 Mikhail Dubovik (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: