{"record":{"id":"029ce5edaf0a5507","repo":"MyCATApache/Mycat-Server","slug":"new-config-for-migrate-read-fail-please-check-new","errorCode":null,"errorMessage":" new config for migrate read fail!please check newSchema.xml or  newRule.xml  {e}","messagePattern":" new config for migrate read fail!please check newSchema\\.xml or  newRule\\.xml  (.+?)","errorType":"exception","errorClass":"ConfigException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java","lineNumber":95,"sourceCode":"\t\ttry{\n\t\t\toldLoader = new XMLSchemaLoader();\n\t\t\toldDataHosts = oldLoader.getDataHosts();\n\t\t\toldDataNodes = oldLoader.getDataNodes();\n\t\t\toldSchemas = oldLoader.getSchemas();\n\t\t}catch(Exception e){\n\t\t\tthrow new ConfigException(\" old config for migrate read fail!please check schema.xml or  rule.xml  \"+e);\n\t\t}\n\t\t\n\t}\n\t\n\tprivate void loadNewConfig(){\n\t\ttry{\n\t\t\tnewLoader = new XMLSchemaLoader(NEW_SCHEMA, NEW_RULE);\n\t\t\tnewDataHosts = newLoader.getDataHosts();\n\t\t\tnewDataNodes = newLoader.getDataNodes();\n\t\t\tnewSchemas = newLoader.getSchemas();\n\t\t}catch(Exception e){\n\t\t\tthrow new ConfigException(\" new config for migrate read fail!please check newSchema.xml or  newRule.xml  \"+e);\n\t\t}\n\t\t\n\t}\n\t\n\t\n\tprivate void loadTablesFile() throws Exception{\n\t\tProperties pro = new Properties();\n\t\tif(!isAwaysUseMaster){\n\t\t\tdnIndexProps = loadDnIndexProps();\n\t\t}\n\t\ttry{\n\t\t\tpro.load(ConfigComparer.class.getResourceAsStream(TABLES_FILE));\n\t\t}catch(Exception e){\n\t\t\tthrow new ConfigException(\"tablesFile.properties read fail!\");\n\t\t}\n\t\tIterator<Entry<Object, Object>> it = pro.entrySet().iterator();\n\t\twhile(it.hasNext()){\n\t\t\tEntry<Object, Object> entry  = it.next();","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java#L77-L113","documentation":"ConfigComparer.loadNewConfig loads the post-migration target configuration from NEW_SCHEMA/newSchema.xml and NEW_RULE/newRule.xml via XMLSchemaLoader. Any exception is wrapped as ConfigException(' new config for migrate read fail!please check newSchema.xml or newRule.xml <cause>').","triggerScenarios":"Running the dataMigrator export/compare when newSchema.xml or newRule.xml is absent from the working directory, malformed, or internally inconsistent (dangling dataNode/rule references).","commonSituations":"User forgot to generate or copy newSchema.xml/newRule.xml before running migration; template configs edited with syntax errors; new config referencing dataHosts that do not exist in the new cluster.","solutions":["Confirm newSchema.xml and newRule.xml exist in the migration working directory with exactly those names","Validate the new XML files parse cleanly (xmllint) and match Mycat's schema DTD","Fix the underlying error reported in the wrapped cause (missing file vs. semantic reference error)","Regenerate newSchema.xml/newRule.xml with the migration tooling or copy verified templates from a working cluster"],"exampleFix":"// before\njava ... ConfigComparer // newSchema.xml absent in workdir\n// after\ncp newSchema.xml newRule.xml /path/to/migrator/workdir && rerun","handlingStrategy":"validation","validationCode":"static boolean newConfigPresent(String dir){\n    return new java.io.File(dir, \"newSchema.xml\").canRead()\n        && new java.io.File(dir, \"newRule.xml\").canRead();\n}","typeGuard":null,"tryCatchPattern":"try { comparer.loadNewConfig(); }\ncatch (ConfigException e) { LOG.error(\"newSchema.xml/newRule.xml unreadable: \" + e.getMessage(), e); throw e; }","preventionTips":["Generate newSchema.xml/newRule.xml with the migration tooling before running","Validate the new XML parses and all dataHost/dataNode references resolve","Use exact file names expected by the migrator (newSchema.xml, newRule.xml)","Smoke-test the new config in a staging Mycat instance before migration"],"tags":["xml","configuration","migration","mycat"],"backgroundTag":"missing-config-file","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"}