{
  "id": "database/sqlite-disk-io-error",
  "signature": "sqlite3.OperationalError: disk I/O error",
  "signature_zh": "sqlite3.OperationalError：磁盘 I/O 错误",
  "regex": "sqlite3\\.OperationalError: disk I/O error",
  "domain": "database",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "SQLite encounters an operating system-level input/output error while reading or writing the database file, typically due to filesystem corruption, disk failure, or insufficient permissions on the storage device.",
  "root_cause_type": "generic",
  "root_cause_zh": "SQLite 在读取或写入数据库文件时遇到操作系统级别的输入/输出错误，通常由文件系统损坏、磁盘故障或存储设备权限不足引起。",
  "versions": [
    {
      "version": "SQLite 3.39",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SQLite 3.40",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SQLite 3.43",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The underlying I/O issue persists; reopening will trigger the same error immediately.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "VACUUM requires a temporary file and may fail with the same I/O error if the disk is full or damaged.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "WAL mode still writes to disk; if the disk is faulty, the error will recur.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run fsck on the filesystem (e.g., sudo fsck /dev/sda1) or on Windows run chkdsk /f C:. This may fix underlying corruption.",
      "success_rate": 0.7,
      "how": "Run fsck on the filesystem (e.g., sudo fsck /dev/sda1) or on Windows run chkdsk /f C:. This may fix underlying corruption.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Copy the .db file to another disk: cp mydb.db /healthy_disk/mydb.db. Then run: sqlite3 /healthy_disk/mydb.db 'PRAGMA integrity_check;'. If it passes, use the copy.",
      "success_rate": 0.8,
      "how": "Copy the .db file to another disk: cp mydb.db /healthy_disk/mydb.db. Then run: sqlite3 /healthy_disk/mydb.db 'PRAGMA integrity_check;'. If it passes, use the copy.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run: sqlite3 corrupted.db '.dump' | sqlite3 new.db. This recreates the database from scratch, skipping corrupted pages if possible.",
      "success_rate": 0.75,
      "how": "Run: sqlite3 corrupted.db '.dump' | sqlite3 new.db. This recreates the database from scratch, skipping corrupted pages if possible.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run fsck on the filesystem (e.g., sudo fsck /dev/sda1) or on Windows run chkdsk /f C:. This may fix underlying corruption.",
    "Copy the .db file to another disk: cp mydb.db /healthy_disk/mydb.db. Then run: sqlite3 /healthy_disk/mydb.db 'PRAGMA integrity_check;'. If it passes, use the copy.",
    "Run: sqlite3 corrupted.db '.dump' | sqlite3 new.db. This recreates the database from scratch, skipping corrupted pages if possible."
  ],
  "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.87,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2023-04-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}