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

Avoid NPE at runtime in EventRouter when incorrect configuration is given.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.10.0.CR2
    • 0.10.0.CR1
    • core-library
    • None

      When configuration is provided that isn't correct, the outbox event router code can hit a NPE and such errors are very ambiguous and do not help the user diagnose their mistake. For example, if the payload field doesn't match any fields in the structure, a NPE will occur rather than informing the user that there was a problem with the payload configuration.

      2019-09-21 12:01:27,002 ERROR  ||  WorkerSourceTask{id=postgres-source-connector-mt_events-0} Task threw an uncaught and unrecoverable exception   [org.apache.kafka.connect.runtime.WorkerTask]
      org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handler
          at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)
          at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)
          at org.apache.kafka.connect.runtime.TransformationChain.apply(TransformationChain.java:50)
          at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:293)
          at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:229)
          at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:177)
          at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:227)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException
          at io.debezium.transforms.outbox.EventRouter.apply(EventRouter.java:104)
          at org.apache.kafka.connect.runtime.TransformationChain.lambda$apply$0(TransformationChain.java:50)
          at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)
          at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)
          ... 11 more
      

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: