{"record":{"id":"38091e91abee2765","repo":"stride3d/stride","slug":"invald-contentstorageheader-version","errorCode":null,"errorMessage":"Invald ContentStorageHeader version.","messagePattern":"Invald ContentStorageHeader version\\.","errorType":"exception","errorClass":"SerializationException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Serialization/Streaming/ContentStorageHeader.cs","lineNumber":105,"sourceCode":"        var version = stream.ReadInt32();\n        if (version == 1)\n        {\n            result.InitialImage = stream.ReadBoolean();\n            result.DataUrl = stream.ReadString();\n            result.PackageTime = new DateTime(stream.ReadInt64());\n            int chunksCount = stream.ReadInt32();\n            result.Chunks = new ChunkEntry[chunksCount];\n            for (int i = 0; i < chunksCount; i++)\n            {\n                result.Chunks[i].Location = stream.ReadInt32();\n                result.Chunks[i].Size = stream.ReadInt32();\n            }\n            result.HashCode = stream.ReadInt32();\n\n            return;\n        }\n\n        throw new SerializationException($\"Invald {nameof(ContentStorageHeader)} version.\");\n    }\n}\n","sourceCodeStart":87,"sourceCodeEnd":108,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Serialization/Streaming/ContentStorageHeader.cs#L87-L108","documentation":"ContentStorageHeader.Read throws this when the version field in the header of an asset storage stream does not match any version the deserializer knows how to read. It guards against loading storage files written by incompatible (usually newer or corrupt) Stride versions. Note the message text contains a typo ('Invald') in some versions even though nameof is used elsewhere.","triggerScenarios":"Calling ContentStorageHeader.Read on a stream whose first bytes encode a version number outside the supported set of header versions.","commonSituations":"Opening a Stride package/asset storage file produced by a newer Stride editor; a truncated or corrupted storage file where garbage bytes are read as the version; mixing files between incompatible Stride releases.","solutions":["Regenerate or re-export the storage file with a Stride version compatible with the reading code.","Update the Stride.Core.Serialization package/runtime to a version that supports the file's header version.","Verify the file is not truncated or corrupted (compare file size/hash with the source)."],"exampleFix":"// before\nvar header = ContentStorageHeader.Read(stream); // throws on unknown version\n// after\nif (!ContentStorageHeader.TryRead(stream, out var header))\n    throw new InvalidOperationException(\"Unsupported or corrupt storage header\");","handlingStrategy":"validation","validationCode":"// check magic/version before parsing\nif (!stream.CanRead) throw new IOException(\"stream not readable\");\nvar start = stream.Position;\nif (!ContentStorageHeader.TryRead(stream, out var header))\n    throw new InvalidOperationException(\"Unsupported storage header version\");\nstream.Position = start;","typeGuard":null,"tryCatchPattern":"try { var h = ContentStorageHeader.Read(stream); }\ncatch (SerializationException ex) { /* unsupported version: regenerate file or upgrade runtime */ log.Error(ex); }","preventionTips":["Keep the reading runtime at the same or newer version than the tool that wrote the file","Validate file integrity (size/hash) before reading","Wrap storage reads in version-compatibility checks"],"tags":["serialization","versioning","file-format"],"backgroundTag":"schema-validation-failed","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}