{"record":{"id":"9cf7b327d53b0bbf","repo":"quarkusio/quarkus","slug":"failed-to-remove-extensions","errorCode":null,"errorMessage":"Failed to remove extensions","messagePattern":"Failed to remove extensions","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/RemoveExtensionsCommandHandler.java","lineNumber":51,"sourceCode":"        }\n\n        final List<ArtifactCoords> extensionsToRemove = computeCoordsFromQuery(invocation, extensionsQuery);\n        if (extensionsToRemove == null) {\n            return QuarkusCommandOutcome.failure(\"no extensions to remove\").setValue(RemoveExtensions.OUTCOME_UPDATED, false);\n        }\n        final ExtensionManager extensionManager = invocation.getValue(EXTENSION_MANAGER,\n                invocation.getQuarkusProject().getExtensionManager());\n        try {\n            final Set<ArtifactKey> keys = extensionsToRemove.stream().map(ArtifactCoords::getKey)\n                    .collect(Collectors.toSet());\n            final UninstallResult result = extensionManager.uninstall(keys);\n            result.getUninstalled()\n                    .forEach(a -> invocation.log()\n                            .info(MessageIcons.SUCCESS_ICON + \" Extension \" + a.getGroupId() + \":\" + a.getArtifactId()\n                                    + \" has been uninstalled\"));\n            return QuarkusCommandOutcome.success().setValue(RemoveExtensions.OUTCOME_UPDATED, result.isSourceUpdated());\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Failed to remove extensions\", e);\n        }\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":55,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/RemoveExtensionsCommandHandler.java#L33-L55","documentation":"RemoveExtensionsCommandHandler.execute delegates to the extension manager to uninstall selected extensions and update the build file. Any IOException during that process (writing pom.xml/build.gradle, resolving catalogs, persisting changes) is wrapped in a QuarkusCommandException with the message 'Failed to remove extensions'.","triggerScenarios":"Running quarkus:remove-extensions when the underlying ExtensionManagerExt.removeExtensions(...) throws IOException — unwritable build file, catalog resolution failure, or serialization error.","commonSituations":"Read-only project files or locked pom.xml (IDE/OS holding the file); running without write permission in CI containers; network failure resolving the registry mid-operation.","solutions":["Ensure the build file and project directory are writable (check permissions, close IDE file locks).","Re-run with a working registry connection; check network/proxy settings.","Manually remove the <dependency> from pom.xml if the tool cannot write it.","Run the command with sufficient privileges in CI (not as read-only mount)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Ensure build file is writable before removal\nPath buildFile = projectDir.resolve(\"pom.xml\");\nif (!Files.isWritable(buildFile)) throw new IllegalStateException(\"Build file not writable: \" + buildFile);","typeGuard":null,"tryCatchPattern":"try {\n    removeHandler.execute(invocation);\n} catch (QuarkusCommandException e) {\n    if (\"Failed to remove extensions\".equals(e.getMessage()) && e.getCause() instanceof IOException) {\n        // log cause; fall back to manual pom.xml edit\n    } else throw e;\n}","preventionTips":["Close IDEs/editors holding locks on pom.xml","Run with write permissions in CI containers","Check disk space and registry connectivity before batch removals"],"tags":["io","quarkus-cli","extension-management"],"backgroundTag":"extension-remove-io-failure","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"}