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

Preflight validations of connectors leads to 500 responses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.7.0
    • connect
    • None

    Description

      The Connect framework performs some preflight validations for all connectors that are created in addition to allowing connectors to define their own custom validation logic by providing a ConfigDef object in Connector::config and performing multi-property validation in Connector::validate.

      When performed correctly, this validation information is surfaced to the user in the form of a ConfigInfos object containing a list of config objects whose values contain one or more error messages. This can be used as the response for a REST request to PUT /connector-plugins/{connectorType}/config/validate and allows programmatic UIs to render error messages for every invalid property to the user.

      However, some validations performed by the Connect framework do not follow this pattern and instead result in a 500 response being returned to the user. For example, logic specific to sink connectors (see AbstractHerder and SinkConnectorConfig) simply throws an exception instead of documenting the error with the offending property and returning it in a standard response.

       

      We should correct this logic wherever possible so that configurations that are not fatally invalid (i.e., may have invalid properties but can still be translated into a meaningful ConfigInfos response object) do not cause a 500 response to be returned to the user.

      Attachments

        Activity

          People

            ChrisEgerton Chris Egerton
            ChrisEgerton Chris Egerton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: