[ 
https://issues.apache.org/jira/browse/KAFKA-9537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17034713#comment-17034713
 ] 

ASF GitHub Bot commented on KAFKA-9537:
---------------------------------------

jcustenborder commented on pull request #8090: KAFKA-9537 - Cleanup error 
messages for abstract transformations
URL: https://github.com/apache/kafka/pull/8090
 
 
   Added check if the transformation is abstract. If so throw an error message 
with guidance for the user. 
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to