{"record":{"id":"6163bcd064e9814c","repo":"quarkusio/quarkus","slug":"failed-to-translate-provider-to-url","errorCode":null,"errorMessage":"Failed to translate ${provider} to URL","messagePattern":"Failed to translate (.+?) to URL","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java","lineNumber":138,"sourceCode":"                        .add(new RegistryExtensionResolver(clientFactory.buildRegistryClient(config), log));\n            }\n        }\n\n        private RegistryClientFactory getClientFactory(RegistryConfig config) {\n            if (config.getExtra().isEmpty()) {\n                return getDefaultClientFactory();\n            }\n            Object provider = config.getExtra().get(\"client-factory-artifact\");\n            if (provider != null) {\n                return loadFromArtifact(config, provider);\n            }\n            provider = config.getExtra().get(\"client-factory-url\");\n            if (provider != null) {\n                final URL url;\n                try {\n                    url = new URL((String) provider);\n                } catch (MalformedURLException e) {\n                    throw new IllegalStateException(\"Failed to translate \" + provider + \" to URL\", e);\n                }\n                return loadFromUrl(url);\n            }\n            return getDefaultClientFactory();\n        }\n\n        public RegistryClientFactory loadFromArtifact(RegistryConfig config, final Object providerValue) {\n            ArtifactCoords providerArtifact;\n            try {\n                final String providerStr = (String) providerValue;\n                providerArtifact = ArtifactCoords.fromString(providerStr);\n            } catch (Exception e) {\n                throw new IllegalStateException(\"Failed to process configuration of \" + config.getId()\n                        + \" registry: failed to cast \" + providerValue + \" to String\", e);\n            }\n            final File providerJar;\n            try {\n                providerJar = artifactResolver.resolve(new DefaultArtifact(providerArtifact.getGroupId(),","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/ExtensionCatalogResolver.java#L120-L156","documentation":"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.","triggerScenarios":"Setting quarkus.registry.<id>.extra client-factory-url to a malformed string (missing protocol, illegal characters, spaces) which fails new URL(provider).","commonSituations":"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.","solutions":["Correct the client-factory-url value to a fully qualified, absolute URL including scheme (https://...)","Remove surrounding whitespace/quotes from the configured value","If a variable is substituted, verify it resolves to a non-empty valid URL","Test the URL with new URL(value) or curl before configuring"],"exampleFix":"// before\nquarkus.registry.my-registry.client-factory-url=registry.example.com/factory\n// after\nquarkus.registry.my-registry.client-factory-url=https://registry.example.com/factory","handlingStrategy":"validation","validationCode":"String provider = config.getExtra().get(\"client-factory-url\");\nif (provider != null) {\n    try { new java.net.URL(provider.trim()); }\n    catch (MalformedURLException e) { throw new IllegalArgumentException(\"Invalid client-factory-url: \" + provider); }\n}","typeGuard":null,"tryCatchPattern":"try {\n    resolver.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Failed to translate \") && e.getMessage().endsWith(\"to URL\")) {\n        // fix the client-factory-url value identified in the message\n    }\n    throw e;\n}","preventionTips":["Always include scheme (https://) in configured URLs","Trim whitespace and quotes from config values before storing them","Validate configured URLs at config-load time"],"tags":["configuration","url","registry"],"backgroundTag":"malformed-url-config","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}