{"record":{"id":"06b81d3cae9c46d3","repo":"apache/dubbo","slug":"registry-not-found-id","errorCode":null,"errorMessage":"Registry not found: <id>","messagePattern":"Registry not found: <id>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java","lineNumber":515,"sourceCode":"\n    private void convertRegistryIdsToRegistries() {\n        computeValidRegistryIds();\n        if (StringUtils.isEmpty(registryIds)) {\n            if (CollectionUtils.isEmpty(registries)) {\n                List<RegistryConfig> registryConfigs = getConfigManager().getDefaultRegistries();\n                registryConfigs = new ArrayList<>(registryConfigs);\n                setRegistries(registryConfigs);\n            }\n        } else {\n            String[] ids = COMMA_SPLIT_PATTERN.split(registryIds);\n            List<RegistryConfig> tmpRegistries = new ArrayList<>();\n            Arrays.stream(ids).forEach(id -> {\n                if (tmpRegistries.stream().noneMatch(reg -> reg.getId().equals(id))) {\n                    Optional<RegistryConfig> globalRegistry = getConfigManager().getRegistry(id);\n                    if (globalRegistry.isPresent()) {\n                        tmpRegistries.add(globalRegistry.get());\n                    } else {\n                        throw new IllegalStateException(\"Registry not found: \" + id);\n                    }\n                }\n            });\n            setRegistries(tmpRegistries);\n        }\n    }\n\n    protected boolean notHasSelfRegistryProperty() {\n        return CollectionUtils.isEmpty(registries) && StringUtils.isEmpty(registryIds);\n    }\n\n    protected void completeCompoundConfigs(AbstractInterfaceConfig interfaceConfig) {\n        if (interfaceConfig != null) {\n            if (application == null) {\n                setApplication(interfaceConfig.getApplication());\n            }\n            if (module == null) {\n                setModule(interfaceConfig.getModule());","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java#L497-L533","documentation":"Thrown by AbstractInterfaceConfig.convertRegistryIdsToRegistries() during registry resolution. When a comma-separated `registryIds` value is set, Dubbo splits it and looks up each id in the ConfigManager; if none of the registered RegistryConfig instances match the id, this IllegalStateException is thrown. It indicates a configuration reference to a registry that was never declared or was declared under a different id.","triggerScenarios":"Setting `registry=\"reg1,reg2\"` or `registryIds` on a service/reference config where 'reg1' or 'reg2' was never registered as a RegistryConfig (e.g. missing <dubbo:registry id=\"reg1\">). Also occurs when a registry id is misspelled or removed from config while still referenced.","commonSituations":"Multi-registry setups where one registry id is typo'd. Refactoring that renames a registry bean id without updating all references. Spring Boot property-based config (dubbo.registries.reg1.address) where the key prefix doesn't match the referenced id.","solutions":["Check that every id in registryIds/registry has a matching RegistryConfig registered (e.g. a <dubbo:registry id=\"...\"> bean or dubbo.registry.<id>.address property).","Correct typos in registry id references.","Register the missing registry config before the service/reference that uses it.","If using programmatic config, ensure getConfigManager().addConfig(registryConfig) is called with the matching id."],"exampleFix":"// before\n<dubbo:registry id=\"mainRegistry\" address=\"zookeeper://...\"/>\n<dubbo:service interface=\"...\" registry=\"mainRegstry\"/> <!-- typo -->\n// after\n<dubbo:registry id=\"mainRegistry\" address=\"zookeeper://...\"/>\n<dubbo:service interface=\"...\" registry=\"mainRegistry\"/>","handlingStrategy":"validation","validationCode":"// Validate every registry id is registered before referencing\nimport org.apache.dubbo.config.context.ConfigManager;\n\nConfigManager cm = applicationModel.getApplicationConfigManager();\nfor (String id : registryIds.split(\",\")) {\n    id = id.trim();\n    if (id.isEmpty()) continue;\n    if (!cm.getRegistry(id).isPresent()) {\n        throw new IllegalStateException(\"Missing RegistryConfig for id: \" + id);\n    }\n}\nserviceConfig.setRegistryIds(registryIds);","typeGuard":"static boolean allRegistriesRegistered(ConfigManager cm, String registryIdsCsv) {\n    if (registryIdsCsv == null || registryIdsCsv.isEmpty()) return true;\n    for (String id : registryIdsCsv.split(\",\")) {\n        if (!cm.getRegistry(id.trim()).isPresent()) return false;\n    }\n    return true;\n}","tryCatchPattern":"try {\n    serviceConfig.setRegistryIds(ids);\n    serviceConfig.export();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Registry not found:\")) {\n        String missingId = e.getMessage().substring(\"Registry not found:\".length()).trim();\n        // register a RegistryConfig with that id, or fix the reference\n    } else throw e;\n}","preventionTips":["Centralize registry ids in a constant/enum to avoid typos.","In tests, assert that every referenced registry id is registered before export.","Use Spring bean id references so IDEs catch mismatches."],"tags":["config","registry","reference-resolution"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}