stride3d/stride · error · ContentStreamingException

Data chunk is not loaded.

Error message

Data chunk is not loaded.

What it means

After fetching the mip-level chunk's data pointer via GetData, the serializer verifies chunk.IsLoaded. If the chunk's data is not actually resident in memory (GetData did not successfully load it from the underlying file provider), the load is aborted with this error. It means the content storage promised the chunk but the data could not be materialized from the file provider.

Solutions

  1. Verify the data files the file provider resolves actually exist and are readable at the path used at runtime.
  2. Check ContentManager/file provider setup (asset mounts, database file paths) matches where content was deployed.
  3. Rebuild/repackage content so chunk data files are regenerated and present.
  4. Check file permissions and that nothing (antivirus, cleaner) deletes asset data at runtime.
Defensive patterns

Strategy: try-catch

Validate before calling

var chunk = storage.GetChunk(mipIndex);
chunk?.GetData(fileProvider); // force load and surface IO errors early
bool loaded = chunk?.IsLoaded == true;

Type guard

bool IsChunkLoaded(StorageChunk chunk) => chunk?.IsLoaded == true;

Try / catch

try
{
    texture = DeserializeImage(stream, ...);
}
catch (ContentStreamingException ex)
{
    log.Error(ex, "Chunk data not loaded; check file provider and asset files");
    // re-deploy or rebuild content, or use fallback texture
}

Prevention

When it happens

Trigger: Calling DeserializeImage when storage.GetChunk(mipIndex).GetData(fileProvider) fails to load data (file provider cannot read/locate the underlying data stream), leaving IsLoaded false.

Common situations: Missing or unreadable asset data files on disk; file provider misconfigured (wrong mount/base path) in a packaged game; deleted intermediate content files; permission issues preventing the content loader from reading asset data.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


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

Appendix: source

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

                {
                    // Load image data to the buffer
                    var bufferPtr = buffer;
                    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;
                            Image.ComputePitch(format, mipWidth, mipHeight, out rowPitch, out slicePitch, out widthPacked, out heightPacked);
                            var chunk = storage.GetChunk(mipIndex);
                            if (chunk == null || chunk.Size != slicePitch * imageDescription.ArraySize)
                                throw new ContentStreamingException("Data chunk is missing or has invalid size.", storage);
                            var data = chunk.GetData(fileProvider);
                            if (!chunk.IsLoaded)
                                throw new ContentStreamingException("Data chunk is not loaded.", storage);

                            MemoryUtilities.CopyWithAlignmentFallback((void*)bufferPtr, (void*)data, (uint)chunk.Size);
                            bufferPtr += chunk.Size;
                        }
                    }

                    // Initialize image
                    var image = new Image(imageDescription, buffer, 0, null, true);
                    obj.InitializeFrom(image);
                }
                catch
                {
                    // Free memory in case of error
                    MemoryUtilities.Free(buffer);

                    throw;
                }

View on GitHub (pinned to 96fad776d2)