{"record":{"id":"9cf642c1e9d79e71","repo":"TechnitiumSoftware/DnsServer","slug":"no-such-catalog-zone-was-found-catalogzonename","errorCode":null,"errorMessage":"No such Catalog zone was found: <catalogZoneName>","messagePattern":"No such Catalog zone was found: <catalogZoneName>","errorType":"exception","errorClass":"DnsServerException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs","lineNumber":1796,"sourceCode":"            {\n                case AuthZoneType.Primary:\n                case AuthZoneType.Secondary:\n                case AuthZoneType.Stub:\n                case AuthZoneType.Forwarder:\n                    if (!ignoreValidationErrors)\n                    {\n                        string currentCatalogZoneName = memberZoneInfo.ApexZone.CatalogZoneName;\n                        if (currentCatalogZoneName is not null)\n                            throw new DnsServerException(\"The zone '\" + memberZoneInfo.DisplayName + \"' is already a member of Catalog zone '\" + currentCatalogZoneName + \"'.\");\n                    }\n\n                    ApexZone apexZone = _root.GetApexZone(catalogZoneName);\n                    if (apexZone is not CatalogZone catalogZone)\n                    {\n                        if (ignoreValidationErrors)\n                            return;\n\n                        throw new DnsServerException(\"No such Catalog zone was found: \" + catalogZoneName);\n                    }\n\n                    //set catalog zone name in member zone so that properties can be set below correctly\n                    memberZoneInfo.ApexZone.CatalogZoneName = catalogZone.Name;\n\n                    if (!memberZoneInfo.Disabled)\n                    {\n                        catalogZone.AddMemberZone(memberZoneInfo.Name, memberZoneInfo.Type);\n\n                        //update properties in catalog zone by settings member zone property values again\n                        switch (memberZoneInfo.Type)\n                        {\n                            case AuthZoneType.Primary:\n                                memberZoneInfo.QueryAccess = memberZoneInfo.QueryAccess;\n                                memberZoneInfo.ZoneTransfer = memberZoneInfo.ZoneTransfer;\n                                memberZoneInfo.ZoneTransferTsigKeyNames = memberZoneInfo.ZoneTransferTsigKeyNames;\n                                break;\n","sourceCodeStart":1778,"sourceCodeEnd":1814,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs#L1778-L1814","documentation":"Thrown by AddCatalogMemberZone when the named catalog zone does not exist or is not a CatalogZone. _root.GetApexZone(catalogZoneName) returns an ApexZone that fails the 'is CatalogZone' pattern match; with validation enabled the method throws naming the missing catalog.","triggerScenarios":"Calling AddCatalogMemberZone(catalogZoneName, memberZoneInfo) where catalogZoneName is misspelled, deleted, or refers to a non-Catalog zone (Primary/Secondary/Stub/Forwarder). The check at line 1791 fails and line 1796 throws.","commonSituations":"Typo in the catalog zone name. Referencing a catalog that was deleted. Passing a regular zone name when a Catalog zone is required. Race between catalog deletion and member add.","solutions":["Verify the catalog zone exists and is of type Catalog via GetAuthZoneInfo(catalogZoneName) before adding members.","Normalize/trim the catalog name and re-resolve.","Refresh the catalog list to confirm it is still present.","Catch DnsServerException and report 'catalog not found' to the caller."],"exampleFix":"// before\nmanager.AddCatalogMemberZone(catalogName, memberZone); // throws if catalog missing\n\n// after\nvar cat = manager.GetAuthZoneInfo(catalogName);\nif (cat is null || cat.Type != AuthZoneType.Catalog)\n    return NotFound($\"Catalog zone '{catalogName}' not found.\");\nmanager.AddCatalogMemberZone(catalogName, memberZone);","handlingStrategy":"validation","validationCode":"var cat = manager.GetAuthZoneInfo(catalogZoneName);\nif (cat is null || cat.Type != AuthZoneType.Catalog)\n    return NotFound($\"Catalog zone '{catalogZoneName}' not found.\");","typeGuard":"static bool IsCatalog(AuthZoneInfo z) => z?.Type == AuthZoneType.Catalog;","tryCatchPattern":"catch (DnsServerException ex) when (ex.Message.StartsWith(\"No such Catalog zone\")) { return NotFound(ex.Message); }","preventionTips":["Resolve and type-check the catalog zone before adding members.","Normalize the catalog name before lookup.","Refresh the catalog list before membership operations."],"tags":["dns","catalog-zone","membership","not-found","input-validation"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}