{"record":{"id":"198e0fbc189d2568","repo":"quarkusio/quarkus","slug":"invalid-config-line","errorCode":null,"errorMessage":"invalid config  ${line}","messagePattern":"invalid config  (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java","lineNumber":190,"sourceCode":"            byte[] buf = new byte[10];\n            int r;\n            while ((r = in.read(buf)) > 0) {\n                out.write(buf, 0, r);\n            }\n            return new String(out.toByteArray(), StandardCharsets.UTF_8);\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    private static Properties getConfigurationProperties(final Path source) throws IOException {\n        Properties properties = new Properties();\n        for (String line : Files.readAllLines(source)) {\n            if (line.startsWith(\"//Q:CONFIG\")) {\n                String conf = line.substring(10).trim();\n                int equals = conf.indexOf(\"=\");\n                if (equals == -1) {\n                    throw new RuntimeException(\"invalid config  \" + line);\n                }\n                properties.setProperty(conf.substring(0, equals), conf.substring(equals + 1));\n            }\n        }\n        return properties;\n    }\n}\n","sourceCodeStart":172,"sourceCodeEnd":198,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangDevModeLauncherImpl.java#L172-L198","documentation":"When JBang dev mode launches, getConfigurationProperties() reads application properties embedded in a Java source file. Lines starting with the marker //Q:CONFIG must be of the form 'key=value'; if no '=' is found after the marker, the launcher treats the line as invalid configuration and throws. This guards against typos in inline JBang configuration directives.","triggerScenarios":"A line in a JBang script starts with //Q:CONFIG but contains no '=' character, e.g. '//Q:CONFIG quarkus.datasource.db-kind' without the value part. Thrown from getConfigurationProperties, called by configurationProperties during JBang dev mode startup.","commonSituations":"Hand-editing //Q:CONFIG lines in a JBang single-file Quarkus app and deleting the value or the equals sign; copy/paste dropping the '=...' portion; writing a comment-like directive that accidentally starts with //Q:CONFIG but is not real config.","solutions":["Open the JBang script and find the offending line (it is included in the message) and add the missing '=' and value, e.g. //Q:CONFIG quarkus.package.type=uber-jar","If the line was meant as a comment, remove or change the //Q:CONFIG prefix so it is not parsed as config","Run the app via a regular application.properties instead of inline //Q:CONFIG directives to avoid parser fragility"],"exampleFix":"// before\n//Q:CONFIG quarkus.package.type\n// after\n//Q:CONFIG quarkus.package.type=uber-jar","handlingStrategy":"validation","validationCode":"List<String> lines = Files.readAllLines(source);\nfor (String line : lines) {\n    if (line.startsWith(\"//Q:CONFIG\")) {\n        String conf = line.substring(10).trim();\n        if (!conf.contains(\"=\")) {\n            throw new IllegalStateException(\"Malformed JBang config line (missing '='): \" + line);\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    Properties props = launcher.configurationProperties();\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"invalid config\")) {\n        // surface the offending line to the user, then abort or fall back to application.properties\n    }\n}","preventionTips":["Always write //Q:CONFIG directives as key=value with both parts present","Never use //Q:CONFIG as a comment prefix for anything that is not real config","After editing a JBang script, run a quick grep '//Q:CONFIG' and check each line contains '='"],"tags":["jbang","config","dev-mode"],"backgroundTag":"malformed-config-line","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"}