apache/dubbo · error · IllegalStateException

No registry config found or it's not a valid config! The reg

Error message

No registry config found or it's not a valid config! The registry config is: <registryConfig>

What it means

Thrown by AbstractInterfaceConfig.checkRegistry(): after resolving registry IDs to RegistryConfig objects, at least one registry config reports isValid()==false. A registry is invalid when it lacks the required attributes (notably a usable address). This blocks service export/reference because there is no usable registry to register against.

Source

Thrown at dubbo-common/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java:285

        }
        if (CollectionUtils.isNotEmpty(this.registries)) {
            this.registries.forEach(registryConfig -> {
                if (registryConfig.getScopeModel() != applicationModel) {
                    registryConfig.setScopeModel(applicationModel);
                }
            });
        }
    }

    /**
     * Check whether the registry config is exists, and then conversion it to {@link RegistryConfig}
     */
    protected void checkRegistry() {
        convertRegistryIdsToRegistries();

        for (RegistryConfig registryConfig : registries) {
            if (!registryConfig.isValid()) {
                throw new IllegalStateException("No registry config found or it's not a valid config! "
                        + "The registry config is: " + registryConfig);
            }
        }
    }

    public static void appendRuntimeParameters(Map<String, String> map) {
        map.put(DUBBO_VERSION_KEY, Version.getProtocolVersion());
        map.put(RELEASE_KEY, Version.getVersion());
        map.put(TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
        if (ConfigUtils.getPid() > 0) {
            map.put(PID_KEY, String.valueOf(ConfigUtils.getPid()));
        }
    }

    /**
     * To obtain the method list in the port, use reflection when in native mode and javassist otherwise.
     *
     * @param interfaceClass

View on GitHub (pinned to 3a3043227f)

Solutions

  1. Set a valid registry address, e.g. dubbo.registry.address=nacos://127.0.0.1:8848 or zookeeper://127.0.0.1:2181.
  2. If configuring programmatically, call registryConfig.setAddress(...) before export/reference.
  3. Remove registry configs that are placeholders and not intended to be used.
  4. Verify the registry address placeholder (${registry.address}) resolves at runtime.

Example fix

// before
RegistryConfig rc = new RegistryConfig();
service.setRegistry(rc); // no address -> invalid
// after
RegistryConfig rc = new RegistryConfig();
rc.setAddress("zookeeper://127.0.0.1:2181");
service.setRegistry(rc);
Defensive patterns

Strategy: validation

Validate before calling

void assertRegistryValid(RegistryConfig rc) {
    if (rc == null || rc.getAddress() == null || rc.getAddress().trim().isEmpty()) {
        throw new IllegalStateException("registry config missing address: " + rc);
    }
}
// call before service.export() / reference reference()

Type guard

boolean isRegistryConfigValid(RegistryConfig rc) {
    return rc != null && rc.isValid();
}

Try / catch

try {
    serviceConfig.export();
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("No registry config found or it's not a valid config")) {
        // set dubbo.registry.address or setAddress on the RegistryConfig
    }
    throw e;
}

Prevention

When it happens

Trigger: checkRegistry() iterates the resolved registries; one has no address (or other required field), so isValid() is false. Triggered during service export or reference subscription when a registry is configured but incomplete.

Common situations: Registry address property not set or placeholder unresolved (e.g. dubbo.registry.address empty). A RegistryConfig bean created programmatically without setAddress(). Multiple registries where one is a stub/placeholder. Migration where the registry address moved to a new property key.

Related errors


AI-assisted analysis of apache/dubbo@3a3043227f (2026-08-14). Data as JSON: /api/errors/ad8fe49eeede981c. Report an issue: GitHub.