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

  1. Ensure the build file and project directory are writable (check permissions, close IDE file locks).
  2. Re-run with a working registry connection; check network/proxy settings.
  3. Manually remove the <dependency> from pom.xml if the tool cannot write it.
  4. 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

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


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