You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Randall Hauch (Jira)" <ji...@apache.org> on 2020/05/15 19:04:00 UTC

[jira] [Resolved] (KAFKA-9537) Abstract transformations in configurations cause unfriendly error message.

     [ https://issues.apache.org/jira/browse/KAFKA-9537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Randall Hauch resolved KAFKA-9537.
----------------------------------
    Fix Version/s: 2.5.1
                   2.4.2
                   2.6.0
         Reviewer: Randall Hauch
       Resolution: Fixed

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).

> Abstract transformations in configurations cause unfriendly error message.
> --------------------------------------------------------------------------
>
>                 Key: KAFKA-9537
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9537
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 2.4.0
>            Reporter: Jeremy Custenborder
>            Assignee: Jeremy Custenborder
>            Priority: Minor
>             Fix For: 2.6.0, 2.4.2, 2.5.1
>
>
> I was working with a coworker who had a bash script posting a config to connect with
> {code:java}org.apache.kafka.connect.transforms.ExtractField.$Key{code} in the script. Bash removed the $Key because it wasn't escaped properly.
> {code:java}
> org.apache.kafka.connect.transforms.ExtractField.{code}
> 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. 
> {code}
> {
>   "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`"
> }
> {code}
> It would be a much better user experience if we returned something like 
> {code}
> {
>   "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`"
> }
> {code}
> or
> {code}
> {
>   "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`"
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)