{
  "id": "database/sqlite-disk-i-o-error",
  "signature": "sqlite3.DatabaseError: disk I/O error",
  "signature_zh": "sqlite3.DatabaseError: 磁盘I/O错误",
  "regex": "disk I/O error",
  "domain": "database",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "SQLite encountered a filesystem-level read or write failure, often due to disk corruption, insufficient permissions, or a full filesystem.",
  "root_cause_type": "generic",
  "root_cause_zh": "SQLite遇到了文件系统级别的读取或写入失败，通常是由于磁盘损坏、权限不足或文件系统已满。",
  "versions": [
    {
      "version": "SQLite 3.40",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SQLite 3.41",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SQLite 3.42",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Python 3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Delete the database file and recreate it from scratch.",
      "why_fails": "This causes data loss and does not address the underlying disk issue; the new file may also get corrupted if the root cause persists.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the SQLite cache size to reduce disk writes.",
      "why_fails": "Cache size adjustments do not fix physical disk I/O errors; they only affect performance, not reliability.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check filesystem health using fsck (Linux) or chkdsk (Windows). Example: sudo fsck /dev/sda1 or chkdsk C: /f. Then attempt to recover the database using sqlite3 .recover.",
      "success_rate": 0.7,
      "how": "Check filesystem health using fsck (Linux) or chkdsk (Windows). Example: sudo fsck /dev/sda1 or chkdsk C: /f. Then attempt to recover the database using sqlite3 .recover.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the error is due to permissions, ensure the SQLite process has write access to the database file and its directory. Example: chmod 664 /path/to/database.db && chown www-data:www-data /path/to/database.db",
      "success_rate": 0.85,
      "how": "If the error is due to permissions, ensure the SQLite process has write access to the database file and its directory. Example: chmod 664 /path/to/database.db && chown www-data:www-data /path/to/database.db",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use SQLite's built-in integrity check and repair: sqlite3 database.db \"PRAGMA integrity_check;\" then backup and restore: sqlite3 database.db \".backup backup.db\"",
      "success_rate": 0.75,
      "how": "Use SQLite's built-in integrity check and repair: sqlite3 database.db \"PRAGMA integrity_check;\" then backup and restore: sqlite3 database.db \".backup backup.db\"",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check filesystem health using fsck (Linux) or chkdsk (Windows). Example: sudo fsck /dev/sda1 or chkdsk C: /f. Then attempt to recover the database using sqlite3 .recover.",
    "If the error is due to permissions, ensure the SQLite process has write access to the database file and its directory. Example: chmod 664 /path/to/database.db && chown www-data:www-data /path/to/database.db",
    "Use SQLite's built-in integrity check and repair: sqlite3 database.db \"PRAGMA integrity_check;\" then backup and restore: sqlite3 database.db \".backup backup.db\""
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.sqlite.org/rescode.html#ioerr",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}