본문 바로가기
ETC/에러 모음

extra bytes at beginning or within zipfile error 해결법

by Guardy 2023. 11. 21.
728x90

warning [/content/drive/MyDrive/Colab Notebooks/open.zip]: 8484413941 extra bytes at beginning or within zipfile (attempting to process anyway) error [/content/drive/MyDrive/Colab Notebooks/open.zip]: start of central directory not found; zipfile corrupt. (please check that you have transferred or created the zipfile in the appropriate BINARY mode and that you have compiled UnZip properly)
 

colab 환경에서 unzip 하려고 할 때 다음과 같은 에러가 떠서 해결하고자 gpt에게 물어봤는데

다음과 같은 쓸모없는 답변만 제공하였다.

  1. Check the ZIP File Integrity:
    • Ensure that the ZIP file is not partially downloaded or corrupted. You can try re-downloading the file if possible.
  2. Correct File Path:
    • Verify that the path to your ZIP file is correct. The error message suggests the file is located at /content/drive/MyDrive/Colab Notebooks/open.zip. Double-check to make sure this is accurate.
  3. Binary Mode Transfer:
    • If you transferred this file from another system, ensure it was done in binary mode. Transferring in a text mode can corrupt binary files like ZIP archives.
  4. Alternative Unzipping Methods:
    • Try using a different command or tool to unzip the file. Sometimes certain methods handle corrupt or unusual ZIP files better.
  5. Check Disk Space:
    • Ensure you have enough disk space in your environment to extract the contents of the ZIP file.
  6. Manual Inspection:
    • You can try opening the ZIP file with a file archiver tool on your local machine to see if it's a problem with the file itself or the environment.
  7. Repair the ZIP File:
    • If the file is indeed corrupt, you might need to use a file repair tool to fix the ZIP file. There are several tools available online for this purpose.

다음과 같이 오류가 발생한 이유는 window에서 압축한 파일을 linux에서 unzip하려고 했기 때문이다.

다음을 사용해서 zip 파일을 linux용 zip 파일로 변경한 후 압축을 해제하면 문제 없이 압축이 해제된다.

!zip -FFv open.zip --out open2.zip

 

728x90