stride3d/stride · error · ContentStreamingException

Missing content storage.

Error message

Missing content storage.

What it means

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.

Solutions

  1. Re-export/rebuild the asset so the header and storage container are consistent.
  2. Ensure the StorageHeader being passed was obtained from the same stream/asset being deserialized.
  3. Check for Stride version mismatches between the content build tool and the runtime deserializer.
  4. Validate the asset file is complete (not truncated at the storage section).
Defensive patterns

Strategy: validation

Validate before calling

var storage = content.GetStorage(ref storageHeader);
if (storage == null)
    throw new InvalidOperationException("No content storage registered for the given StorageHeader; header and stream are mismatched.");

Type guard

bool HeaderResolvable(ContentStreamingService svc, ref StorageHeader h) => svc.GetStorage(ref h) != null;

Try / catch

try { texture = DeserializeTexture(stream, context, ref storageHeader); }
catch (ContentStreamingException ex) when (ex.Message == "Missing content storage.")
{
    logger.LogError(ex, "Dangling storage header in asset");
    // fallback: rebuild/re-export asset or load placeholder
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/b135e5f96f71d158. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Graphics/Data/TextureContentSerializer.cs:147

                    throw new InvalidOperationException("Trying to serialize a Texture without CPU info.");

                textureData.Write(stream);
            }
        }

        public override object Construct(ContentSerializerContext context)
        {
            return new Texture();
        }

        private static void DeserializeTexture(ContentManager contentManager, Texture texture, ref ImageDescription imageDescription, ref ContentStorageHeader storageHeader)
        {
            using (var content = new ContentStreamingService())
            {
                // Get content storage container
                var storage = content.GetStorage(ref storageHeader);
                if (storage == null)
                    throw new ContentStreamingException("Missing content storage.");
                storage.LockChunks();

                // Cache data
                var fileProvider = contentManager.FileProvider;
                var format = imageDescription.Format;
                var dataBoxes = new DataBox[imageDescription.MipLevels * imageDescription.ArraySize];
                int dataBoxIndex = 0;

                // Get data boxes data
                for (int arrayIndex = 0; arrayIndex < imageDescription.ArraySize; arrayIndex++)
                {
                    for (int mipIndex = 0; mipIndex < imageDescription.MipLevels; mipIndex++)
                    {
                        var (mipWidth, mipHeight) = Image.GetMipDimensions(format, imageDescription.Width, imageDescription.Height, mipIndex);

                        int rowPitch, slicePitch;
                        int widthPacked;
                        int heightPacked;

View on GitHub (pinned to 96fad776d2)