Skip to content

fix(connect): handle null value sections in connector config validation#2484

Open
isliao613 wants to merge 2 commits into
redpanda-data:masterfrom
isliao613:fix/connector-null-value-config-crash
Open

fix(connect): handle null value sections in connector config validation#2484
isliao613 wants to merge 2 commits into
redpanda-data:masterfrom
isliao613:fix/connector-null-value-config-crash

Conversation

@isliao613
Copy link
Copy Markdown

Kafka Connect may return null for the value section of a connector property when the property is deprecated or inapplicable (e.g. database.out.server.name in Debezium Oracle 3.5.x using LogMiner).

  • Filter null-value entries in createCustomProperties before mapping; use a type predicate so ConnectorPropertyWithValue narrows correctly downstream (fixes initConfig crash: "Cannot read properties of null (reading 'length')")
  • Make ConnectorProperty.value, recommended_values and errors nullable in the type to match actual API behaviour
  • Guard recommended_values and errors with ?? [] in validate() and property-component (fixes validate crash: "Cannot read properties of null (reading 'isEqual')")

isliao613 added 2 commits June 4, 2026 10:19
Kafka Connect may return null for the value section of a connector
property when the property is deprecated or inapplicable (e.g.
database.out.server.name in Debezium Oracle 3.5.x using LogMiner).

- Filter null-value entries in createCustomProperties before mapping;
  use a type predicate so ConnectorPropertyWithValue narrows correctly
  downstream (fixes initConfig crash: "Cannot read properties of null
  (reading 'length')")
- Make ConnectorProperty.value, recommended_values and errors nullable
  in the type to match actual API behaviour
- Guard recommended_values and errors with ?? [] in validate() and
  property-component (fixes validate crash: "Cannot read properties of
  null (reading 'isEqual')")
Three cases:
- initConfig excludes properties whose value section is null
- validate() does not crash on null value sections
- validate() does not crash on null recommended_values/errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant