MyCATApache/Mycat-Server · error · ConfigException

please check tableFile.properties,make sure

Error message

please check tableFile.properties,make sure {schemaName}:{tableName} is sharding table 

What it means

loadMigratorTable rejects non-sharding tables: if either the old or the new TableConfig is null (the table is not a sharding table in one of the configs), a ConfigException is thrown instructing the user to fix tablesFile.properties. Global tables are skipped with a warning instead, but entirely missing table configs are fatal.

Solutions

  1. Remove non-sharding tables from tablesFile.properties — only sharding tables can be migrated.
  2. Ensure the table is defined as a sharding <table> with a rule in BOTH old and new schema.xml.
  3. Fix the table name spelling in tablesFile.properties.
  4. Re-run after confirming both configs resolve the table to non-null TableConfig objects.

Example fix

// before: tablesFile.properties
mydb:order_main,dict_table  # dict_table is not sharded
// after
mydb:order_main
Defensive patterns

Strategy: validation

Validate before calling

for (String table : tables) {
    TableConfig oldT = oldSchema.getTables().get(table);
    TableConfig newT = newSchema.getTables().get(table);
    if (oldT == null || newT == null)
        throw new IllegalArgumentException("non-sharding/missing table: " + schema + ":" + table);
    if (oldT.isGlobalTable() || newT.isGlobalTable()) continue; // skipped anyway
}

Try / catch

try {
    comparer.compare();
} catch (ConfigException e) {
    if (e.getMessage().contains("is sharding table")) {
        // remove non-sharding tables from tablesFile.properties
    }
    throw e;
}

Prevention

When it happens

Trigger: tablesFile.properties lists a table that exists in one configuration but is null/absent in the other (non-sharding table, or configured only in old or only in new schema.xml).

Common situations: Listing a normal (non-sharded) MySQL table in tablesFile.properties; a table defined with dataNode directly in only one config; typo so the table lookup fails in the new config.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11). Data as JSON: /api/errors/6a7c6a53ca2c2df4. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/io/mycat/util/dataMigrator/ConfigComparer.java:169

			Set<String> newSet = newTables.keySet();
			if(!oldSet.equals(newSet)){
				throw new ConfigException("new & old table config is not equal!");
			}
			for(String tableName:oldSet){
				TableConfig oldTable = oldTables.get(tableName);
				TableConfig newTable = newTables.get(tableName);
				loadMigratorTable(oldTable, newTable,schemaName,tableName);
			}
		}
		
	}
	
	
	
	private void loadMigratorTable(TableConfig oldTable,TableConfig newTable,String schemaName,String tableName){
		//禁止配置非拆分表
		if(oldTable == null || newTable == null){
			throw new ConfigException("please check tableFile.properties,make sure "+schemaName+":"+tableName+" is sharding table ");
		}
		//忽略全局表
		if(oldTable.isGlobalTable()||newTable.isGlobalTable()){
			String message = "global table: "+schemaName+":"+tableName+" is ignore!";
			System.out.println("Warn: "+message);
			LOGGER.warn(message);
		}else{
			List<DataNode > oldDN = getDataNodes(oldTable,oldDataNodes,oldDataHosts);
			List<DataNode > newDN = getDataNodes(newTable,newDataNodes,newDataHosts);
			//忽略数据节点分布没有发生变化的表
			if(isNeedMigrate(oldDN,newDN)){
				LOGGER.info("old table:{}",oldTable);
				LOGGER.info("new table:{}",newTable);
				if (oldTable.getRule()== null){
					LOGGER.info("beacuse {} rule is null,skip it,check it is er child table",oldTable);
					return;
				}
				if (newTable.getRule()==null){

View on GitHub (pinned to 65f8d8beb7)