Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9537

Abstract transformations in configurations cause unfriendly error message.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.6.0, 2.4.2, 2.5.1
    • Component/s: KafkaConnect
    • Labels:
      None

      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

            Activity

              People

              • Assignee:
                jcustenborder Jeremy Custenborder
                Reporter:
                jcustenborder Jeremy Custenborder
                Reviewer:
                Randall Hauch
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: