{"record":{"id":"907c3ae893dad3c2","repo":"apache/dubbo","slug":"the-address-of-metadata-report-is-invalid","errorCode":null,"errorMessage":"The address of metadata report is invalid.","messagePattern":"The address of metadata report is invalid\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dubbo-common/src/main/java/org/apache/dubbo/config/MetadataReportConfig.java","lineNumber":159,"sourceCode":"    public MetadataReportConfig() {}\n\n    public MetadataReportConfig(ApplicationModel applicationModel) {\n        super(applicationModel);\n    }\n\n    public MetadataReportConfig(String address) {\n        setAddress(address);\n    }\n\n    public MetadataReportConfig(ApplicationModel applicationModel, String address) {\n        super(applicationModel);\n        setAddress(address);\n    }\n\n    public URL toUrl() throws IllegalArgumentException {\n        String address = this.getAddress();\n        if (isEmpty(address)) {\n            throw new IllegalArgumentException(\"The address of metadata report is invalid.\");\n        }\n        Map<String, String> map = new HashMap<>();\n        URL url = URL.valueOf(address, getScopeModel());\n        // Issue : https://github.com/apache/dubbo/issues/6491\n        // Append the parameters from address\n        map.putAll(url.getParameters());\n        // Append or overrides the properties as parameters\n        appendParameters(map, this);\n        // Normalize the parameters\n        map.putAll(convert(map, null));\n        // put the protocol of URL as the \"metadata\"\n        map.put(METADATA, isEmpty(url.getProtocol()) ? map.get(PROTOCOL_KEY) : url.getProtocol());\n        return new ServiceConfigURL(\n                        METADATA,\n                        StringUtils.isBlank(url.getUsername()) ? this.getUsername() : url.getUsername(),\n                        StringUtils.isBlank(url.getPassword()) ? this.getPassword() : url.getPassword(),\n                        url.getHost(),\n                        url.getPort(),","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/apache/dubbo/blob/3a3043227f5571d25eb2889de5bca22f2914843b/dubbo-common/src/main/java/org/apache/dubbo/config/MetadataReportConfig.java#L141-L177","documentation":"Thrown by MetadataReportConfig.toUrl() when the configured metadata report address is null or empty. toUrl() converts the address string into a Dubbo URL; an empty address cannot yield a valid URL, so it rejects early with IllegalArgumentException. This is distinct from URL parse errors which surface later from URL.valueOf().","triggerScenarios":"Constructing MetadataReportConfig with a null/empty address, or calling toUrl() after address was never set. Occurs during metadata report initialization when the metadata center address property is missing.","commonSituations":"Configuring <dubbo:metadata-report/> with no address attribute, or dubbo.metadata-report.address left blank while expecting a default. Programmatic config where setAddress() is skipped.","solutions":["Provide a valid metadata report address (e.g. 'zookeeper://127.0.0.1:2181').","If no metadata center is needed, do not register a MetadataReportConfig at all.","Ensure the address is set before the metadata report is initialized (before service export/reference)."],"exampleFix":"// before\nnew MetadataReportConfig(applicationModel, \"\");\n// after\nnew MetadataReportConfig(applicationModel, \"zookeeper://127.0.0.1:2181\");","handlingStrategy":"validation","validationCode":"String address = config.getAddress();\nif (address == null || address.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"metadata report address is empty\");\n}\n// safe to call toUrl()\nURL url = config.toUrl();","typeGuard":"static boolean hasValidMetadataAddress(MetadataReportConfig c) {\n    String a = c.getAddress();\n    return a != null && !a.trim().isEmpty();\n}","tryCatchPattern":"try {\n    URL url = metadataReportConfig.toUrl();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"address of metadata report is invalid\")) {\n        metadataReportConfig.setAddress(\"zookeeper://127.0.0.1:2181\");\n    } else throw e;\n}","preventionTips":["Always set the metadata report address when registering a MetadataReportConfig.","If no metadata center is needed, omit the config entirely.","Validate address is non-empty in a config sanity test."],"tags":["config","metadata-report","url","validation"],"backgroundTag":null,"analyzedSha":"3a3043227f5571d25eb2889de5bca22f2914843b","analyzedAt":"2026-08-14T00:43:19.853Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}