{"record":{"id":"d95cfe58e166aac6","repo":"tinyhumansai/openhuman","slug":"open-chat-db-failed-grant-full-disk-access-t","errorCode":null,"errorMessage":"open chat.db failed ({}). Grant Full Disk Access to OpenHuman: System Settings → Privacy & Security → Full Disk Access.","messagePattern":"open chat\\.db failed \\((.+?)\\)\\. Grant Full Disk Access to OpenHuman: System Settings → Privacy & Security → Full Disk Access\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src-tauri/src/imessage_scanner/chatdb.rs","lineNumber":48,"sourceCode":"    pub chat_name: Option<String>,\n    pub service: Option<String>,\n}\n\n/// Open chat.db read-only. Returns a friendly error hint if Full Disk\n/// Access is not granted (the typical failure mode on first run).\nfn open(db_path: &Path) -> rusqlite::Result<Connection> {\n    Connection::open_with_flags(\n        db_path,\n        OpenFlags::SQLITE_OPEN_READ_ONLY | OpenFlags::SQLITE_OPEN_PRIVATE_CACHE,\n    )\n}\n\n/// Read up to `limit` messages with `ROWID > since_rowid`, ordered by\n/// ROWID ascending. Joins across message / handle / chat_message_join /\n/// chat to produce one flat record per message.\npub fn read_since(db_path: &Path, since_rowid: i64, limit: usize) -> anyhow::Result<Vec<Message>> {\n    let conn = open(db_path).map_err(|e| {\n        anyhow::anyhow!(\n            \"open chat.db failed ({}). Grant Full Disk Access to OpenHuman: \\\n             System Settings → Privacy & Security → Full Disk Access.\",\n            e\n        )\n    })?;\n\n    let mut stmt = conn.prepare(\n        r#\"\n        SELECT\n          m.ROWID            AS rowid,\n          m.guid             AS guid,\n          m.text             AS text,\n          m.attributedBody   AS attributed_body,\n          m.date             AS date_ns,\n          m.is_from_me       AS is_from_me,\n          h.id               AS handle_id,\n          c.chat_identifier  AS chat_identifier,\n          c.display_name     AS chat_name,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src-tauri/src/imessage_scanner/chatdb.rs#L30-L66","documentation":"Opening the iMessage chat.db read-only failed; on macOS the typical cause is that the app lacks Full Disk Access, which SQLite needs to read the protected message database, so the error embeds the OS-level failure and the remediation hint.","triggerScenarios":"Thrown at app/src-tauri/src/imessage_scanner/chatdb.rs:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Grant Full Disk Access to OpenHuman in System Settings → Privacy & Security → Full Disk Access, then restart the app","Verify ~/Library/Messages/chat.db exists and is readable","Re-run the scan after granting permission"],"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-23T08:17:48.524Z"}