Skip to content

Config validation: Null pointer exception on some kafka client override configs #95

Open
@chuck-alt-delete

Description

@chuck-alt-delete

Ran a test with an invalid consumer override config:

    @Test
    public void testValidateConnectorPluginConfig() {
        ConnectorPluginConfigValidationResults results = kafkaConnectClient.validateConnectorPluginConfig(
            ConnectorPluginConfigDefinition.newBuilder()
                .withName("JdbcSinkConnector")
                .withConfig("connector.class", "io.confluent.connect.jdbc.JdbcSinkConnector")
                .withConfig("tasks.max", "1")
                .withConfig("connection.url", "jdbc:postgresql://postgres:5432/postgres?user=postgres&password=pwd&ssl=false")
                .withConfig("mode", "incrementing")
                .withConfig("topics", "pageviews")
                .withConfig("consumer.override.this.doesnt.exist.ms", "20000")
                .withConfig("name", "test")
                .build()
        );
...

Error:

java.lang.NullPointerException: Cannot invoke "org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorPluginConfigValidationResults$Config$Definition.getName()" because the return value of "org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorPluginConfigValidationResults$Config.getDefinition()" is null

Here are some other configs I tried with results in the comments:

    @Test
    public void testValidateConnectorPluginConfig() {
        ConnectorPluginConfigValidationResults results = kafkaConnectClient.validateConnectorPluginConfig(
            ConnectorPluginConfigDefinition.newBuilder()
                .withName("JdbcSinkConnector")
                .withConfig("connector.class", "io.confluent.connect.jdbc.JdbcSinkConnector")
                .withConfig("tasks.max", "1")
                .withConfig("connection.url", "jdbc:postgresql://postgres:5432/postgres?user=postgres&password=pwd&ssl=false")
                .withConfig("mode", "incrementing")
                .withConfig("topics", "pageviews")
                .withConfig("name", "test")
                 // .withConfig("producer.override.blah.blah", "1000") // passes, config ignored
                // .withConfig("producer.override.linger.ms", "1000") // passes, config ignored
                // .withConfig("this.doesnt.exist.ms", "20000") // passes, config ignored
                // .withConfig("consumer.override.this.doesnt.exist.ms", "20000") // null pointer exception
                // .withConfig("consumer.override.max.poll.records", "1000") // passes
                // .withConfig("consumer.override.max.poll.interval.ms", "200000") // passes
                // .withConfig("consumer.override.group.id", "beep") // should pass but gets null pointer exception
                // .withConfig("consumer.override.isolation.level", "read_committed") // passes
                .build()
        );
...

I tested producer overrides also with the source connector and, likewise, producer.override.blah.blah leads to null pointer exception in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions