{
  "id": "php/zip-archive-corrupt-archive",
  "signature": "ZipArchive::extractTo(): Failed to extract zip archive '/tmp/upload_abc123.zip': ZipArchive::ER_CRC error in /var/www/app/src/Import/ZipImporter.php on line 42",
  "signature_zh": "ZipArchive::extractTo()：无法解压 zip 存档 '/tmp/upload_abc123.zip'：ZipArchive::ER_CRC 错误，位于 /var/www/app/src/Import/ZipImporter.php 第 42 行",
  "regex": "/ZipArchive::extractTo\\(\\): Failed to extract zip archive.*ZipArchive::ER_CRC error/",
  "domain": "php",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The ZIP archive is corrupt or incomplete, often due to a failed upload, truncated download, or disk write error, causing CRC checksum mismatches during extraction.",
  "root_cause_type": "generic",
  "root_cause_zh": "ZIP 存档损坏或不完整，通常由上传失败、下载中断或磁盘写入错误引起，导致解压时 CRC 校验和不匹配。",
  "versions": [
    {
      "version": "7.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "CRC errors are data integrity issues, not resource limits. Increasing limits won't fix corrupted data.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the source file is corrupt on disk, re-uploading the same file yields the same CRC error.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Validate the ZIP file integrity before extraction using ZipArchive::open() with ZipArchive::CHECKCONS: $zip = new ZipArchive(); if ($zip->open($file, ZipArchive::CHECKCONS) !== true) { throw new Exception('Corrupt archive'); }",
      "success_rate": 0.85,
      "how": "Validate the ZIP file integrity before extraction using ZipArchive::open() with ZipArchive::CHECKCONS: $zip = new ZipArchive(); if ($zip->open($file, ZipArchive::CHECKCONS) !== true) { throw new Exception('Corrupt archive'); }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Re-download or re-upload the ZIP file from the source, ensuring a complete transfer. Use checksums (e.g., MD5) to verify integrity.",
      "success_rate": 0.9,
      "how": "Re-download or re-upload the ZIP file from the source, ensuring a complete transfer. Use checksums (e.g., MD5) to verify integrity.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a command-line tool like 'unzip -t archive.zip' to test the archive, then repair with 'zip -F archive.zip --out fixed.zip' if possible.",
      "success_rate": 0.7,
      "how": "Use a command-line tool like 'unzip -t archive.zip' to test the archive, then repair with 'zip -F archive.zip --out fixed.zip' if possible.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Validate the ZIP file integrity before extraction using ZipArchive::open() with ZipArchive::CHECKCONS: $zip = new ZipArchive(); if ($zip->open($file, ZipArchive::CHECKCONS) !== true) { throw new Exception('Corrupt archive'); }",
    "Re-download or re-upload the ZIP file from the source, ensuring a complete transfer. Use checksums (e.g., MD5) to verify integrity.",
    "Use a command-line tool like 'unzip -t archive.zip' to test the archive, then repair with 'zip -F archive.zip --out fixed.zip' if possible."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.php.net/manual/en/ziparchive.extractto.php",
  "official_doc_section": null,
  "error_code": "ZipArchive::ER_CRC",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.7,
  "resolvable": "partial",
  "first_seen": "2025-02-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}