---
title: "Khắc phục lỗi Zip Format"
url: https://phatdev.net/docs/sl-migrations/how-to-resolve-zip-format-related-build-issues
lang: vi
updated: 2026-10-17
alternate:
  en: https://phatdev.net/en/docs/sl-migrations/how-to-resolve-zip-format-related-build-issues
markdown: https://phatdev.net/docs/sl-migrations/how-to-resolve-zip-format-related-build-issues.md
---

# Khắc phục lỗi Zip Format

Thuộc bộ tài liệu: [SL Migrations](https://phatdev.net/docs/sl-migrations.md)

> Archive lỗi format hoặc không extract được.

## Zip Format Build Issues

## Triệu chứng

- Build xong nhưng archive không giải nén được
- ZipArchive báo `Zip error: Read error (truncated content)`
- Verify archive fail

## Nguyên nhân và cách fix

### 1. Archive corrupt do disk full

Build bị cắt giữa chừng do disk hết space. So sánh kích thước archive với ước lượng scanner - nếu nhỏ hơn nhiều → bị cắt.

**Fix**: Giải phóng disk → build lại.

### 2. PHP ZipArchive limit kích thước

PHP ZipArchive native trên một số build có giới hạn 2-4 GB. Archive vượt giới hạn → corrupt.

**Fix**: Đổi engine sang **DupArchive** trong **Settings → Package → Archive Engine**. DupArchive hỗ trợ không giới hạn kích thước.

### 3. File path quá dài

Một số filesystem giới hạn độ dài path (thường 255 ký tự, một số cấu hình thấp hơn). Path dài hơn → archive entry sai.

**Fix**: Tìm và rename hoặc di chuyển file có path quá dài.

### 4. Tên file có ký tự non-UTF8

File có tên chứa ký tự không phải UTF-8 → archive entry bị corrupt khi giải nén trên hệ thống khác.

**Fix**: Đổi tên file về ASCII hoặc UTF-8 hợp lệ.

### 5. Filesystem case sensitivity

Build trên Linux (case-sensitive) → restore lên macOS hoặc Windows (case-insensitive) có thể collision: `Image.jpg` vs `image.jpg`.

**Fix**: Audit và rename các file duplicate trước khi backup.

## Verify archive sau khi build

Trong **SL Migrations → Packages**, click vào package vừa build → chọn **Verify**. Plugin sẽ check integrity của archive và báo cáo lỗi nếu có.

## Tham khảo

- [DAF file format](https://phatdev.net/docs/sl-migrations/how-to-work-with-daf-files-and-the-duparchive-extraction-tool)
- [Các engine zip](https://phatdev.net/docs/sl-migrations/how-to-work-with-the-different-zip-engines)
