{"record":{"id":"0b78db240cdd5614","repo":"egametang/ET","slug":"zone-zone-not-found-mongo-db-name","errorCode":null,"errorMessage":"zone: {zone} not found mongo db name","messagePattern":"zone: (.+?) not found mongo db name","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"Packages/cn.etetet.db/Scripts/Hotfix/Server/DBManagerComponentSystem.cs","lineNumber":65,"sourceCode":"        \n        public static DBComponent GetZoneDB(this DBManagerComponent self, int zone)\n        {\n            DBComponent dbComponent = self.GetChild<DBComponent>(zone);\n            if (dbComponent != null)\n            {\n                return dbComponent;\n            }\n\n            StartZoneConfig startZoneConfig = self.GetStartZoneConfig(zone);\n            if (string.IsNullOrEmpty(startZoneConfig.DBConnection))\n            {\n                throw new Exception($\"zone: {zone} not found mongo connect string\");\n            }\n\n            string dbName = self.GetZoneDBName(zone);\n            if (string.IsNullOrEmpty(dbName))\n            {\n                throw new Exception($\"zone: {zone} not found mongo db name\");\n            }\n\n            dbComponent = self.AddChildWithId<DBComponent, string, string>(zone, startZoneConfig.DBConnection, dbName);\n            return dbComponent;\n        }\n    }\n}\n","sourceCodeStart":47,"sourceCodeEnd":73,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.db/Scripts/Hotfix/Server/DBManagerComponentSystem.cs#L47-L73","documentation":"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.","triggerScenarios":"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.","commonSituations":"Newly added zone with DBConnection but forgotten DBName, config schema change dropping DBName, wrong StartConfig variant, manual config edits.","solutions":["Set DBName on the zone's StartZoneConfig row in the active StartConfig variant.","Re-run Luban export and confirm DBName is populated for all zones.","Verify the correct StartConfig variant is loaded for this environment.","Cross-check that both DBConnection and DBName are set for each zone."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string name = dbManager.GetZoneDBName(zone);\nif (string.IsNullOrEmpty(name)) throw new InvalidOperationException($\"zone {zone} missing DBName - check StartConfig\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set both DBConnection and DBName on a zone config.","Validate config completeness after Luban export.","Use the right StartConfig variant."],"tags":["database","mongodb","config","startup"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}