{"record":{"id":"f6ab28f7328ac3c0","repo":"TechnitiumSoftware/DnsServer","slug":"genericrecordinfo-format-version-not-supported","errorCode":null,"errorMessage":"GenericRecordInfo format version not supported.","messagePattern":"GenericRecordInfo format version not supported\\.","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"critical","filePath":"DnsServerCore/Dns/ResourceRecords/GenericRecordInfo.cs","lineNumber":75,"sourceCode":"                case 1:\n                    _disabled = bR.ReadBoolean();\n                    _comments = bR.BaseStream.ReadShortString();\n\n                    ReadExtendedRecordInfoFrom(bR);\n                    break;\n\n                case 2:\n                    _disabled = bR.ReadBoolean();\n                    _comments = bR.BaseStream.ReadShortString();\n\n                    _lastModified = bR.BaseStream.ReadDateTime();\n                    _expiryTtl = bR.ReadUInt32();\n\n                    ReadExtendedRecordInfoFrom(bR);\n                    break;\n\n                default:\n                    throw new InvalidDataException(\"GenericRecordInfo format version not supported.\");\n            }\n        }\n\n        protected sealed override void WriteRecordInfoTo(BinaryWriter bW)\n        {\n            bW.Write((byte)2); //version\n\n            bW.Write(_disabled);\n\n            if (string.IsNullOrEmpty(_comments))\n                bW.Write((byte)0);\n            else\n                bW.BaseStream.WriteShortString(_comments);\n\n            bW.BaseStream.WriteDateTime(_lastModified);\n            bW.Write(_expiryTtl);\n\n            WriteExtendedRecordInfoTo(bW);","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Dns/ResourceRecords/GenericRecordInfo.cs#L57-L93","documentation":"Thrown by GenericRecordInfo.ReadRecordInfoFrom when the version byte is not 1 or 2. GenericRecordInfo is the base metadata for non-specialized authoritative records (disabled flag, comments, last-modified, expiry TTL). Version 2 is the current writer format; the default rejects anything else to avoid misinterpreting an incompatible or corrupt record.","triggerScenarios":"Deserializing a generic record whose version byte is outside {1,2}, typically from a file written by a newer server, a corrupt file, or a truncated stream where the version byte is wrong.","commonSituations":"Server downgrade across a GenericRecordInfo format bump; corrupt zone file after a crash; importing a zone exported by a much newer build.","solutions":["Restore the record/zone from a backup written by a compatible build.","Re-import the zone from a standard text zone file instead of the binary store so metadata is rebuilt fresh.","Upgrade the server to the version that wrote the file, then re-export if a downgrade is required."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { record.Load(); }\ncatch (InvalidDataException ex) when (ex.Message == \"GenericRecordInfo format version not supported.\")\n{ _log.Error(\"Record store incompatible; restore from backup or text import.\"); }","preventionTips":["Back up zones; binary record metadata is version-coupled to the writing build.","Export to text zone files before downgrading."],"tags":["serialization","generic-record","zone","version","deserialization"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}