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

External secrets via ConfigProvider does not work in mongodb source connector

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 1.10.0
    • Component/s: Configuration
    • None

      Environment

      On-Prem

      • Confluent Kafka 7.3.2 (Community)
      • Confluent Connect 7.3.2 (Community)

      Problem:

      I am trying to encrypt "connection.uri" configuration of mongodb source connector through Vault ConfigProvider.

       

      My configuration is here

      {
              "config.providers.vault.param.vault.namespace": "jaeshim"
              "connector.class": "com.mongodb.kafka.connect.MongoSourceConnector",
              "publish.full.document.only": "true",
              "output.format.value": "json",
              "config.providers": "vault",
              "output.format.key": "json",
              "config.providers.vault.param.vault.login.by": "Token",
              "config.providers.vault.class": "com.github.jcustenborder.kafka.config.vault.VaultConfigProvider",
              "topic.prefix": "jaeshim_prefix",
              "database": "jaeshim",
              "config.providers.vault.param.vault.token": "jaeshim_token",
              "topic.separator": "_",
              "config.providers.vault.param.vault.address": "https://vault-url:8200",
              "connection.uri": "${vault:kconnect-kv/jaeshim/mongodb:connection-uri}"
              "name": "MongoSourceConnector_Jaeshim",        
              "value.converter": "org.apache.kafka.connect.storage.StringConverter",
              "key.converter": "org.apache.kafka.connect.storage.StringConverter"
       } 

      but I got the error

      {    "error_code": 400,    "message": "Connector configuration is invalid and contains the following 1 error(s):\nInvalid value ${vault:kconnect-kv/jaeshim/mongodb:connection-uri}, for configuration connection.uri: The connection string is invalid. Connection strings must start with either 'mongodb://' or 'mongodb+srv://\nYou can also find the above list of errors at the endpoint `/connector-plugins/{connectorType}/config/validate`"} 

      and I found similar issue. We have same problem. 

      https://jira.mongodb.org/browse/KAFKA-322 

      https://github.com/mongodb/mongo-kafka/commit/121aa9d55a1b597a19250eaed9248f9b610a8da4 

       

      According to the report, It is known issue and fixed at version 1.10.

      We are using version 1.10 but we still get the same error. 

       

      Could this issue be checked?

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            sjm7267@gmail.com 재민 심
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: