cheahjs / palworld-save-tools

Tools for converting Palworld .sav files to JSON and back
MIT License
767 stars 65 forks source link

zlib.error: Error -3 while decompressing data: invalid block type #77

Open geocine opened 5 months ago

geocine commented 5 months ago

Have you modified the save files No, I am using the latest version of the game 1.3.1, the save file loads on my server and am able to play with friends . So I don't think this is corrupted .

Have you tried the latest release Yes v0.14.0

Describe the bug I get an issue in version 0.14.0

Python version:
Python 3.11.3
Converting C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\Level.sav to JSON, saving to C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\Level.sav.json
Decompressing sav file
Traceback (most recent call last):
  File "C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 115, in <module>
    main()
  File "C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 53, in main
    convert_sav_to_json(args.filename, output_path, args.minify_json)
  File "C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 72, in convert_sav_to_json
    raw_gvas, _ = decompress_sav_to_gvas(data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\geoci\Downloads\palworld-save-tools-windows-v0.14.0\lib\palsav.py", line 25, in decompress_sav_to_gvas
    uncompressed_data = zlib.decompress(data[12:])

Copy of .sav or .sav.json files https://file.io/CDoraKiguWAz

cheahjs commented 5 months ago

Hmm, validated that https://github.com/madler/pigz is able the decompress the file and it parses fine once that's done.

Python's zlib module and zlib.js both throw errors.

Kabug commented 5 months ago

Heya, I've got the same issue.

Have you tried the latest release Yes v0.14.0

Have you modified the save files No

Describe the bug

Found Python at python3
Python version:
Python 3.12.1
Converting E:\backup\backup pal\74ABC76C000000000000000000000000.sav to JSON, saving to E:\backup\backup pal\74ABC76C000000000000000000000000.sav.json
Decompressing sav file
Traceback (most recent call last):
  File "C:\Users\Kabilan\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 115, in <module>
    main()
  File "C:\Users\Kabilan\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 53, in main
    convert_sav_to_json(args.filename, output_path, args.minify_json)
  File "C:\Users\Kabilan\Downloads\palworld-save-tools-windows-v0.14.0\convert.py", line 72, in convert_sav_to_json
    raw_gvas, _ = decompress_sav_to_gvas(data)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kabilan\Downloads\palworld-save-tools-windows-v0.14.0\lib\palsav.py", line 11, in decompress_sav_to_gvas
    raise Exception(
Exception: not a compressed Palworld save, found b'\x00\x00\x00' instead of P1Z
Press any key to continue . . .

Save file in question: https://file.io/zQeNeEq2rL1n

WayneFerdon commented 5 months ago

@geocine Did you close the server before exporting? The .sav file might not be complete if the server is still running.

geocine commented 5 months ago

@geocine Did you close the server before exporting? The .sav file might not be complete if the server is still running.

I copied the server file unto a different folder before exporting. I also copied that same file back to the server and it was working. As @cheahjs commented , my file is valid and not corrupted.