{"record":{"id":"27126177e96c88db","repo":"MyCATApache/Mycat-Server","slug":"load-crc32slot-datafile-error-dn-value-range","errorCode":null,"errorMessage":"load crc32slot datafile error:dn=value=${range}","messagePattern":"load crc32slot datafile error:dn=value=(.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/migrate/MigrateUtils.java","lineNumber":186,"sourceCode":"        }\n        return Joiner.on(',').join(rangeStringList);\n    }\n\n    public static List<Range> convertRangeStringToList(String rangeStr) {\n        List<String> ranges = Splitter.on(\",\").omitEmptyStrings().trimResults().splitToList(rangeStr);\n        List<Range> rangeList = new ArrayList<>();\n        for (String range : ranges) {\n            List<String> vv = Splitter.on(\"-\").omitEmptyStrings().trimResults().splitToList(range);\n            if (vv.size() == 2) {\n                Range ran = new Range(Integer.parseInt(vv.get(0)), Integer.parseInt(vv.get(1)));\n                rangeList.add(ran);\n\n            } else if (vv.size() == 1) {\n                Range ran = new Range(Integer.parseInt(vv.get(0)), Integer.parseInt(vv.get(0)));\n                rangeList.add(ran);\n\n            } else {\n                throw new RuntimeException(\"load crc32slot datafile error:dn=value=\" + range);\n            }\n        }\n        return rangeList;\n    }\n\n    public static int getCurTotalSize(List<Range> rangeList) {\n        int size = 0;\n        for (Range range : rangeList) {\n            size = size + range.size;\n        }\n        return size;\n    }\n\n    public static String getDatabaseFromDataNode(String dn) {\n        return MycatServer.getInstance().getConfig().getDataNodes().get(dn).getDatabase();\n    }\n\n    public static String getDataHostFromDataNode(String dn) {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/migrate/MigrateUtils.java#L168-L204","documentation":"convertRangeStringToList parses a dn=value range string from the crc32slot rule file. A value must be either 'start-end' or a single integer; any other token count is unsupported, so it throws this error including the offending range string. It protects the slot map from corrupt or hand-edited entries.","triggerScenarios":"Rule file entry contains a malformed dn value like '0,5-10', extra tokens, empty values, or non-numeric text that fails Integer.parseInt earlier and falls through with unexpected size.","commonSituations":"Manual editing of crc32slot files; corrupted file from a failed write or encoding issue; entries generated by an incompatible MyCAT version.","solutions":["Open the crc32slot file and fix the offending dn value to a single integer or 'start-end' format.","Regenerate the rule file rather than hand-editing, using MyCAT's rule-file tooling.","Check for hidden characters/encoding corruption and rewrite the file in plain ASCII.","Back up the file before edits and diff against a known-good copy from a matching environment."],"exampleFix":"// before\ndn1=0,10-20\n// after\ndn1=0-9\ndn2=10-20","handlingStrategy":"validation","validationCode":"// validate rule file entries before loading\nfor (String line : Files.readAllLines(ruleFile)) {\n    if (!line.matches(\"dn\\\\d+=(\\\\d+|\\\\d+-\\\\d+)\")) throw new IllegalStateException(\"bad range entry: \" + line);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate the rule file instead of manual edits","Keep rule files ASCII and verify after transfers between hosts","Version-control crc32slot files so corruption is diffable","Parse the rule file with a validator script before migration"],"tags":["migration","parsing","crc32slot","format"],"backgroundTag":"invalid-argument-format","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"}