You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jeremy Custenborder (Jira)" <ji...@apache.org> on 2020/02/11 18:08:00 UTC
[jira] [Created] (KAFKA-9537) Abstract transformations in
configurations cause unfriendly error message.
Jeremy Custenborder created KAFKA-9537:
------------------------------------------
Summary: 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
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)