You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Gaetan Collaud (Jira)" <ji...@apache.org> on 2026/06/15 14:49:00 UTC
[jira] [Updated] (KAFKA-20693) NPE in error handling in AbstractHerder
[ https://issues.apache.org/jira/browse/KAFKA-20693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gaetan Collaud updated KAFKA-20693:
-----------------------------------
Description:
When creating a connector using _PUT /connectors/abc/config_ and providing wrong credentials for example for the Oracle database (when using debezium-oracle) the REST endpoint returns something like this:
{code:java}
{
"error_code":500,
"message":"Cannot invoke \"org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()\" because the return value of \"org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()\" is null"
} {code}
In the log, the full stack trace looks like this:
{code:java}
2026-06-15T16:05:28,860 ERROR || Uncaught exception in REST call to /connectors/abc/config [org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper]
java.lang.NullPointerException: Cannot invoke "org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()" because the return value of "org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()" is null
at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:1077)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.lambda$doPutConnectorConfig$1(DistributedHerder.java:1144)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.runRequest(DistributedHerder.java:2382)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:499)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:384)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
{code}
The actual error message (wrong credentials) can be found earlier in the log, but the REST response is misleading and hides the root cause.
Source code causing issue: [https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java#L1077] Apparently the configValue can be null.
Looking at github, apparently some clean-up was done in this area, maybe it's related, maybe not: [https://github.com/apache/kafka/pull/20393]
h2. How to reproduce:
Try to create an OracleConnector with an oracle that is not reachable or with wrong credentials.
_config-connector.json_
{code:java}
{
"connector.class": "io.debezium.connector.oracle.OracleConnector",
"tasks.max": "1",
"database.hostname": "do.not.exists",
"database.port": "3333",
"database.user": "dbz",
"database.password": "secret3",
"database.dbname": "abc",
"schema.include.list": "a",
"table.include.list": "b.c"
} {code}
{code:java}
curl -X PUT -H "Content-type: application/json" -d @config-connector.json localhost:8083/connectors/abc/config {code}
was:
When creating a connector using _PUT /connectors/abc/config_ and providing wrong credentials for example for the Oracle database (when using debezium-oracle) the REST endpoint returns something like this:
{code:java}
{
"error_code":500,
"message":"Cannot invoke \"org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()\" because the return value of \"org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()\" is null"
} {code}
In the log, the full stack trace looks like this:
{code:java}
2026-06-15T16:05:28,860 ERROR || Uncaught exception in REST call to /connectors/abc/config [org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper]
java.lang.NullPointerException: Cannot invoke "org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()" because the return value of "org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()" is null
at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:1077)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.lambda$doPutConnectorConfig$1(DistributedHerder.java:1144)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.runRequest(DistributedHerder.java:2382)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:499)
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:384)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
{code}
The actual error message (wrong credentials) can be found earlier in the log, but the REST response is misleading and hides the root cause.
Source code causing issue: [https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java#L1077] Apparently the configValue can be null.
Looking at github, apparently some clean-up was done in this area, maybe it's related, maybe not: [https://github.com/apache/kafka/pull/20393]
h2. How to reproduce:
Try to create an OracleConnector with an oracle that is not reachable or with wrong credentials.
_config-connector.json_
{code:java}
{
"connector.class": "io.debezium.connector.oracle.OracleConnector",
"tasks.max": "1",
"database.hostname": "do.not.exists",
"database.port": "3333",
"database.user": "dbz",
"database.password": "secret3",
"database.dbname": "abc",
"schema.include.list": "a",
"table.include.list": "b.c"
} {code}
{code:java}
curl -X PUT -H "Content-type: application/json" -d @config-connector.json localhost:8083/connectors/abc/config {code}
> NPE in error handling in AbstractHerder
> ---------------------------------------
>
> Key: KAFKA-20693
> URL: https://issues.apache.org/jira/browse/KAFKA-20693
> Project: Kafka
> Issue Type: Bug
> Components: connect
> Affects Versions: 4.2.1
> Reporter: Gaetan Collaud
> Priority: Major
>
> When creating a connector using _PUT /connectors/abc/config_ and providing wrong credentials for example for the Oracle database (when using debezium-oracle) the REST endpoint returns something like this:
>
> {code:java}
> {
> "error_code":500,
> "message":"Cannot invoke \"org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()\" because the return value of \"org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()\" is null"
> } {code}
> In the log, the full stack trace looks like this:
> {code:java}
> 2026-06-15T16:05:28,860 ERROR || Uncaught exception in REST call to /connectors/abc/config [org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper]
> java.lang.NullPointerException: Cannot invoke "org.apache.kafka.connect.runtime.rest.entities.ConfigValueInfo.errors()" because the return value of "org.apache.kafka.connect.runtime.rest.entities.ConfigInfo.configValue()" is null
> at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:1077)
> at org.apache.kafka.connect.runtime.distributed.DistributedHerder.lambda$doPutConnectorConfig$1(DistributedHerder.java:1144)
> at org.apache.kafka.connect.runtime.distributed.DistributedHerder.runRequest(DistributedHerder.java:2382)
> at org.apache.kafka.connect.runtime.distributed.DistributedHerder.tick(DistributedHerder.java:499)
> at org.apache.kafka.connect.runtime.distributed.DistributedHerder.run(DistributedHerder.java:384)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
> at java.base/java.lang.Thread.run(Thread.java:1583)
> {code}
> The actual error message (wrong credentials) can be found earlier in the log, but the REST response is misleading and hides the root cause.
> Source code causing issue: [https://github.com/apache/kafka/blob/trunk/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java#L1077] Apparently the configValue can be null.
> Looking at github, apparently some clean-up was done in this area, maybe it's related, maybe not: [https://github.com/apache/kafka/pull/20393]
> h2. How to reproduce:
> Try to create an OracleConnector with an oracle that is not reachable or with wrong credentials.
> _config-connector.json_
> {code:java}
> {
> "connector.class": "io.debezium.connector.oracle.OracleConnector",
> "tasks.max": "1",
> "database.hostname": "do.not.exists",
> "database.port": "3333",
> "database.user": "dbz",
> "database.password": "secret3",
> "database.dbname": "abc",
> "schema.include.list": "a",
> "table.include.list": "b.c"
> } {code}
> {code:java}
> curl -X PUT -H "Content-type: application/json" -d @config-connector.json localhost:8083/connectors/abc/config {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)