{"record":{"id":"5e49a52ea166ec46","repo":"quarkusio/quarkus","slug":"invalid-config-comment","errorCode":null,"errorMessage":"invalid config  ${comment}","messagePattern":"invalid config  (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/launcher/src/main/java/io/quarkus/launcher/JBangIntegration.java","lineNumber":57,"sourceCode":"                dataOutputStream.writeUTF(i.getKey());\n                dataOutputStream.writeUTF(i.getValue().toAbsolutePath().toString());\n            }\n            dataOutputStream.close();\n            files.put(\"jbang-dev.dat\", outputStream.toByteArray());\n            HashMap<String, Object> ret = new HashMap<>();\n            ret.put(\"files\", files);\n            ret.put(\"main-class\", \"io.quarkus.launcher.JBangDevModeLauncher\");\n            return ret;\n        }\n\n        Properties configurationProperties = new Properties();\n        for (String comment : comments) {\n            //we allow config to be provided via //Q:CONFIG name=value\n            if (comment.startsWith(CONFIG)) {\n                String conf = comment.substring(CONFIG.length()).trim();\n                int equals = conf.indexOf(\"=\");\n                if (equals == -1) {\n                    throw new RuntimeException(\"invalid config  \" + comment);\n                }\n                configurationProperties.setProperty(conf.substring(0, equals), conf.substring(equals + 1));\n            }\n        }\n\n        //huge hack\n        //jbang does not consider the pom when resolving dependencies\n        //so can get the wrong version of asm\n        //we remove it from the deps list so we can use the correct one\n        List<Map.Entry<String, Path>> dependencies = new ArrayList<>();\n        for (Map.Entry<String, Path> i : originalDeps) {\n            if (!i.getKey().startsWith(\"org.ow2.asm:asm:\")) {\n                dependencies.add(i);\n            }\n        }\n\n        ClassLoader old = Thread.currentThread().getContextClassLoader();\n        try {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/launcher/src/main/java/io/quarkus/launcher/JBangIntegration.java#L39-L75","documentation":"JBangIntegration.postBuild processes //Q:CONFIG name=value comments used to inject configuration properties during JBang-based builds. This error is thrown when a Q:CONFIG comment lacks an '=' separator, so it cannot be split into a key and value.","triggerScenarios":"A source file compiled via JBang contains a comment like //Q:CONFIG foo (no =value) or //Q:CONFIG  name=value with the marker matched but no '=' anywhere after CONFIG prefix; postBuild then throws while parsing comments.","commonSituations":"Typos in a Q:CONFIG directive in a .java file run via JBang; writing //Q:CONFIG to disable a property but forgetting the =-value syntax; copy-pasted comments with malformed format.","solutions":["Fix the comment to the form //Q:CONFIG name=value (must contain '=')","Remove the malformed Q:CONFIG comment if config is supplied another way (-Dquarkus.args or application.properties)","Verify no stray characters between CONFIG marker and the property name"],"exampleFix":"// before\n//Q:CONFIG quarkus.package.type\n// after\n//Q:CONFIG quarkus.package.type=uber-jar","handlingStrategy":"validation","validationCode":"for (String comment : comments) {\n    if (comment.startsWith(\"//Q:CONFIG\") && !comment.substring(comment.indexOf(\"Q:CONFIG\") + 8).trim().contains(\"=\")) {\n        throw new IllegalArgumentException(\"Malformed Q:CONFIG (missing =): \" + comment);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    jbangIntegration.postBuild(...);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"invalid config\")) {\n        log.error(\"Fix the //Q:CONFIG comment: \" + e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Always write Q:CONFIG directives as name=value","Lint source comments for Q:CONFIG format in CI","Avoid hand-editing Q:CONFIG lines; copy a known-good example"],"tags":["jbang","config","build","parsing"],"backgroundTag":"malformed-config-directive","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}