xNul / palworld-host-save-fix

Fixes the bug which forces a player to create a new character when they already have a save. Useful for migrating maps from co-op to dedicated servers and from one dedicated server to another.
MIT License
886 stars 70 forks source link

[zlib.error: Error -5 while decompressing data: incomplete or truncated stream] #32

Closed Colinwood11 closed 9 months ago

Colinwood11 commented 9 months ago

When I tried to migrate WINDOWS to LINUX, this error occurred. Is there a problem with my ZLIB dependency?

Thanks!

C:\Users\admin\Downloads\pal>python fix-host-save.py "C:\Users\admin\Downloads\pal\uesave.exe" C:\Users\admin\Downloads\pal\Saved\SaveGames\0\14D127E34FDD6679C9F8759F1560EA5F 088D0CD1000000000000000000000000 9A8203B0000000000000000000000000
WARNING: Running this script WILL change your save files and could potentially corrupt your data. It is HIGHLY recommended that you make a backup of your save folder before continuing. Press enter if you would like to continue.
>
C:\Users\admin\Downloads\pal\uesave.exe
C:\Users\admin\Downloads\pal\Saved\SaveGames\0\14D127E34FDD6679C9F8759F1560EA5F/Level.sav
Traceback (most recent call last):
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 247, in <module>
    main()
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 75, in main
    sav_to_json(uesave_path, level_sav_path)
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 165, in sav_to_json
    uncompressed_data = zlib.decompress(data[12:])
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
zlib.error: Error -5 while decompressing data: incomplete or truncated stream

C:\Users\admin\Downloads\pal>
HinataYiacc commented 9 months ago

When I tried to migrate WINDOWS to LINUX, this error occurred. Is there a problem with my ZLIB dependency?

Thanks!

C:\Users\admin\Downloads\pal>python fix-host-save.py "C:\Users\admin\Downloads\pal\uesave.exe" C:\Users\admin\Downloads\pal\Saved\SaveGames\0\14D127E34FDD6679C9F8759F1560EA5F 088D0CD1000000000000000000000000 9A8203B0000000000000000000000000
WARNING: Running this script WILL change your save files and could potentially corrupt your data. It is HIGHLY recommended that you make a backup of your save folder before continuing. Press enter if you would like to continue.
>
C:\Users\admin\Downloads\pal\uesave.exe
C:\Users\admin\Downloads\pal\Saved\SaveGames\0\14D127E34FDD6679C9F8759F1560EA5F/Level.sav
Traceback (most recent call last):
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 247, in <module>
    main()
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 75, in main
    sav_to_json(uesave_path, level_sav_path)
  File "C:\Users\admin\Downloads\pal\fix-host-save.py", line 165, in sav_to_json
    uncompressed_data = zlib.decompress(data[12:])
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
zlib.error: Error -5 while decompressing data: incomplete or truncated stream

C:\Users\admin\Downloads\pal>

My situation is exactly the same as yours. I found that the data after the level.sav file is all 00, but it wasn't like this in the previously backed up level.sav file. So I think it's possible that the issue is caused by data loss in the level.sav file. image

FroggMaster commented 9 months ago

I'm also encountering this error, however my Level.sav does not appear to be missing any data. I'm also trying to convert from Windows, to Linux.

Edit: Re-downloaded my data, and did all the same steps. This time, it worked without the decompression errors. Can't really say why though.

Colinwood11 commented 9 months ago

Wait, I may have thought of something. When I downloaded the archive, the server did not stop! I'll try it again when I have time!

xNul commented 9 months ago

I think this was user error and it's been inactive for the last 5 days so I'm going to close it. Let me know if this error still exists and you're working on it and I'll reopen it.