{"record":{"id":"15173f9daf691409","repo":"TechnitiumSoftware/DnsServer","slug":"dns-server-auth-config-version-not-supported","errorCode":null,"errorMessage":"DNS Server auth config version not supported.","messagePattern":"DNS Server auth config version not supported\\.","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"critical","filePath":"DnsServerCore/Auth/AuthManager.cs","lineNumber":552,"sourceCode":"\n                                    ssoGroupMap.TryAdd(key, value);\n                                }\n\n                                _ssoGroupMap = ssoGroupMap;\n                            }\n                            else\n                            {\n                                _ssoGroupMap = null;\n                            }\n                        }\n\n                        restartWebService = !ssoIsStillDisabled && restartWebService;\n                    }\n\n                    break;\n\n                default:\n                    throw new InvalidDataException(\"DNS Server auth config version not supported.\");\n            }\n\n            _groups = groups;\n            _users = users;\n\n            if (isConfigTransfer)\n            {\n                //sync only required permissions from newly loaded config\n                foreach (KeyValuePair<PermissionSection, Permission> permission in permissions)\n                {\n                    switch (permission.Key)\n                    {\n                        case PermissionSection.Zones:\n                            //sync user and group permissions as-is for zones section\n                            Permission zonesPermission = _permissions[PermissionSection.Zones];\n\n                            zonesPermission.SyncPermissions(permission.Value.UserPermissions);\n                            zonesPermission.SyncPermissions(permission.Value.GroupPermissions);","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Auth/AuthManager.cs#L534-L570","documentation":"Thrown as InvalidDataException when the version byte read immediately after the \"AS\" magic is not 1, 2, or 3. The current server writes version 3; the loader only understands those three versions. This guards against loading a config written by a newer server build or a file whose version byte is garbage.","triggerScenarios":"Loading an auth.config whose version byte is >= 4 (written by a newer server release) or a corrupt/0/garbage version byte. Happens on downgrade, on loading a transferred config from a newer node, or after binary corruption of the version field.","commonSituations":"Downgrading the DNS Server across a release that bumped the auth config schema; restoring a config backup taken on a newer version onto an older server; partial write leaving the version byte wrong; cluster sync pulling a newer-format config into an older node.","solutions":["Run the same (or newer) DNS Server version that wrote the config, then let it migrate the file forward.","Delete auth.config to start fresh with default credentials if migration is not required.","Re-take the backup/transfer from a node running the same version as the target.","Inspect the third byte of auth.config to confirm the version and decide on upgrade vs. reset."],"exampleFix":"// before: loading a v4 config on a v3-only server -> InvalidDataException\n// after: upgrade the server to match the config writer, or reset\n//   byte[] b = File.ReadAllBytes(authConfigPath);\n//   int version = b[2]; // 3rd byte after 'A','S'\n// if (version > 3) { UpgradeServer(); }","handlingStrategy":"validation","validationCode":"byte[] b = File.ReadAllBytes(authConfigPath);\nint version = b.Length > 2 ? b[2] : -1;\nif (version is < 1 or > 3)\n    throw new InvalidOperationException($\"Unsupported auth config version {version}; upgrade or reset the config.\");","typeGuard":"bool IsSupportedAuthConfigVersion(int v) => v is 1 or 2 or 3;","tryCatchPattern":"try { StartServer(); }\ncatch (InvalidDataException ex) when (ex.Message.Contains(\"auth config version not supported\"))\n{\n    UpgradeServerToMatchConfig(); // or delete auth.config to reset\n}","preventionTips":["Run the same or newer server version that wrote the config before loading it.","Do not restore a config backup taken on a newer server onto an older build.","Inspect the version byte (3rd byte) when moving configs between nodes."],"tags":["config","startup","versioning","auth"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}