{"record":{"id":"f7e2a24a20bf47fb","repo":"alibaba/nacos","slug":"dataid-dataid-group-group","errorCode":null,"errorMessage":"dataId={dataId}, group={group}","messagePattern":"dataId=(.+?), group=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java","lineNumber":586,"sourceCode":"    \n    public boolean isDiscard() {\n        return isDiscard;\n    }\n    \n    public void setDiscard(boolean discard) {\n        isDiscard = discard;\n    }\n    \n    public CacheData(ConfigFilterChainManager configFilterChainManager, String envName,\n        String dataId, String group) {\n        this(configFilterChainManager, envName, dataId, group, TenantUtil.getUserTenantForAcm());\n    }\n    \n    public CacheData(ConfigFilterChainManager configFilterChainManager, String envName,\n        String dataId, String group,\n        String tenant) {\n        if (null == dataId || null == group) {\n            throw new IllegalArgumentException(\"dataId=\" + dataId + \", group=\" + group);\n        }\n        this.configFilterChainManager = configFilterChainManager;\n        this.envName = envName;\n        this.dataId = dataId;\n        this.group = group;\n        this.tenant = tenant;\n        this.listeners = new CopyOnWriteArrayList<>();\n        this.isInitializing = true;\n        if (initSnapshot) {\n            this.content = loadCacheContentFromDiskLocal(envName, dataId, group, tenant);\n            this.encryptedDataKey =\n                loadEncryptedDataKeyFromDiskLocal(envName, dataId, group, tenant);\n            this.md5 = getMd5String(this.content);\n        }\n    }\n    \n    // ==================\n    ","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/client/src/main/java/com/alibaba/nacos/client/config/impl/CacheData.java#L568-L604","documentation":"Thrown by the CacheData constructor when dataId or group is null. CacheData is the in-memory representation of a single config identified by (dataId, group, tenant); a null dataId or group makes the resource unaddressable and would break cache maps keyed on these fields. The constructor rejects either being null (note: empty strings are NOT rejected here, only nulls).","triggerScenarios":"Constructing new CacheData(...) with a null dataId or group argument, typically indirectly via internal client code that failed to resolve the dataId/group from a request or snapshot.","commonSituations":"A malformed config request, a snapshot/failover file whose parsed dataId/group is null, or internal client logic invoking the constructor before validating inputs.","solutions":["Validate dataId and group are non-null before constructing CacheData (use ParamUtils.isValid).","Trace which caller builds CacheData with null fields (often LocalConfigInfoProcessor or ClientWorker) and fix the upstream parse.","Delete corrupted snapshot files that yield null dataId/group on reload."],"exampleFix":"// before\nCacheData cd = new CacheData(filter, env, dataId, group, tenant);\n\n// after\nif (dataId == null || group == null) {\n    throw new IllegalArgumentException(\"dataId and group must not be null\");\n}\nCacheData cd = new CacheData(filter, env, dataId, group, tenant);","handlingStrategy":"validation","validationCode":"if (dataId == null || group == null) {\n    throw new IllegalArgumentException(\"dataId and group must not be null\");\n}\nnew CacheData(filter, env, dataId, group, tenant);","typeGuard":"static boolean hasNonNullKeys(String dataId, String group) {\n    return dataId != null && group != null;\n}","tryCatchPattern":"try {\n    new CacheData(filter, env, dataId, group, tenant);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"dataId=\")) {\n        log.error(\"null dataId or group constructing CacheData\", e);\n    }\n}","preventionTips":["Validate dataId/group non-null before constructing CacheData.","Sanitize snapshots that parse to null fields.","Use ParamUtils.isValid for full validation."],"tags":["config","cache-data","validation","client"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}