quarkusio/quarkus · error · QuarkusCommandException

Error while generating the project update script

Error message

Error while generating the project update script

What it means

UpdateProjectCommandHandler.execute generates the recommended-update report/script for a project (recommended versions, recipe application). When writing that output — logging script content, writing the update script file — throws an IOException, it is wrapped in a QuarkusCommandException with 'Error while generating the project update script'.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/UpdateProjectCommandHandler.java:187

                            quarkusProject.getProjectDirPath(),
                            rewritePluginVersion,
                            fetchResult.getRecipesGAV(),
                            recipe,
                            logFile,
                            rewriteDryRun);
                    final Path patchFile = rewriteDir.resolve("rewrite.patch");
                    if (rewriteDryRun && Files.isRegularFile(patchFile)) {
                        quarkusProject.log().info("Patch file available:");
                        quarkusProject.log().info(MessageFormatter.underline(projectDir.relativize(patchFile).toString()));
                        quarkusProject.log().info("");
                    }

                } else {
                    printSeparator(quarkusProject.log());
                }

            } catch (IOException e) {
                throw new QuarkusCommandException("Error while generating the project update script", e);
            }
        }

        return QuarkusCommandOutcome.success();
    }

    private static String askUserConfirmationForUpdate(MessageWriter log) {
        System.out.print(System.lineSeparator() +
                MessageFormatter.bold(
                        "Do you want to apply the generated update recipes with OpenRewrite?")
                + " ([" + MessageFormatter.green("y") + "]es, [" + MessageFormatter.red("n") + "]o, ["
                + MessageFormatter.blue("d") + "]ry-run + [Enter])"
                + System.lineSeparator() + System.lineSeparator());
        try (Scanner scanner = new Scanner(new FilterInputStream(System.in) {
            @Override
            public void close() throws IOException {
                //don't close System.in!
            }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the output location (usually target/) is writable and has free disk space.
  2. Re-run the command; transient I/O failures often clear on retry.
  3. Apply the recommended updates manually based on the logged report instead of the generated script.
  4. Check antivirus/OS file locks on the output directory.
Defensive patterns

Strategy: try-catch

Validate before calling

// Check output directory writability before update
Path target = projectDir.resolve("target");
Files.createDirectories(target);
if (!Files.isWritable(target)) throw new IllegalStateException("target/ not writable");

Try / catch

try {
    updateHandler.execute(invocation);
} catch (QuarkusCommandException e) {
    if ("Error while generating the project update script".equals(e.getMessage()) && e.getCause() instanceof IOException) {
        // free disk/fix permissions and retry, or apply updates manually
    } else throw e;
}

Prevention

When it happens

Trigger: Running quarkus:update or the update-mojo where, after the recipe/version comparison succeeds, an IOException occurs while emitting the update script/report (e.g. writing to target dir or streaming to log).

Common situations: Read-only target/ directory; disk full; CI sandbox blocking file writes; the update script output path unwritable.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/1edff4b9fd5c3a2e. Report an issue: GitHub.