{"record":{"id":"f58066f5d1953623","repo":"bevyengine/bevy","slug":"failed-to-read-bytes-from-an-asset-path-0","errorCode":null,"errorMessage":"failed to read bytes from an asset path: {0}","messagePattern":"failed to read bytes from an asset path: (.+?)","errorType":"exception","errorClass":"GltfError","httpStatus":null,"severity":"error","filePath":"crates/bevy_gltf/src/loader/mod.rs","lineNumber":118,"sourceCode":"    Base64Decode(#[from] base64::DecodeError),\n    /// Unsupported buffer format.\n    #[error(\"unsupported buffer format\")]\n    BufferFormatUnsupported,\n    /// The buffer URI was unable to be resolved with respect to the asset path.\n    #[error(\"invalid buffer uri: {0}. asset path error={1}\")]\n    InvalidBufferUri(String, ParseAssetPathError),\n    /// Invalid image mime type.\n    #[error(\"invalid image mime type: {0}\")]\n    #[from(ignore)]\n    InvalidImageMimeType(String),\n    /// Error when loading a texture. Might be due to a disabled image file format feature.\n    #[error(\"You may need to add the feature for the file format: {0}\")]\n    ImageError(#[from] TextureError),\n    /// The image URI was unable to be resolved with respect to the asset path.\n    #[error(\"invalid image uri: {0}. asset path error={1}\")]\n    InvalidImageUri(String, ParseAssetPathError),\n    /// Failed to read bytes from an asset path.\n    #[error(\"failed to read bytes from an asset path: {0}\")]\n    ReadAssetBytesError(#[from] ReadAssetBytesError),\n    /// Failed to load asset from an asset path.\n    #[error(\"failed to load asset from an asset path: {0}\")]\n    AssetLoadError(#[from] AssetLoadError),\n    /// Missing sampler for an animation.\n    #[error(\"Missing sampler for animation {0}\")]\n    #[from(ignore)]\n    MissingAnimationSampler(usize),\n    /// Failed to generate tangents.\n    #[error(\"failed to generate tangents: {0}\")]\n    GenerateTangentsError(#[from] bevy_mesh::GenerateTangentsError),\n    /// Failed to generate morph targets.\n    #[error(\"failed to generate morph targets: {0}\")]\n    MorphTarget(#[from] bevy_mesh::morph::MorphBuildError),\n    /// Circular children in Nodes\n    #[error(\"GLTF model must be a tree, found cycle instead at node indices: {0:?}\")]\n    #[from(ignore)]\n    CircularChildren(String),","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_gltf/src/loader/mod.rs#L100-L136","documentation":"GltfError::ReadAssetBytesError (#[from] ReadAssetBytesError) comes from load_context.read_asset_bytes(buffer_path) at loader/mod.rs:1948: the external .bin (or other embedded byte asset) resolved fine but could not be read from the asset source — missing file, permission failure, or an AssetSource that cannot serve that embedded path.","triggerScenarios":"Buffer uri says \"scene.bin\" but only model.gltf was copied into assets/; case-sensitivity mismatch (Scene.bin vs scene.bin on Linux); file locked or unreadable; a custom AssetSource/processor configuration that does not expose companion files.","commonSituations":"Copying models out of their export folder, zip extractions that flatten directories, deploying to case-sensitive servers, missing files in CI bundles.","solutions":["Ship the whole export folder: .gltf plus .bin and textures as siblings.","Check exact filename casing against the uri in the JSON.","Verify the file is inside a registered asset folder and readable by the app.","Switch to single-file GLB to remove external dependencies."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn external_bins_exist(model: &std::path::Path, json: &serde_json::Value) -> bool {\n    let dir = model.parent().unwrap();\n    json[\"buffers\"].as_array().unwrap_or(&vec![]).iter()\n        .filter_map(|b| b[\"uri\"].as_str())\n        .filter(|u| !u.starts_with(\"data:\"))\n        .all(|u| dir.join(u).exists())\n}","typeGuard":null,"tryCatchPattern":"match err {\n    GltfError::ReadAssetBytesError(e) => {\n        error!(\"could not read companion file: {e}; check casing and folder contents\");\n    }\n    other => return Err(other.into()),\n}","preventionTips":["Copy whole export folders, never single files.","Double-check filename casing on case-sensitive filesystems.","Use GLB when shipping single assets."],"tags":["gltf","asset-io","buffer","bevy"],"backgroundTag":"asset-read-failed","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}