quarkusio/quarkus · error · QuarkusCommandException
Failed to remove extensions
Error message
Failed to remove extensions
What it means
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'.
Source
Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/RemoveExtensionsCommandHandler.java:51
}
final List<ArtifactCoords> extensionsToRemove = computeCoordsFromQuery(invocation, extensionsQuery);
if (extensionsToRemove == null) {
return QuarkusCommandOutcome.failure("no extensions to remove").setValue(RemoveExtensions.OUTCOME_UPDATED, false);
}
final ExtensionManager extensionManager = invocation.getValue(EXTENSION_MANAGER,
invocation.getQuarkusProject().getExtensionManager());
try {
final Set<ArtifactKey> keys = extensionsToRemove.stream().map(ArtifactCoords::getKey)
.collect(Collectors.toSet());
final UninstallResult result = extensionManager.uninstall(keys);
result.getUninstalled()
.forEach(a -> invocation.log()
.info(MessageIcons.SUCCESS_ICON + " Extension " + a.getGroupId() + ":" + a.getArtifactId()
+ " has been uninstalled"));
return QuarkusCommandOutcome.success().setValue(RemoveExtensions.OUTCOME_UPDATED, result.isSourceUpdated());
} catch (IOException e) {
throw new QuarkusCommandException("Failed to remove extensions", e);
}
}
}
View on GitHub (pinned to e1c734241f)
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).
Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure build file is writable before removal
Path buildFile = projectDir.resolve("pom.xml");
if (!Files.isWritable(buildFile)) throw new IllegalStateException("Build file not writable: " + buildFile); Try / catch
try {
removeHandler.execute(invocation);
} catch (QuarkusCommandException e) {
if ("Failed to remove extensions".equals(e.getMessage()) && e.getCause() instanceof IOException) {
// log cause; fall back to manual pom.xml edit
} else throw e;
} Prevention
- Close IDEs/editors holding locks on pom.xml
- Run with write permissions in CI containers
- Check disk space and registry connectivity before batch removals
When it happens
Trigger: Running quarkus:remove-extensions when the underlying ExtensionManagerExt.removeExtensions(...) throws IOException — unwritable build file, catalog resolution failure, or serialization error.
Common situations: 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.
Related errors
- Failed to determine the list of installed extensions
- Error while generating the project update script
- Failed to open path tree with root %s
- Failed to read %s
- Failed to read resources from classpath
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/9cf7b327d53b0bbf.
Report an issue: GitHub.