{"record":{"id":"807a499b985dd0fb","repo":"quarkusio/quarkus","slug":"failed-to-apply-recommended-updates","errorCode":null,"errorMessage":"Failed to apply recommended updates","messagePattern":"Failed to apply recommended updates","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusUpdate.java","lineNumber":195,"sourceCode":"        if (rewritePluginVersion != null) {\n            invoker.rewritePluginVersion(rewritePluginVersion);\n        }\n        invoker.targetPlatformVersion(targetPlatformVersion);\n        invoker.rewriteDryRun(rewriteDryRun);\n\n        // backward compat\n        if (noRewrite != null && noRewrite) {\n            rewrite = false;\n        }\n\n        if (rewrite != null) {\n            invoker.rewrite(rewrite);\n        }\n        invoker.appModel(extension().getApplicationModel());\n        try {\n            invoker.execute();\n        } catch (Exception e) {\n            throw new GradleException(\"Failed to apply recommended updates\", e);\n        }\n    }\n\n    private static ArtifactCoords getPrimaryBom(ExtensionCatalog c) {\n        return c.getDerivedFrom().isEmpty() ? c.getBom() : c.getDerivedFrom().get(0).getBom();\n    }\n}\n","sourceCodeStart":177,"sourceCodeEnd":203,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusUpdate.java#L177-L203","documentation":"The quarkusUpdate task, after computing update recommendations, runs the OpenRewrite-based UpdateProject invoker to rewrite the project's build files. This GradleException wraps any exception thrown by invoker.execute(), meaning the automated update could not be applied to the project (recipe failure, rewrite engine error, or file modification failure).","triggerScenarios":"Running ./gradlew quarkusUpdate when the OpenRewrite recipes fail: unparseable build.gradle/Gradle Kotlin DSL, custom build logic the recipes cannot transform, file locks on build scripts, or an exception inside invoker.execute().","commonSituations":"Projects with heavily customized Gradle build scripts that the rewrite recipes cannot parse or modify; build.gradle.kts syntax the Groovy/Kotlin parser rejects; version-control or OS locks on build files; plugin version incompatibilities with the target platform.","solutions":["Run with --stacktrace to see the root cause from the rewrite engine.","Update build files manually per the printed recommended versions, then re-run to confirm no changes remain.","Ensure build.gradle is parseable and committed state is clean (rewrite may refuse/produce conflicts on dirty trees).","Pin/update io.quarkus and plugin versions manually in gradle.properties / build script instead of relying on automatic rewrite."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"git status --porcelain  # ensure clean tree before automated rewrite\n# verify build files parse:\n./gradlew help -q","typeGuard":null,"tryCatchPattern":"try {\n    ./gradlew quarkusUpdate\n} catch (GradleException e) {\n    if (e.getMessage().equals(\"Failed to apply recommended updates\")) {\n        e.getCause().printStackTrace(); // OpenRewrite root cause\n        // apply version bumps manually instead\n    }\n}","preventionTips":["Commit or stash local changes before running quarkusUpdate so rewrites apply cleanly","Keep build scripts parseable and avoid syntax exotic to OpenRewrite parsers","Run with --stacktrace to capture recipe failures","Review the diff quarkusUpdate produces before committing"],"tags":["gradle","openrewrite","update","build-script"],"backgroundTag":"automated-update-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}