{"record":{"id":"4008532000733623","repo":"MyCATApache/Mycat-Server","slug":"invalid-table-datanodes-datanode","errorCode":null,"errorMessage":"invalid table dataNodes: ${dataNode}","messagePattern":"invalid table dataNodes: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/config/model/TableConfig.java","lineNumber":88,"sourceCode":"        if (tableName == null) {\n            throw new IllegalArgumentException(\"table name is null\");\n        } else if (dataNode == null) {\n            throw new IllegalArgumentException(\"dataNode name is null\");\n        }\n        this.primaryKey = primaryKey;\n        this.autoIncrement = autoIncrement;\n        this.needAddLimit = needAddLimit;\n        this.fetchStoreNodeByJdbc = fetchStoreNodeByJdbc;\n        this.tableType = tableType;\n        this.dbTypes = dbType;\n        if (ruleRequired && rule == null) {\n            throw new IllegalArgumentException(\"ruleRequired but rule is null\");\n        }\n\n        this.name = tableName.toUpperCase();\n        String theDataNodes[] = SplitUtil.split(dataNode, ',', '$', '-');\n        if (theDataNodes == null || theDataNodes.length <= 0) {\n            throw new IllegalArgumentException(\"invalid table dataNodes: \" + dataNode);\n        }\n        dataNodes = new ArrayList<String>(theDataNodes.length);\n        for (String dn : theDataNodes) {\n            dataNodes.add(dn);\n        }\n\n        if (subTables != null && !subTables.equals(\"\")) {\n            String sTables[] = SplitUtil.split(subTables, ',', '$', '-');\n            if (sTables == null || sTables.length <= 0) {\n                throw new IllegalArgumentException(\"invalid table subTables\");\n            }\n            this.distTables = new ArrayList<String>(sTables.length);\n            for (String table : sTables) {\n                distTables.add(table);\n            }\n        } else {\n            this.distTables = new ArrayList<String>();\n        }","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/config/model/TableConfig.java#L70-L106","documentation":"After parsing the dataNode string with SplitUtil.split (which expands comma lists and $/- ranges), TableConfig requires at least one resulting node. If the split yields null or an empty array, IllegalArgumentException(\"invalid table dataNodes: ...\") is thrown, embedding the offending raw value.","triggerScenarios":"dataNode parameter is an empty string, blank/whitespace-only value, or a malformed range expression (e.g. dn$0-dn$1 with bad numbers) so split returns nothing.","commonSituations":"<table dataNode=\"\"> empty attribute in schema.xml; typo like dataNode=\" , ,\"; invalid range syntax such as dn$-dn$2; only whitespace between commas.","solutions":["Set a valid dataNode list on the <table> element, e.g. dataNode=\"dn1\" or dataNode=\"dn$0-dn$2\".","Fix malformed range syntax so SplitUtil can expand it to real node names.","Remove empty entries/extra commas from the dataNode value."],"exampleFix":"// before (schema.xml)\n<table name=\"orders\" dataNode=\"\" />\n// after\n<table name=\"orders\" dataNode=\"dn$0-dn$2\" />","handlingStrategy":"validation","validationCode":"String[] dns = SplitUtil.split(dataNode, ',', '$', '-');\nif (dns == null || dns.length == 0) throw new IllegalArgumentException(\"empty dataNode list for table \" + tableName);","typeGuard":null,"tryCatchPattern":"try { new TableConfig(...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"invalid table dataNodes\")) { LOG.error(\"fix dataNode value: {}\", e.getMessage()); } throw e; }","preventionTips":["Use explicit comma lists (dn1,dn2) or well-formed ranges (dn$0-dn$2).","Avoid empty strings and stray commas in the dataNode attribute.","Test range expansion locally before deploying config."],"tags":["config","mycat","datanode","invalid-argument"],"backgroundTag":"invalid-config-value","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}