{"record":{"id":"351e5f13f7d15a6a","repo":"karatelabs/karate","slug":"unexpected-configure-key-key","errorCode":null,"errorMessage":"unexpected 'configure' key: '${key}'","messagePattern":"unexpected 'configure' key: '(.+?)'","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"karate-core/src/main/java/io/karatelabs/core/KarateConfig.java","lineNumber":458,"sourceCode":"            case \"printEnabled\" -> {\n                logger.warn(\"configure 'printEnabled' is deprecated; print/karate.log go to the 'karate.scenario' \"\n                        + \"SLF4J category - set its level to WARN in logback.xml to keep them off the console, \"\n                        + \"or 'configure logging = {{ console: \\\"warn\\\" }}' to quiet all karate console output\");\n            }\n            case \"lowerCaseResponseHeaders\" -> {\n                logger.warn(\"configure 'lowerCaseResponseHeaders' is deprecated; \"\n                        + \"'match header X' is already case-insensitive and 'karate.lowerCase(responseHeaders)' \"\n                        + \"covers direct map access\");\n            }\n            case \"logModifier\" -> {\n                logger.warn(\"configure 'logModifier' is removed; \"\n                        + \"use the declarative form: 'configure logging = {{ mask: {{ headers: [...], jsonPaths: [...], patterns: [...] }} }}'\");\n            }\n\n            // No channel-type cases: channels (grpc, kafka, …) are configured via their rich\n            // JS object — karate.channel('kafka') / the boot.ext('kafka') object — not via global\n            // 'configure <type>'. 'configure' stays strict so key typos fail loudly.\n            default -> throw new RuntimeException(\"unexpected 'configure' key: '\" + key + \"'\");\n        }\n    }\n\n    private void configureSsl(Object value) {\n        if (value == null) {\n            this.ssl.clear();\n            return;\n        }\n        if (value instanceof Boolean b) {\n            this.ssl.clear();\n            this.ssl.put(\"enabled\", b);\n            this.ssl.put(\"trustAll\", true);\n            return;\n        }\n        if (value instanceof String s) {\n            this.ssl.clear();\n            this.ssl.put(\"enabled\", true);\n            this.ssl.put(\"algorithm\", s);","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/KarateConfig.java#L440-L476","documentation":"Karate's 'configure' is strict: only a known set of keys is accepted, and any unrecognized key hits the switch's default branch which throws listing the bad key. This is intentional so that config key typos fail loudly instead of being silently ignored.","triggerScenarios":"Calling configure with a misspelled or unsupported key, e.g. \"configure foo = true\", or using a channel-style key like \"configure kafka = ...\" which is explicitly not allowed — channels are configured via karate.channel()/boot.ext() rich JS objects instead.","commonSituations":"Migrating from older Karate versions where more configure keys existed; typos like 'loggging' or 'loggin'; attempting 'configure grpc = ...' or 'configure kafka = ...' when the new API requires karate.channel('kafka'); copying config from outdated docs.","solutions":["Check the key spelling against the supported configure keys in the current docs","Replace 'configure <channel> = ...' with karate.channel('<channel>') or boot.ext('<channel>') configuration","For logging-related settings use 'configure logging = { ... }' instead of legacy keys like 'report' or 'logLevel'","Consult docs/MIGRATION_GUIDE.md if the key worked in an older Karate version"],"exampleFix":"// before\n* configure kafka = { servers: 'localhost:9092' }\n// after\n* def channel = karate.channel('kafka', { servers: 'localhost:9092' })","handlingStrategy":"validation","validationCode":"// check key against the supported set before configuring\nvar allowed = ['ssl','logging','report','driver','retry', /* ...supported keys */];\nif (allowed.indexOf(key) === -1) { throw 'unsupported configure key: ' + key; }","typeGuard":"null","tryCatchPattern":"try { karate.configure(key, value); } catch (RuntimeException e) { if (e.getMessage().contains(\"unexpected 'configure' key\")) { log.error('Check supported configure keys / migration guide'); } throw e; }","preventionTips":["Copy configure keys only from current-version docs","Run one smoke feature in CI to catch config typos early","Use karate.channel()/boot.ext() for channel configuration instead of configure"],"tags":["configuration","strict-validation","typo","karate-configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}