stride3d/stride · error · ContentStreamingException

Data chunk is not loaded.

Error message

Data chunk is not loaded.

What it means

Chunk.GetData(fileProvider) retrieves mip bytes from disk, and if chunk.IsLoaded is still false after that call the data is not available in memory (the load failed silently or was not awaited). StreamingTask requires the raw bytes to upload to the GPU, so it throws ContentStreamingException rather than reading a null/empty buffer.

Solutions

  1. Ensure the database file provider is mounted and the storage file exists before starting streaming (check Init order)
  2. Explicitly await/load the chunk data before streaming tasks run (call chunk.GetData/Load and verify IsLoaded)
  3. Add retry/backoff around streaming start on transient IO failures; re-trigger streaming after the provider is ready
  4. Check disk/file permissions and that antivirus or other processes aren't locking the content files

Example fix

// before
var data = chunk.GetData(fileProvider);
if (!chunk.IsLoaded) throw new ContentStreamingException("Data chunk is not loaded.", Storage);
// after
var data = chunk.GetData(fileProvider);
if (!chunk.IsLoaded)
{
    Log.Warning("Chunk not loaded; retrying streaming later");
    ScheduleStreamRetry(totalMipIndex);
    return;
}
Defensive patterns

Strategy: try-catch

Validate before calling

var chunk = storage.GetChunk(mipIndex);
var data = chunk?.GetData(fileProvider);
if (data == null || !chunk.IsLoaded)
    Logger.Warning("Chunk data unavailable; retry when provider is ready.");

Try / catch

try
{
    await StreamAsync(mipIndex);
}
catch (ContentStreamingException)
{
    Logger.Warning("Chunk not loaded; retrying with backoff");
    await Task.Delay(RetryDelay, ct);
    await StreamAsync(mipIndex);
}

Prevention

When it happens

Trigger: During StreamingTask, chunk.GetData(fileProvider) leaving chunk.IsLoaded == false: the underlying file could not be read by the IDatabaseFileProviderService (missing file, IO error), the provider is not yet initialized, or GetData was invoked on a chunk whose content URL cannot be resolved.

Common situations: Streaming starting before the database file provider finished mounting; file access errors (locked files, missing data files) during runtime streaming; background thread racing with asset loading.

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

Appendix: source

Thrown at sources/engine/Stride.Rendering/Streaming/StreamingTexture.cs:307

                var topMip = mipInfos[description.MipLevels - newDesc.MipLevelCount];
                newDesc.Width = topMip.Width;
                newDesc.Height = topMip.Height;

                // Load chunks
                var mipsData = new IntPtr[mipsCount];
                for (var mipIndex = 0; mipIndex < mipsCount; mipIndex++)
                {
                    var totalMipIndex = newHighestResidentMipIndex + mipIndex;
                    var chunk = Storage.GetChunk(totalMipIndex);
                    if (chunk == null)
                        throw new ContentStreamingException("Data chunk is missing.", Storage);

                    if (chunk.Size != mipInfos[totalMipIndex].TotalSize)
                        throw new ContentStreamingException("Data chunk has invalid size.", Storage);

                    var data = chunk.GetData(fileProvider);
                    if (!chunk.IsLoaded)
                        throw new ContentStreamingException("Data chunk is not loaded.", Storage);

                    if (cancellationToken.IsCancellationRequested)
                        return;

                    mipsData[mipIndex] = data;
                }

                // Get data boxes
                var dataBoxIndex = 0;
                var dataBoxes = new DataBox[newDesc.MipLevelCount * newDesc.ArraySize];
                for (var arrayIndex = 0; arrayIndex < newDesc.ArraySize; arrayIndex++)
                {
                    for (var mipIndex = 0; mipIndex < mipsCount; mipIndex++)
                    {
                        var totalMipIndex = newHighestResidentMipIndex + mipIndex;
                        var info = mipInfos[totalMipIndex];

                        dataBoxes[dataBoxIndex].DataPointer = mipsData[mipIndex] + info.SlicePitch * arrayIndex;

View on GitHub (pinned to 96fad776d2)