Description
I was working with a coworker who had a bash script posting a config to connect with
org.apache.kafka.connect.transforms.ExtractField.$Key
in the script. Bash removed the $Key because it wasn't escaped properly.
org.apache.kafka.connect.transforms.ExtractField.
is made it to the rest interface. A Class<?> was create for the abstract implementation of ExtractField and passed to getConfigDefFromTransformation. It tried to call newInstance which threw an exception. The following gets returned via the rest interface.
{ "error_code": 400, "message": "Connector configuration is invalid and contains the following 1 error(s):\nInvalid value class org.apache.kafka.connect.transforms.ExtractField for configuration transforms.extractString.type: Error getting config definition from Transformation: null\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`" }
It would be a much better user experience if we returned something like
{ "error_code": 400, "message": "Connector configuration is invalid and contains the following 1 error(s):\nInvalid value class org.apache.kafka.connect.transforms.ExtractField for configuration transforms.extractString.type: Error getting config definition from Transformation: Transformation is abstract and cannot be created.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`" }
or
{ "error_code": 400, "message": "Connector configuration is invalid and contains the following 1 error(s):\nInvalid value class org.apache.kafka.connect.transforms.ExtractField for configuration transforms.extractString.type: Error getting config definition from Transformation: Transformation is abstract and cannot be created. Did you mean ExtractField$Key, ExtractField$Value?\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`" }
Attachments
Issue Links
- links to
Merged to `trunk` for inclusion in 2.6.0, and cherry-picked to `2.5` (for future 2.5.1 release) and `2.4` (for future 2.4.2 release).