{"record":{"id":"f54a641fdf1e209c","repo":"tinyhumansai/openhuman","slug":"failed-to-read-e","errorCode":null,"errorMessage":"failed to read '{}': {e}","messagePattern":"failed to read '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tree/tree_runtime/cli.rs","lineNumber":138,"sourceCode":"        println!(\"  -v, --verbose        Enable debug logging\");\n        println!();\n        println!(\"Either --content or --file is required. If both are given, --file wins.\");\n        return Ok(());\n    }\n\n    let namespace = &rest[0];\n\n    let content = if let Some(ref path) = opts.file {\n        if path == \"-\" {\n            use std::io::Read;\n            let mut buf = String::new();\n            std::io::stdin()\n                .read_to_string(&mut buf)\n                .map_err(|e| anyhow::anyhow!(\"failed to read stdin: {e}\"))?;\n            buf\n        } else {\n            std::fs::read_to_string(path)\n                .map_err(|e| anyhow::anyhow!(\"failed to read '{}': {e}\", path))?\n        }\n    } else if let Some(ref text) = opts.content {\n        text.clone()\n    } else {\n        return Err(anyhow::anyhow!(\n            \"either --content or --file is required. Run `openhuman tree-summarizer ingest --help`.\"\n        ));\n    };\n\n    if content.trim().is_empty() {\n        return Err(anyhow::anyhow!(\"content is empty\"));\n    }\n\n    init_logging(opts.verbose);\n\n    let rt = build_runtime()?;\n    rt.block_on(async {\n        let config = load_config().await?;","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tree/tree_runtime/cli.rs#L120-L156","documentation":"`std::fs::read_to_string` failed on the file path given via `--file`. This is a filesystem-level failure: the path does not exist, is a directory rather than a file, lacks read permissions, or the file contents are not valid UTF-8. The offending path is interpolated into the message so the user can immediately see which file failed.","triggerScenarios":"Thrown at src/openhuman/memory/tree/tree_runtime/cli.rs:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path exists and is readable: `ls -la <path>`","Pass an absolute path to avoid working-directory ambiguity","If the file is not UTF-8 text (e.g. a binary or non-UTF-8 encoding), convert or re-save it as UTF-8 first","Use `--content \"...\"` directly for short inline text instead of a file"],"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-14T00:17:10.932Z"}