{"record":{"id":"b135e5f96f71d158","repo":"stride3d/stride","slug":"missing-content-storage-texturecontentserializer","errorCode":null,"errorMessage":"Missing content storage.","messagePattern":"Missing content storage\\.","errorType":"exception","errorClass":"ContentStreamingException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Data/TextureContentSerializer.cs","lineNumber":147,"sourceCode":"                    throw new InvalidOperationException(\"Trying to serialize a Texture without CPU info.\");\n\n                textureData.Write(stream);\n            }\n        }\n\n        public override object Construct(ContentSerializerContext context)\n        {\n            return new Texture();\n        }\n\n        private static void DeserializeTexture(ContentManager contentManager, Texture texture, ref ImageDescription imageDescription, ref ContentStorageHeader storageHeader)\n        {\n            using (var content = new ContentStreamingService())\n            {\n                // Get content storage container\n                var storage = content.GetStorage(ref storageHeader);\n                if (storage == null)\n                    throw new ContentStreamingException(\"Missing content storage.\");\n                storage.LockChunks();\n\n                // Cache data\n                var fileProvider = contentManager.FileProvider;\n                var format = imageDescription.Format;\n                var dataBoxes = new DataBox[imageDescription.MipLevels * imageDescription.ArraySize];\n                int dataBoxIndex = 0;\n\n                // Get data boxes data\n                for (int arrayIndex = 0; arrayIndex < imageDescription.ArraySize; arrayIndex++)\n                {\n                    for (int mipIndex = 0; mipIndex < imageDescription.MipLevels; mipIndex++)\n                    {\n                        var (mipWidth, mipHeight) = Image.GetMipDimensions(format, imageDescription.Width, imageDescription.Height, mipIndex);\n\n                        int rowPitch, slicePitch;\n                        int widthPacked;\n                        int heightPacked;","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Data/TextureContentSerializer.cs#L129-L165","documentation":"When deserializing a texture, the ContentStreamingService must resolve the storage container referenced by the StorageHeader via content.GetStorage. If it returns null there is no matching content storage registered, so DeserializeTexture aborts with this ContentStreamingException. The header is effectively dangling — it points to storage that the service does not know about.","triggerScenarios":"Calling DeserializeTexture with a StorageHeader that was not registered with the ContentStreamingService, or a header that references a storage absent from the stream/file being read.","commonSituations":"Mismatched header/data produced by a different content build; reading an asset written by a newer Stride version; passing a default/uninitialized StorageHeader; partial file where the storage section is missing.","solutions":["Re-export/rebuild the asset so the header and storage container are consistent.","Ensure the StorageHeader being passed was obtained from the same stream/asset being deserialized.","Check for Stride version mismatches between the content build tool and the runtime deserializer.","Validate the asset file is complete (not truncated at the storage section)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var storage = content.GetStorage(ref storageHeader);\nif (storage == null)\n    throw new InvalidOperationException(\"No content storage registered for the given StorageHeader; header and stream are mismatched.\");","typeGuard":"bool HeaderResolvable(ContentStreamingService svc, ref StorageHeader h) => svc.GetStorage(ref h) != null;","tryCatchPattern":"try { texture = DeserializeTexture(stream, context, ref storageHeader); }\ncatch (ContentStreamingException ex) when (ex.Message == \"Missing content storage.\")\n{\n    logger.LogError(ex, \"Dangling storage header in asset\");\n    // fallback: rebuild/re-export asset or load placeholder\n}","preventionTips":["Always read the StorageHeader from the same stream being deserialized","Re-export assets after content-format version changes","Detect truncated files (missing storage section) before deserialization","Keep writer and reader Stride versions aligned"],"tags":["content-pipeline","textures","serialization","stride"],"backgroundTag":"resource-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}