stride3d/stride · error · ContentStreamingException

Missing content storage.

Error message

Missing content storage.

What it means

ImageTextureSerializer.DeserializeImage resolves texture data through a ContentStreamingService, which must yield a non-null content storage container via GetStorage. A null storage means the content URL/header could not be resolved against any registered storage, so a ContentStreamingException is thrown before reading image chunks.

Solutions

  1. Verify the content storage/database containing the texture is mounted on the ContentManager's file provider.
  2. Check that the asset's content URL matches an entry in the content database (rebuild the asset package).
  3. Ensure all referenced assets were compiled and shipped with the build (check .pkg bundles).
  4. Inspect the storage header for corruption and re-export the affected asset.

Example fix

// before
var provider = new VirtualFileProviderFactory(); // no database mounted
// after
var provider = new FileSystemProvider(String.Empty, ContentDirectory);
contentManager.FileProvider = provider; // storage resolvable before DeserializeImage
Defensive patterns

Strategy: try-catch

Validate before calling

// before deserialization, verify the content database is mounted
if (!contentManager.FileProvider.FileExists(url))
    throw new FileNotFoundException(url);

Type guard

bool HasStorage(object storage) => storage != null;

Try / catch

try { image = DeserializeImage(...); }
catch (ContentStreamingException ex) when (ex.Message == "Missing content storage.")
{
    // remount the content database / rebuild asset package, then retry
}

Prevention

When it happens

Trigger: Deserializing a texture asset whose content URL cannot be matched to a mounted content storage (missing/incorrect database/mount), or a corrupted content header (ContentContentHeader) with no matching storage container.

Common situations: Loading a game package where the raw asset files were not included in the build; a renamed or moved Assets/ content directory; mounting a database that does not contain the referenced texture.

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/d4a340d06752d670. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.Graphics/Data/ImageTextureSerializer.cs:60

            else
            {
                textureData.Save(stream.UnderlyingStream, ImageFileType.Stride);
            }
        }

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

        private static unsafe void DeserializeImage(ContentManager contentManager, Image obj, 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;

                // Calculate total size
                int size = 0;
                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;
                    Image.ComputePitch(format, mipWidth, mipHeight, out rowPitch, out slicePitch, out widthPacked, out heightPacked);

                    size += slicePitch;

View on GitHub (pinned to 96fad776d2)