{"record":{"id":"e424563f29d6c3cc","repo":"EllanJiang/GameFramework","slug":"load-binary-0-from-file-system-with-internal-error","errorCode":null,"errorMessage":"Load binary '{0}' from file system with internal error.","messagePattern":"Load binary '(.+?)' from file system with internal error\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Base/DataProvider/DataProvider.cs","lineNumber":211,"sourceCode":"\n            HasAssetResult result = m_ResourceManager.HasAsset(dataAssetName);\n            switch (result)\n            {\n                case HasAssetResult.AssetOnDisk:\n                case HasAssetResult.AssetOnFileSystem:\n                    m_ResourceManager.LoadAsset(dataAssetName, priority, m_LoadAssetCallbacks, userData);\n                    break;\n\n                case HasAssetResult.BinaryOnDisk:\n                    m_ResourceManager.LoadBinary(dataAssetName, m_LoadBinaryCallbacks, userData);\n                    break;\n\n                case HasAssetResult.BinaryOnFileSystem:\n                    int dataLength = m_ResourceManager.GetBinaryLength(dataAssetName);\n                    EnsureCachedBytesSize(dataLength);\n                    if (dataLength != m_ResourceManager.LoadBinaryFromFileSystem(dataAssetName, s_CachedBytes))\n                    {\n                        throw new GameFrameworkException(Utility.Text.Format(\"Load binary '{0}' from file system with internal error.\", dataAssetName));\n                    }\n\n                    try\n                    {\n                        if (!m_DataProviderHelper.ReadData(m_Owner, dataAssetName, s_CachedBytes, 0, dataLength, userData))\n                        {\n                            throw new GameFrameworkException(Utility.Text.Format(\"Load data failure in data provider helper, data asset name '{0}'.\", dataAssetName));\n                        }\n\n                        if (m_ReadDataSuccessEventHandler != null)\n                        {\n                            ReadDataSuccessEventArgs loadDataSuccessEventArgs = ReadDataSuccessEventArgs.Create(dataAssetName, 0f, userData);\n                            m_ReadDataSuccessEventHandler(this, loadDataSuccessEventArgs);\n                            ReferencePool.Release(loadDataSuccessEventArgs);\n                        }\n                    }\n                    catch (Exception exception)\n                    {","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Base/DataProvider/DataProvider.cs#L193-L229","documentation":"After reading binary data from a file system, ReadData compares the requested data length with the number of bytes LoadBinaryFromFileSystem actually wrote into the shared cache buffer. A mismatch means the resource subsystem returned fewer (or more) bytes than its own reported length — an internal consistency failure, so the provider throws this internal-error exception.","triggerScenarios":"m_ResourceManager.GetBinaryLength(dataAssetName) returns N, but LoadBinaryFromFileSystem(dataAssetName, s_CachedBytes) writes a different byte count — e.g. the file system entry was modified between the two calls, or the resource package is corrupted/partially downloaded.","commonSituations":"Interrupted resource download or unpack leaving a truncated binary; mixing resource versions where the length index and file system contents disagree; editing assets in the built file system manually.","solutions":["Delete local cached/variant resources and re-download the full resource package.","Verify resource package integrity (rebuild with the resource editor tool so length metadata matches contents).","Ensure no concurrent ReadData calls are corrupting shared state during loading."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { dataProvider.ReadData(name, 0, null); }\ncatch (GameFrameworkException e) when (e.Message.StartsWith(\"Load binary\")) { Log.Error(\"Corrupt binary resource '{0}' — re-download package.\", name); ResourceComponent.ForceRecheckResources(); }","preventionTips":["Use checksummed, complete resource downloads.","Rebuild resource packages when metadata and binaries could drift.","Avoid concurrent reads that share the static byte cache."],"tags":["resource-loading","internal-error","corruption"],"backgroundTag":"internal-invariant-violation","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}