{"record":{"id":"2e354a5bc504e8fe","repo":"stride3d/stride","slug":"data-chunk-is-missing","errorCode":null,"errorMessage":"Data chunk is missing.","messagePattern":"Data chunk is missing\\.","errorType":"exception","errorClass":"ContentStreamingException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Streaming/StreamingTexture.cs","lineNumber":300,"sourceCode":"            {\n                Storage.LockChunks();\n\n                // Setup texture description\n                TextureDescription newDesc = description;\n                var newHighestResidentMipIndex = TotalMipLevels - mipsCount;\n                newDesc.MipLevelCount = mipsCount;\n                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++)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Streaming/StreamingTexture.cs#L282-L318","documentation":"While streaming in higher-resolution mips, StreamingTask fetches each mip's data from a chunk in the asset's ContentStorage. GetChunk(totalMipIndex) returning null means the storage container does not contain a chunk for that mip index — the file's chunk table is missing the expected entry — so the streaming operation aborts with a ContentStreamingException.","triggerScenarios":"Storage.GetChunk(mipIndex) returning null during StreamingTask for a mip index derived from newHighestResidentMipIndex; assets whose stored mip count doesn't match the mipInfos the streamer derived (mismatched ImageDescription vs compiled data), truncated or partially copied .bin storage files, or assets compiled by a different version.","commonSituations":"Corrupted or incompletely copied game content; mixing compiled assets and headers from different builds; manually regenerated storage files that dropped mip chunks.","solutions":["Recompile the affected texture asset so all mip chunks exist and match mipInfos","Redeploy/re-copy the content storage files completely (don't partially copy .bin chunk files)","Ensure the ImageDescription used to register the texture matches the compiled asset's description (same mip count)","Clear the game's asset cache and rebuild content to remove stale storage files"],"exampleFix":"// before\nvar chunk = Storage.GetChunk(totalMipIndex); // null for some mip\n// after\nif (Storage.ChunkCount < mipInfos.Length)\n{\n    Log.Error(\"Storage missing mip chunks; falling back to full reload\");\n    await ReloadTextureAsync();\n    return;\n}","handlingStrategy":"try-catch","validationCode":"if (storage.ChunkCount < expectedMipCount)\n    Logger.Error(\"Storage missing mip chunks; recompile the asset.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await StreamAsync(mipIndex);\n}\ncatch (ContentStreamingException)\n{\n    Logger.Warning(\"Missing chunk; falling back to full texture reload\");\n    await ReloadTextureAsync();\n}","preventionTips":["Recompile assets whose mip chunks are missing","Deploy content files atomically (no partial copies)","Keep ImageDescription in sync with compiled storage"],"tags":["streaming","textures","corruption"],"backgroundTag":"resource-not-found","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"}