{"record":{"id":"17b476853d532bb0","repo":"quarkusio/quarkus","slug":"should-never-reach-this","errorCode":null,"errorMessage":"Should never reach this!","messagePattern":"Should never reach this!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java","lineNumber":148,"sourceCode":"                        cmd = cmds.get(target);\n                        if (cmd == null) {\n                            exists.set(false);\n                            return;\n                        }\n                    } else if (cmds.size() == 1) { // defaults to pure java run\n                        cmd = cmds.values().iterator().next();\n                    } else if (cmds.size() == 2) { // choose not default\n                        for (Map.Entry<String, List> entry : cmds.entrySet()) {\n                            if (entry.getKey().equals(\"java\"))\n                                continue;\n                            cmd = entry.getValue();\n                            break;\n                        }\n                    } else if (cmds.size() > 2) {\n                        tooMany.set(cmds.keySet().stream().collect(Collectors.joining(\" \")));\n                        return;\n                    } else {\n                        throw new RuntimeException(\"Should never reach this!\");\n                    }\n                    List<String> args = (List<String>) cmd.get(0);\n                    if (getJvmArguments().isPresent() && !getJvmArguments().get().isEmpty()) {\n                        args.addAll(1, getJvmArgs());\n                    }\n\n                    getLogger().info(\"Executing \\\"\" + String.join(\" \", args) + \"\\\"\");\n                    Path wd = (Path) cmd.get(1);\n                    File wdir = wd != null ? wd.toFile() : workingDirectory.get();\n\n                    // this was all very touchy to get the process outputing to console and exiting cleanly\n                    // change at your own risk\n\n                    // We cannot use getProject().exec() as contrl-c is not processed correctly\n                    // and the spawned process will not shutdown\n                    //\n                    // This also requires running with --no-daemon as control-c doesn't seem to trigger the shutdown hook\n                    // this poor gradle behavior is a long known issue with gradle","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusRun.java#L130-L166","documentation":"During quarkus:run, QuarkusRun.accept matches runnable commands contributed by installed extensions. If none matched (cmds.size()==0) and fewer than 3 commands exist in an unexpected state, it throws RuntimeException(\"Should never reach this!\") — a defensive assertion for an internal invariant that normally cannot occur.","triggerScenarios":"The command-matching loop completes with no matching command and cmds is empty or size 1 — effectively only when extension-provided run commands are missing or an unexpected internal state occurs; also reachable as a guard alongside the 'too many commands' path.","commonSituations":"Bugs/edge cases in extension-contributed run commands; unusual combinations of installed extensions providing quarkus:run commands; typically a library bug rather than user error.","solutions":["Set -Dquarkus.run.target=<target> explicitly to bypass command auto-detection.","Check installed extensions supporting quarkus:run (the 'too many' message lists them) and remove conflicting ones.","If reproducible, report a Quarkus bug with the extension list and build.gradle — this indicates an unexpected internal state."],"exampleFix":"// before\n./gradlew quarkusRun\n\n// after (explicit target avoids detection logic)\n./gradlew quarkusRun -Dquarkus.run.target=io.quarkus.example.Main","handlingStrategy":"fallback","validationCode":"// always specify the run target to avoid auto-detection edge cases\n./gradlew quarkusRun -Dquarkus.run.target=com.example.Main","typeGuard":null,"tryCatchPattern":"try { runQuarkus() } catch (RuntimeException e) { if (e.message == 'Should never reach this!') { /* rerun with -Dquarkus.run.target=... ; otherwise report bug */ } }","preventionTips":["Set -Dquarkus.run.target explicitly when multiple extensions contribute run commands.","Avoid exotic combinations of extensions that both provide quarkus:run commands.","Reproduce and report internal-invariant errors upstream with the extension list."],"tags":["gradle","run","internal-invariant","extensions"],"backgroundTag":"internal-invariant-violation","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"}