{"record":{"id":"d1a8fcaadd96a4b8","repo":"quarkusio/quarkus","slug":"failed-to-run","errorCode":null,"errorMessage":"Failed to run","messagePattern":"Failed to run","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java","lineNumber":391,"sourceCode":"            if (outputFile == null) {\n                getExecOperations().exec(action -> {\n                    action.commandLine(runner.getArguments()).workingDir(getWorkingDirectory().get());\n                    action.environment(getEnvVars());\n                    action.setStandardInput(System.in)\n                            .setErrorOutput(System.out)\n                            .setStandardOutput(System.out);\n                });\n            } else {\n                try (BufferedWriter is = Files.newBufferedWriter(Paths.get(outputFile))) {\n                    for (String i : runner.getArguments()) {\n                        is.write(i);\n                        is.newLine();\n                    }\n                }\n            }\n\n        } catch (Exception e) {\n            throw new GradleException(\"Failed to run\", e);\n        } finally {\n            analyticsService.close();\n        }\n    }\n\n    private boolean sourcesExist() {\n        final Set<FileSystemLocation> srcDirLocations = mainSourceSet.getAllJava().getSourceDirectories().getElements().get();\n        for (FileSystemLocation srcDirLocation : srcDirLocations) {\n            final File srcDir = srcDirLocation.getAsFile();\n            if (srcDir.exists() && srcDir.isDirectory()) {\n                final File[] files = srcDir.listFiles();\n                if (files != null && files.length > 0) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    }","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java#L373-L409","documentation":"The entire body of QuarkusDev.startDev — preparing arguments, writing config, and launching the dev-mode forked JVM via ExecOperations — is wrapped in a try/catch that rethrows any Exception as a GradleException('Failed to run', e). It is a generic wrapper; the real cause is the chained exception, which must be read from the full stack trace.","triggerScenarios":"Any exception while starting dev mode: failure to resolve/fork the dev-mode process, malformed configuration written for the application, IO errors on generated files, or a thrown error during analytics prompt handling.","commonSituations":"Invalid quarkus.* properties that dev mode cannot serialize; port conflicts or missing java toolchain when forking; corrupted application model; failure downloading the dev-mode artifacts listed just above this wrapper in the log.","solutions":["Read the 'Caused by' chain in the stack trace to find the real failure and fix that first","Run ./gradlew quarkusDev --stacktrace --info for the full cause and context","Verify JAVA_HOME/java toolchain availability and that no other process holds the dev-mode port","Delete build output (./gradlew clean) to clear stale generated files, then retry"],"exampleFix":"// diagnose, don't patch:\n./gradlew quarkusDev --stacktrace --info\n// then fix the underlying 'Caused by' (e.g. free port 8080:\n// lsof -i :8080 && kill <pid>)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// always inspect the cause chain, not the wrapper message\ntry {\n    ./gradlew quarkusDev --stacktrace --info\n} catch (...) { /* parse 'Caused by:' entries and fix the root cause */ }","preventionTips":["Always run with --stacktrace when dev mode fails","Validate quarkus.* configuration keys before launching","Ensure a free port and a valid JAVA_HOME","Clean stale build output after failed launches"],"tags":["gradle","dev-mode","generic-wrapper","process-launch"],"backgroundTag":"dev-mode-launch-failed","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"}