MyCATApache/Mycat-Server · critical · io.mycat.config.ConfigException
SelfCheck### user all node is empty!
Error message
SelfCheck### user all node is empty!
What it means
During configuration initialization, selfChecking0 validates that at least one user is configured. If the users map from the Mycat config (server.xml user sections) is null or empty, it throws ConfigException 'SelfCheck### user all node is empty!'. Mycat refuses to start without any user definitions because clients could never authenticate.
Solutions
- Add at least one valid <user name="..."><property name="password">...</property>...</user> block to server.xml
- Check the XML is well-formed and that <user> elements are direct children of the <mycat:server> root with correct namespace
- Uncomment the user section you disabled and restart Mycat
- Validate server.xml against the Mycat schema / compare with the default template shipped in conf
Example fix
<!-- before: no users in server.xml -->
<mycat:server>
<system>...</system>
</mycat:server>
// after
<mycat:server>
<user name="root">
<property name="password">123456</property>
<property name="schemas">TESTDB</property>
</user>
</mycat:server> Defensive patterns
Strategy: validation
Validate before calling
// before starting Mycat, check server.xml defines at least one user // (shell) grep -c '<user name=' conf/server.xml || echo 'FATAL: no users configured'
Try / catch
try {
new ConfigInitializer(isLoadMysql);
} catch (ConfigException e) {
if (e.getMessage() != null && e.getMessage().contains("user all node is empty")) {
LOG.error("server.xml has no <user> blocks; refusing to start");
}
throw e;
} Prevention
- Never ship or check in a server.xml without at least one <user> block
- Validate server.xml against the Mycat XSD in CI before deployment
- Keep the default root user block present (with changed password) even in stripped configs
- After config edits, restart in a staging env to catch self-check failures early
When it happens
Trigger: Starting Mycat when server.xml contains no <user> blocks, or the users collection parsed from config is empty/null — e.g. all user definitions commented out or a malformed config that failed to yield any users.
Common situations: Fresh install with a stripped server.xml; all <user> sections commented out during maintenance; XML typo (<users> instead of <user> or wrong namespace) so no users parse; failed config reload leaving users empty.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- SelfCheck### users node within the item is empty!
- SelfCheck### user refered schemas is empty!
- SelfCheck### schema
- SelfCheck### schema all node is empty!
- SelfCheck### schema dbnode is empty!
AI-assisted analysis of MyCATApache/Mycat-Server@65f8d8beb7 (2026-09-11).
Data as JSON: /api/errors/294fa0c814861521.
Report an issue: GitHub.
Appendix: source
Thrown at src/main/java/io/mycat/config/ConfigInitializer.java:125
if (system.getSequenceHandlerType() == SystemConfig.SEQUENCEHANDLER_ZK_DISTRIBUTED) {
DistributedSequenceHandler.getInstance(system).load();
}
if (system.getSequenceHandlerType() == SystemConfig.SEQUENCEHANDLER_ZK_GLOBAL_INCREMENT) {
IncrSequenceZKHandler.getInstance().load();
}
/**
* 配置文件初始化, 自检
*/
this.selfChecking0();
}
private void selfChecking0() throws ConfigException {
// 检查user与schema配置对应以及schema配置不为空
if (users == null || users.isEmpty()) {
throw new ConfigException("SelfCheck### user all node is empty!");
} else {
for (UserConfig uc : users.values()) {
if (uc == null) {
throw new ConfigException("SelfCheck### users node within the item is empty!");
}
Set<String> authSchemas = uc.getSchemas();
if (authSchemas == null) {
throw new ConfigException("SelfCheck### user " + uc.getName() + "refered schemas is empty!");
}
for (String schema : authSchemas) {
if ( !schemas.containsKey(schema) ) {
String errMsg = "SelfCheck### schema " + schema + " refered by user " + uc.getName() + " is not exist!";
throw new ConfigException(errMsg);
}View on GitHub (pinned to 65f8d8beb7)