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

Put the MysqlPartition values to MDC getting NPE in logging context phase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Alpha2
    • None
    • core-library
    • None
    • False
    • None
    • False

      Create/restart a connector will get following NPE in the log2j-1.2.17.jar which using the `Hashtable` to store key/value parameters.

      [2022-06-01 01:14:03,769] ERROR [test_avro_source_v2|task-0] Producer failure (io.debezium.pipeline.ErrorHandler:35)java.lang.NullPointerException  at java.base/java.util.Hashtable.put(Hashtable.java:475)  at org.apache.log4j.MDC.put0(MDC.java:150)  at org.apache.log4j.MDC.put(MDC.java:85)  at org.slf4j.impl.Log4jMDCAdapter.put(Log4jMDCAdapter.java:67)  at org.slf4j.MDC.put(MDC.java:147)  at java.base/java.util.Collections$SingletonMap.forEach(Collections.java:4948)  at io.debezium.util.LoggingContext.forConnector(LoggingContext.java:103)  at io.debezium.connector.common.CdcSourceTaskContext.configureLoggingContext(CdcSourceTaskContext.java:62)  at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:136)  at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)  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:834)[2022-06-01 01:14:04,262] INFO [test_avro_source_v2|task-0] WorkerSourceTask{id=test_avro_source_v2-0} flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:505)[2022-06-01 01:14:04,262] ERROR [test_avro_source_v2|task-0] WorkerSourceTask{id=test_avro_source_v2-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:193)org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.  at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:50)  at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:116)  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:834)Caused by: java.lang.NullPointerException  at java.base/java.util.Hashtable.put(Hashtable.java:475)  at org.apache.log4j.MDC.put0(MDC.java:150)  at org.apache.log4j.MDC.put(MDC.java:85)  at org.slf4j.impl.Log4jMDCAdapter.put(Log4jMDCAdapter.java:67)  at org.slf4j.MDC.put(MDC.java:147)  at java.base/java.util.Collections$SingletonMap.forEach(Collections.java:4948)  at io.debezium.util.LoggingContext.forConnector(LoggingContext.java:103)  at io.debezium.connector.common.CdcSourceTaskContext.configureLoggingContext(CdcSourceTaskContext.java:62)  at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:136)  at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)  ... 5 more 

       

              Unassigned Unassigned
              ywyuewei Harvey Yue (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: