egametang/ET · critical · Exception

zone: {zone} not found mongo db name

Error message

zone: {zone} not found mongo db name

What it means

GetZoneDB (line 65) throws when GetZoneDBName returns empty - i.e. StartZoneConfig.DBName for the zone is null/empty. Without a database name a DBComponent cannot connect, so the zone's Mongo persistence is unavailable.

Source

Thrown at Packages/cn.etetet.db/Scripts/Hotfix/Server/DBManagerComponentSystem.cs:65

        
        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

  1. Set DBName on the zone's StartZoneConfig row in the active StartConfig variant.
  2. Re-run Luban export and confirm DBName is populated for all zones.
  3. Verify the correct StartConfig variant is loaded for this environment.
  4. Cross-check that both DBConnection and DBName are set for each zone.
Defensive patterns

Strategy: validation

Validate before calling

string name = dbManager.GetZoneDBName(zone);
if (string.IsNullOrEmpty(name)) throw new InvalidOperationException($"zone {zone} missing DBName - check StartConfig");

Prevention

When it happens

Trigger: Calling GetZoneDB(zone) where the zone's StartZoneConfig.DBName is blank, even though DBConnection is set; or a config row missing the DBName column after a Luban export.

Common situations: Newly added zone with DBConnection but forgotten DBName, config schema change dropping DBName, wrong StartConfig variant, manual config edits.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/0b78db240cdd5614. Report an issue: GitHub.