egametang/ET · critical · Exception
zone: {zone} not found mongo connect string
Error message
zone: {zone} not found mongo connect string What it means
GetZoneDB (line 59) throws when StartZoneConfig.DBConnection for the requested zone is null/empty. This means the zone configuration (StartZoneConfigCategory) has no MongoDB connection string for that zone, so no DBComponent can be created and any persistence for the zone is impossible.
Source
Thrown at Packages/cn.etetet.db/Scripts/Hotfix/Server/DBManagerComponentSystem.cs:59
}
MongoClient mongoClient = new(startZoneConfig.DBConnection);
await mongoClient.DropDatabaseAsync(dbName);
await ETTask.CompletedTask;
}
public static DBComponent GetZoneDB(this DBManagerComponent self, int zone)
{
DBComponent dbComponent = self.GetChild<DBComponent>(zone);
if (dbComponent != null)
{
return dbComponent;
}
StartZoneConfig startZoneConfig = self.GetStartZoneConfig(zone);
if (string.IsNullOrEmpty(startZoneConfig.DBConnection))
{
throw new Exception($"zone: {zone} not found mongo connect string");
}
string dbName = self.GetZoneDBName(zone);
if (string.IsNullOrEmpty(dbName))
{
throw new Exception($"zone: {zone} not found mongo db name");
}
dbComponent = self.AddChildWithId<DBComponent, string, string>(zone, startZoneConfig.DBConnection, dbName);
return dbComponent;
}
}
}
View on GitHub (pinned to 5cab01f7a8)
Solutions
- Set DBConnection on the StartZoneConfig row for the zone (in the active StartConfig variant) to a valid mongodb:// connection string.
- Confirm the zone id matches a row in StartZoneConfigCategory and that the config was loaded.
- Re-run Luban config export and verify DBConnection is populated for all zones that need persistence.
- Verify the correct StartConfig variant (Localhost/Moba/Mmo/Release) is active for this environment.
Defensive patterns
Strategy: validation
Validate before calling
StartZoneConfig cfg = configCategory.Get(zone);
if (string.IsNullOrEmpty(cfg?.DBConnection)) throw new InvalidOperationException($"zone {zone} missing DBConnection - check StartConfig"); Prevention
- Configure DBConnection for every zone that needs persistence.
- Validate StartConfig after Luban export.
- Use the correct config variant per environment.
When it happens
Trigger: Requesting dbManager.GetZoneDB(zone) for a zone whose StartZoneConfig row omits/blank DBConnection, a zone id not present in the start config, or a config table that was not loaded before the DB call.
Common situations: Bringing up a new zone without configuring its DB, config generation (Luban) dropping the DBConnection column, pointing at the wrong StartConfig folder/variant, or a zone id mismatch between caller and config.
Related errors
- zone: {zone} not found mongo db name
- Process is too large: {Options.Instance.Process}
- config factory target is null: {factory.GetType().FullName}
- create config factory failed: {factoryType.FullName}
- config factory not found: {configType.FullName}
AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13).
Data as JSON: /api/errors/7e8c9aa47d02434c.
Report an issue: GitHub.