quarkusio/quarkus · error · IllegalStateException

Failed to translate ${provider} to URL

Error message

Failed to translate ${provider} to URL

What it means

Thrown by ExtensionCatalogResolver.getClientFactory when the registry configuration provides a 'client-factory-url' extra value that is not a syntactically valid URL. The invalid value is reported in the message and the MalformedURLException as the cause.

Source

Thrown at independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java:138

                        .add(new RegistryExtensionResolver(clientFactory.buildRegistryClient(config), log));
            }
        }

        private RegistryClientFactory getClientFactory(RegistryConfig config) {
            if (config.getExtra().isEmpty()) {
                return getDefaultClientFactory();
            }
            Object provider = config.getExtra().get("client-factory-artifact");
            if (provider != null) {
                return loadFromArtifact(config, provider);
            }
            provider = config.getExtra().get("client-factory-url");
            if (provider != null) {
                final URL url;
                try {
                    url = new URL((String) provider);
                } catch (MalformedURLException e) {
                    throw new IllegalStateException("Failed to translate " + provider + " to URL", e);
                }
                return loadFromUrl(url);
            }
            return getDefaultClientFactory();
        }

        public RegistryClientFactory loadFromArtifact(RegistryConfig config, final Object providerValue) {
            ArtifactCoords providerArtifact;
            try {
                final String providerStr = (String) providerValue;
                providerArtifact = ArtifactCoords.fromString(providerStr);
            } catch (Exception e) {
                throw new IllegalStateException("Failed to process configuration of " + config.getId()
                        + " registry: failed to cast " + providerValue + " to String", e);
            }
            final File providerJar;
            try {
                providerJar = artifactResolver.resolve(new DefaultArtifact(providerArtifact.getGroupId(),

View on GitHub (pinned to e1c734241f)

Solutions

  1. Correct the client-factory-url value to a fully qualified, absolute URL including scheme (https://...)
  2. Remove surrounding whitespace/quotes from the configured value
  3. If a variable is substituted, verify it resolves to a non-empty valid URL
  4. Test the URL with new URL(value) or curl before configuring

Example fix

// before
quarkus.registry.my-registry.client-factory-url=registry.example.com/factory
// after
quarkus.registry.my-registry.client-factory-url=https://registry.example.com/factory
Defensive patterns

Strategy: validation

Validate before calling

String provider = config.getExtra().get("client-factory-url");
if (provider != null) {
    try { new java.net.URL(provider.trim()); }
    catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid client-factory-url: " + provider); }
}

Try / catch

try {
    resolver.build();
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("Failed to translate ") && e.getMessage().endsWith("to URL")) {
        // fix the client-factory-url value identified in the message
    }
    throw e;
}

Prevention

When it happens

Trigger: Setting quarkus.registry.<id>.extra client-factory-url to a malformed string (missing protocol, illegal characters, spaces) which fails new URL(provider).

Common situations: Typo like 'http:/host' (single slash) or 'repo.example.com' without scheme; copied URL with trailing whitespace; environment-substituted variable left empty producing 'null' or empty string.

Related errors


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