Hey Guys! Is it possible to set a password from an...
# troubleshooting
m
Hey Guys! Is it possible to set a password from an environment variable on Druid lookups? I was trying something like this
Copy code
{
  "type": "cachedNamespace",
  "extractionNamespace": {
    "type": "jdbc",
    "pollPeriod": "PT1H",
    "connectorConfig": {
      "connectURI": "jdbc:mysql://database:3306/table",
      "user": {
        "type": "environment",
        "variable": "MYSQL_USERNAME"
      },
      "password": {
        "type": "environment",
        "variable": "MYSQL_PASSWORD"
      }
    },
    "table": "Test",
    "keyColumn": "id",
    "valueColumn": "name"
  }
}
But this gives me:
Copy code
org.apache.druid.query.lookup.LookupUtils - Lookup [mk_test] could not be serialized properly. Please check its configuration. Error: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
2025-08-18 14:52:55.818
 at [Source: (byte[])":)
This could mean that the configuration is incorrect. If I set the values directly, the lookup works as expected. Will be grateful for any advice on this.
Config like this:
Copy code
{
  "type": "cachedNamespace",
  "extractionNamespace": {
    "type": "jdbc",
    "pollPeriod": "PT1H",
    "connectorConfig": {
      "connectURI": "jdbc:mysql://database:3306/table",
      "user": "${MYSQL_USERNAME}",
      "password": "${MYSQL_PASSWORD}"
    },
    "table": "Test",
    "keyColumn": "id",
    "valueColumn": "name"
  }
}
Returns:
UnableToObtainConnectionException: java.sql.SQLException: Access denied for user '${MYSQL_USERNAME}...'
k
m
Thank you for your response Kyle. Could you guide me on where to put this setting?
Please note that this is lookup configuration, not kafka ingestion.
For future use, this is the correct setting:
Copy code
{
  "type": "cachedNamespace",
  "extractionNamespace": {
    "type": "jdbc",
    "pollPeriod": "PT1H",
    "connectorConfig": {
      "connectURI": "jdbc:mysql://database:3306/table",
      "user": "username",
      "password": {
        "type": "environment",
        "variable": "MYSQL_PASSWORD"
      }
    },
    "table": "Test",
    "keyColumn": "id",
    "valueColumn": "name"
  }
}
🎉 1