{"record":{"id":"db1ae98e742d4c42","repo":"quarkusio/quarkus","slug":"failed-to-locate-the-repository-url-corresponding","errorCode":null,"errorMessage":"Failed to locate the repository URL corresponding to repository ${srcRepoId}","messagePattern":"Failed to locate the repository URL corresponding to repository (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/client/maven/MavenRegistryClientFactory.java","lineNumber":115,"sourceCode":"                        registryDescriptorCoords, cleanupTimestampedArtifacts);\n            } catch (BootstrapMavenException e) {\n                throw new RegistryResolutionException(getDescriptorResolutionFailureMessage(config, resolver, e));\n            }\n        }\n\n        final String srcRepoId = result.getRepository() == null ? \"n/a\" : result.getRepository().getId();\n        log.debug(\"Resolved registry descriptor %s from %s\", registryDescriptorCoords, srcRepoId);\n        if (!registryRepos.isEmpty()) {\n            if (srcRepoId != null && !\"local\".equals(srcRepoId)) {\n                String srcRepoUrl = null;\n                for (RemoteRepository repo : resolver.getRepositories()) {\n                    if (repo.getId().equals(srcRepoId)) {\n                        srcRepoUrl = repo.getUrl();\n                        break;\n                    }\n                }\n                if (srcRepoUrl == null) {\n                    throw new IllegalStateException(\n                            \"Failed to locate the repository URL corresponding to repository \" + srcRepoId);\n                }\n            } else {\n                log.debug(\"Failed to determine the remote repository for %s registry descriptor %s\", config.getId(),\n                        registryDescriptorCoords);\n            }\n        }\n\n        final RegistryConfig.Mutable descriptor;\n        try {\n            // Do not fix or add any missing bits.\n            descriptor = RegistryConfig.mutableFromFile(result.getArtifact().getFile().toPath());\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Failed to deserialize registries descriptor \" + result.getArtifact().getFile(), e);\n        }\n\n        if (!isComplete(config, descriptor)) {\n            config = completeRegistryConfig(config, descriptor);","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/client/maven/MavenRegistryClientFactory.java#L97-L133","documentation":"After successfully resolving the registry descriptor, buildRegistryClient() tries to determine which remote repository served it by matching result.getRepository().getId() against the resolver's configured repositories to obtain the source URL. If the artifact came from a repository whose id is not present in the resolver's repository list, this IllegalStateException is thrown — an internal consistency failure indicating the resolver configuration and artifact result disagree.","triggerScenarios":"The resolved descriptor's ArtifactResult reports a source repository id (not \"local\"/null) that does not match any RemoteRepository id in the resolver's effective repository list — e.g. resolution was served by a repository injected via a mirror with a rewritten id, or resolver/repo lists were customized inconsistently.","commonSituations":"Maven mirror settings rewriting repository ids so the effective repo id differs from the configured one; custom MavenRepositoryService/resolver wrappers that drop or rename repos; unusual settings.xml configurations mixing profiles with same-id repos; a Quarkus/Maven resolver version mismatch bug.","solutions":["Inspect settings.xml mirrors/profiles and make the effective repository id match the configured registry repo id (align <mirror><id> or remove the renaming mirror)","Run with -X / debug logging to see which repository id the artifact was actually resolved from and compare with the configured list","Update the Quarkus registry-client/Maven resolver versions — this can be an internal inconsistency bug fixed upstream","As a workaround, define the registry repository explicitly (matching id and url) in settings.xml so the id lookup succeeds"],"exampleFix":"// before: mirror id differs from the registry repo id\n<mirror><id>my-corp-mirror</id><mirrorOf>quarkus-registry</mirrorOf>...\n// after: keep the same id so lookup matches\n<mirror><id>quarkus-registry</id><url>https://corp-mirror.example/quarkus</url><mirrorOf>quarkus-registry</mirrorOf>...</mirror>","handlingStrategy":"validation","validationCode":"// before building the client, ensure repository ids are unique and mirrors keep ids stable\nSet<String> ids = new HashSet<>();\nfor (RemoteRepository r : originalResolver.getRepositories()) {\n    if (!ids.add(r.getId())) throw new IllegalStateException(\"Duplicate repo id: \" + r.getId());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not rename repository ids via mirrors; keep mirror <id> equal to the mirrored repo id","Avoid configuring the same repo id in multiple profiles with different URLs","Test registry resolution after any settings.xml mirror/proxy change","Keep quarkus-registry-client and Maven resolver versions in sync","Enable debug logging for registry resolution in CI to catch id drift early"],"tags":["maven","mirror","repository-id","inconsistent-state"],"backgroundTag":"repository-id-mismatch","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"}