{"record":{"id":"fdbc7e9dd047930c","repo":"TechnitiumSoftware/DnsServer","slug":"maxmind-country-file-is-missing-fdbc7e","errorCode":null,"errorMessage":"MaxMind Country file is missing!","messagePattern":"MaxMind Country file is missing!","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"Apps/GeoCountryApp/MaxMind.cs","lineNumber":49,"sourceCode":"        static MaxMind? _maxMind;\n\n        readonly DatabaseReader _mmCountryReader;\n        readonly DatabaseReader? _mmIspReader;\n        readonly DatabaseReader? _mmAsnReader;\n\n        #endregion\n\n        #region constructor\n\n        private MaxMind(IDnsServer dnsServer)\n        {\n            string mmCountryFile = Path.Combine(dnsServer.ApplicationFolder, \"GeoIP2-Country.mmdb\");\n\n            if (!File.Exists(mmCountryFile))\n                mmCountryFile = Path.Combine(dnsServer.ApplicationFolder, \"GeoLite2-Country.mmdb\");\n\n            if (!File.Exists(mmCountryFile))\n                throw new FileNotFoundException(\"MaxMind Country file is missing!\");\n\n            _mmCountryReader = new DatabaseReader(mmCountryFile);\n\n            string mmIspFile = Path.Combine(dnsServer.ApplicationFolder, \"GeoIP2-ISP.mmdb\");\n            if (File.Exists(mmIspFile))\n            {\n                _mmIspReader = new DatabaseReader(mmIspFile);\n                return;\n            }\n\n            string mmAsnFile = Path.Combine(dnsServer.ApplicationFolder, \"GeoLite2-ASN.mmdb\");\n            if (File.Exists(mmAsnFile))\n                _mmAsnReader = new DatabaseReader(mmAsnFile);\n        }\n\n        #endregion\n\n        #region IDisposable","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/Apps/GeoCountryApp/MaxMind.cs#L31-L67","documentation":"Thrown by the GeoCountryApp MaxMind constructor when neither GeoIP2-Country.mmdb nor GeoLite2-Country.mmdb is present in ApplicationFolder. FileNotFoundException at construction; it leaves _maxMind null and therefore causes errors 29 and 30 downstream.","triggerScenarios":"GeoCountryApp initialisation scans ApplicationFolder for the commercial then the free country database; if neither file exists it throws. Happens at app/server startup or reload.","commonSituations":"Same family as error 28: missing database on fresh install, container without baked-in .mmdb, renamed/moved file, or permissions issue.","solutions":["Download GeoLite2-Country.mmdb (or GeoIP2-Country.mmdb) from MaxMind.","Place it in the DNS server ApplicationFolder.","Restart the DnsServer process so the constructor succeeds."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string folder = dnsServer.ApplicationFolder;\nstring[] candidates = { Path.Combine(folder,\"GeoIP2-Country.mmdb\"), Path.Combine(folder,\"GeoLite2-Country.mmdb\") };\nif (!candidates.Any(File.Exists))\n    throw new ConfigValidationException(\"GeoCountryApp requires GeoIP2-Country.mmdb or GeoLite2-Country.mmdb in: \" + folder);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship GeoLite2-Country.mmdb with the deployment artefact.","Verify the file exists in a pre-start hook.","Automate periodic MaxMind database refresh."],"tags":["geo","maxmind","country","file-not-found","startup"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}