Repository navigation
fix(core): configuration errors log the failing keys, never the values - #465
Merged
Merged
Conversation
ElasticConfig.apply and ElasticSqlConfig.apply logged the whole configs ConfigError, and a Typesafe "bad value" message quotes the value it could not read (`No number in duration value '<value>'`), so a secret set under the wrong key reached the log. Both now log each failing key and the kind of failure through one helper (sql ConfigErrorKeys); the exception thrown to the caller is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fupelaqu
marked this pull request as ready for review
November 15, 2026 16:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the client or SQL configuration cannot be read,
ElasticConfig.applyandElasticSqlConfig.applylogged the whole error. Typesafe's "bad value" messages quote the value they could not read. For example, a password pasted intoelastic.connection-timeoutwas logged asNo number in duration value '<the password>'. Both now log only the keys that failed and the kind of each failure:What changes
ConfigErrorKeys(sql module,private[elastic]) builds that line from each entry's key path and the throwable's class name, never from a message. It is insqlbecausecoredepends onsql, so both configurations share one implementation.ElasticConfig.apply(core, Scala 2.12 and 2.13) andElasticSqlConfig.apply(sql, Scala 2.12 and 2.13) log through it.elastic.schema-cache.ttl must be positive. Only the log line changes.Verification
ElasticConfigErrorLogSpec(new): it sets an all-letters sentinel value in a duration key. It first checks the premise, that the error text quotes the value. Then it captures the real log line and checks that it names the key and not the value. The old log line printed each entry's message, which quotes the value, so it would fail this test (checked by reading, not run).core/testOnly *ElasticConfigErrorLogSpec *SchemaCacheTtlApiSpec *ScrollSettingsSpec *ClientKeySpec: 40 / 0.SchemaCacheTtlApiSpecstill sees its… must be positivemessage, so the exception text is unchanged.sbt "+ core/compile"(2.12.20 and 2.13.16; it compilessqltoo): green.headerCheck scalafmtSbtCheck scalafmtCheck test:scalafmtCheck: green.configsversions (0.4.4 and 0.6.1). It confirmed that the key path is always present at these call sites, and that no other code depends on the old log wording.CI run of this PR (head
480366a6, run 43695653050): lint pass (1 min 42 s),sbt compile testpass (41 min), CodeQL pass.Release note
Recorded, not fixed
🤖 Generated with Claude Code