{"record":{"id":"6e4ab6ce3a7f5231","repo":"tinyhumansai/openhuman","slug":"failed-to-read-file-metadata-e","errorCode":null,"errorMessage":"Failed to read file metadata: {e}","messagePattern":"Failed to read file metadata: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/browser/image_info.rs","lineNumber":166,"sourceCode":"        let path_str = args\n            .get(\"path\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing 'path' parameter\"))?;\n\n        let include_base64 = args\n            .get(\"include_base64\")\n            .and_then(serde_json::Value::as_bool)\n            .unwrap_or(false);\n\n        // Security check: validate path string, resolve symlinks, confirm workspace containment.\n        let resolved = match self.security.validate_path(path_str).await {\n            Ok(p) => p,\n            Err(msg) => return Ok(ToolResult::error(msg)),\n        };\n\n        let metadata = tokio::fs::metadata(&resolved)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to read file metadata: {e}\"))?;\n\n        let file_size = metadata.len();\n\n        if file_size > MAX_IMAGE_BYTES {\n            return Ok(ToolResult::error(format!(\n                \"Image too large: {file_size} bytes (max {MAX_IMAGE_BYTES} bytes)\"\n            )));\n        }\n\n        let bytes = tokio::fs::read(&resolved)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to read image file: {e}\"))?;\n\n        let format = Self::detect_format(&bytes);\n        let dimensions = Self::extract_dimensions(&bytes, format);\n\n        let mut output = format!(\"File: {path_str}\\nFormat: {format}\\nSize: {file_size} bytes\");\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/browser/image_info.rs#L148-L184","documentation":"Wrapped IO error in image_info: tokio::fs::metadata failed on the resolved path after security validation passed. {e} is the OS error — most commonly NotFound (bad path/typo) or PermissionDenied on the file.","triggerScenarios":"Thrown at src/openhuman/tools/impl/browser/image_info.rs:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the resolved path exists on disk","Check file permissions for the running process","Read {e} for the specific OS error code"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}