tinyhumansai/openhuman · error · anyhow::Error
Failed to read file metadata: {e}
Error message
Failed to read file metadata: {e} What it means
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.
Source
Thrown at src/openhuman/tools/impl/browser/image_info.rs:166
let path_str = args
.get("path")
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("Missing 'path' parameter"))?;
let include_base64 = args
.get("include_base64")
.and_then(serde_json::Value::as_bool)
.unwrap_or(false);
// Security check: validate path string, resolve symlinks, confirm workspace containment.
let resolved = match self.security.validate_path(path_str).await {
Ok(p) => p,
Err(msg) => return Ok(ToolResult::error(msg)),
};
let metadata = tokio::fs::metadata(&resolved)
.await
.map_err(|e| anyhow::anyhow!("Failed to read file metadata: {e}"))?;
let file_size = metadata.len();
if file_size > MAX_IMAGE_BYTES {
return Ok(ToolResult::error(format!(
"Image too large: {file_size} bytes (max {MAX_IMAGE_BYTES} bytes)"
)));
}
let bytes = tokio::fs::read(&resolved)
.await
.map_err(|e| anyhow::anyhow!("Failed to read image file: {e}"))?;
let format = Self::detect_format(&bytes);
let dimensions = Self::extract_dimensions(&bytes, format);
let mut output = format!("File: {path_str}\nFormat: {format}\nSize: {file_size} bytes");
View on GitHub (pinned to 7491200858)
Solutions
- Verify the resolved path exists on disk
- Check file permissions for the running process
- Read {e} for the specific OS error code
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/openhuman/tools/impl/browser/image_info.rs:166 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17).
Data as JSON: /api/errors/6e4ab6ce3a7f5231.
Report an issue: GitHub.