quarkusio/quarkus · error · QuarkusUpdateException
The %s command exited with an error. %s
Error message
The %s command exited with an error. %s
What it means
execute() launches the prepared Maven or Gradle rewrite process in the project directory, streaming its output to the log. If the process run throws (non-zero exit surfaced via ProcessBuilder.run, or an I/O error), it is wrapped in QuarkusUpdateException: "The %s command exited with an error. %s" with the command name and the captured log info (or the log file location).
Source
Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateCommand.java:272
} else {
pb.output().consumeLinesWith(8192, line -> {
LogLevel logLevel = LogLevel.of(line).orElse(LogLevel.UNKNOWN);
switch (logLevel) {
case ERROR -> log.error(logLevel.clean(line));
case WARNING -> log.warn(logLevel.clean(line));
case INFO -> log.info(logLevel.clean(line));
default -> log.info(line);
}
});
pb.error().consumeLinesWith(8192, log::error);
try {
pb.run();
} finally {
log.info("");
}
}
} catch (Exception e) {
throw new QuarkusUpdateException("The %s command exited with an error. %s".formatted(name, logInfo), e);
}
}
private static List<String> prepareCommand(List<String> command) {
final List<String> effectiveCommand = new ArrayList<>(command);
propagateSystemPropertyIfSet("maven.repo.local", effectiveCommand);
return effectiveCommand;
}
static String findMvnBinary(Path baseDir) {
Path mavenCmd = findWrapperOrBinary(baseDir, "mvnw", "mvn");
if (mavenCmd == null) {
throw new QuarkusUpdateException("Cannot locate mvnw or mvn"
+ ". Make sure mvnw is in the project directory or mvn is in your PATH.");
}
return mavenCmd.toString();
}
View on GitHub (pinned to e1c734241f)
Solutions
- Inspect the command output above the exception (or the --log-file produced by the update command) for the real build/recipe failure.
- Confirm the underlying build works standalone: `mvnw verify` or `gradlew build` before running the update.
- Check Maven/Gradle proxy and repository settings (settings.xml, gradle.properties) so OpenRewrite plugin and recipe artifacts can be downloaded.
- Re-run with --dry-run to preview changes and surface recipe errors without modifying sources.
- If a Windows-specific process error appears, run from a shell where mvnw.cmd/gradlew.bat resolves correctly, or update the Quarkus CLI.
Example fix
// before: rewrite run fails mid-build $ quarkus update QuarkusUpdateException: The OpenRewrite 5.x command exited with an error. // after: verify the build is healthy and use dry-run first $ ./mvnw -DskipTests compile $ quarkus update --dry-run $ quarkus update
Defensive patterns
Strategy: try-catch
Validate before calling
import java.nio.file.*;
// Verify the underlying build is healthy before running the rewrite commands
static void assertBuildHealthy(Path baseDir, boolean maven) throws IOException, InterruptedException {
Process p = maven
? new ProcessBuilder("./mvnw", "-q", "-DskipTests", "compile")
: new ProcessBuilder("./gradlew", "-q", "compileJava")
.directory(baseDir.toFile()).inheritIO().start();
if (p.waitFor() != 0) {
throw new IllegalStateException("Build must succeed before running the update");
}
} Try / catch
try {
QuarkusUpdateCommand.handle(log, buildTool, baseDir, rewritePluginVersion, recipesGAV, recipe, logFile, dryRun);
} catch (QuarkusUpdateException e) {
String msg = e.getMessage(); // "The <name> command exited with an error. <logInfo>"
log.error("Rewrite process failed: %s%nCause: %s", msg,
e.getCause() != null ? e.getCause().toString() : "see logs above");
} Prevention
- Run the equivalent Maven/Gradle build command successfully before attempting the update.
- Do a `--dry-run` update first to catch recipe/plugin resolution errors without mutating sources.
- Check proxy/repository configuration (settings.xml, gradle.properties) so OpenRewrite dependencies resolve.
- Run the command from the project root directory, not a subdirectory, so wrapper and relative paths resolve.
When it happens
Trigger: QuarkusUpdateCommand.handle() -> runMavenUpdate/runGradleUpdate -> executeRewrite -> execute(), when the spawned `mvnw ... rewrite:run|dryRun` or `gradlew ... rewriteRun|rewriteDryRun` process exits non-zero: build compilation errors, unresolvable OpenRewrite plugin/recipe dependencies, incompatible Maven/Gradle versions, or process I/O failures.
Common situations: Corporate proxy/firewall blocking downloads of org.openrewrite artifacts; project in a broken state before migration (does not compile); running the update on a Windows machine where the wrapper script resolution or process invocation fails; JVM crashes of the spawned build.
Related errors
- Error while running Gradle rewrite command, see the executio
- Failed to apply recommended updates
- Could not resolve POM for
- You are trying to create a Maven project in a directory that
- You are trying to create gradle Project in a directory that
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/136aa839d649f1b3.
Report an issue: GitHub.