{"record":{"id":"56ab2ccf88580e8a","repo":"stride3d/stride","slug":"data-chunk-is-not-loaded-streamingtexture","errorCode":null,"errorMessage":"Data chunk is not loaded.","messagePattern":"Data chunk is not loaded\\.","errorType":"exception","errorClass":"ContentStreamingException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Streaming/StreamingTexture.cs","lineNumber":307,"sourceCode":"                var topMip = mipInfos[description.MipLevels - newDesc.MipLevelCount];\n                newDesc.Width = topMip.Width;\n                newDesc.Height = topMip.Height;\n\n                // Load chunks\n                var mipsData = new IntPtr[mipsCount];\n                for (var mipIndex = 0; mipIndex < mipsCount; mipIndex++)\n                {\n                    var totalMipIndex = newHighestResidentMipIndex + mipIndex;\n                    var chunk = Storage.GetChunk(totalMipIndex);\n                    if (chunk == null)\n                        throw new ContentStreamingException(\"Data chunk is missing.\", Storage);\n\n                    if (chunk.Size != mipInfos[totalMipIndex].TotalSize)\n                        throw new ContentStreamingException(\"Data chunk has invalid size.\", Storage);\n\n                    var data = chunk.GetData(fileProvider);\n                    if (!chunk.IsLoaded)\n                        throw new ContentStreamingException(\"Data chunk is not loaded.\", Storage);\n\n                    if (cancellationToken.IsCancellationRequested)\n                        return;\n\n                    mipsData[mipIndex] = data;\n                }\n\n                // Get data boxes\n                var dataBoxIndex = 0;\n                var dataBoxes = new DataBox[newDesc.MipLevelCount * newDesc.ArraySize];\n                for (var arrayIndex = 0; arrayIndex < newDesc.ArraySize; arrayIndex++)\n                {\n                    for (var mipIndex = 0; mipIndex < mipsCount; mipIndex++)\n                    {\n                        var totalMipIndex = newHighestResidentMipIndex + mipIndex;\n                        var info = mipInfos[totalMipIndex];\n\n                        dataBoxes[dataBoxIndex].DataPointer = mipsData[mipIndex] + info.SlicePitch * arrayIndex;","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Streaming/StreamingTexture.cs#L289-L325","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the database file provider is mounted and the storage file exists before starting streaming (check Init order)","Explicitly await/load the chunk data before streaming tasks run (call chunk.GetData/Load and verify IsLoaded)","Add retry/backoff around streaming start on transient IO failures; re-trigger streaming after the provider is ready","Check disk/file permissions and that antivirus or other processes aren't locking the content files"],"exampleFix":"// before\nvar data = chunk.GetData(fileProvider);\nif (!chunk.IsLoaded) throw new ContentStreamingException(\"Data chunk is not loaded.\", Storage);\n// after\nvar data = chunk.GetData(fileProvider);\nif (!chunk.IsLoaded)\n{\n    Log.Warning(\"Chunk not loaded; retrying streaming later\");\n    ScheduleStreamRetry(totalMipIndex);\n    return;\n}","handlingStrategy":"try-catch","validationCode":"var chunk = storage.GetChunk(mipIndex);\nvar data = chunk?.GetData(fileProvider);\nif (data == null || !chunk.IsLoaded)\n    Logger.Warning(\"Chunk data unavailable; retry when provider is ready.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await StreamAsync(mipIndex);\n}\ncatch (ContentStreamingException)\n{\n    Logger.Warning(\"Chunk not loaded; retrying with backoff\");\n    await Task.Delay(RetryDelay, ct);\n    await StreamAsync(mipIndex);\n}","preventionTips":["Mount the database file provider before streaming starts","Verify chunk.IsLoaded before GPU upload","Watch for IO/permission issues locking content files"],"tags":["streaming","textures","file-io"],"backgroundTag":"file-read-failed","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"}