VaM 1.x Corrupted JSON, yet it should work?

Threads regarding the original VaM 1.x

TheBlueBlood

Member
Joined
Jun 3, 2020
Messages
61
Reactions
73
Hello!

I've been messing with AI to create a duplicate finder and tagging editor for any .var file.

After the var has been rewritten by a custom Python tool (edits the "tags" field inside .vam files, rewrites the whole .var/zip archive with Python's zipfile), it shows "Package x meta file is not valid" in the Package Manager in VAM.
The original file, untouched, works fine in VAM. Any version reprocessed by the tool fails with that error, even after the tool was updated to change literally nothing.

Ruled out so far:
- Archive corruption (CRC32 checks pass)
- Invalid JSON / malformed .vam files (all parse correctly)
- meta.json contentList mismatch vs actual archive contents (checked, consistent)
- Duplicate zip entries (none)
- WinRAR involvement
- VaM cache (tried Rescan Packages button + fresh isolated AddonPackages folder with only this file in it, still fails)
- ZIP header metadata (flag_bits/external_attr) -- found Python's zipfile WAS silently changing these on write, patched it to match original exactly, still fails

I tried everything I thought was possible and it still shows invalid.
Would anyone have the slightest idea?

Thanks!
 
Maybe share one of the edited VARs to check it.
 
Upvote 0
Personally, I wouldn't use any Python script that modifies var files. Scan and report scripts are fine, but turning it loose to change file contents? Nope. I think the smart thing to do here is abandon ship. Walk away from this one. You're creating a minefield.
 
Upvote 0
Maybe share one of the edited VARs to check it.
Actually, by asking me that, it gave me an idea to check further. -> Both files, with the same changes had mismatching sizes. Fixed that, and now the AI edited one just doesn't load the edited clothing, instead of a full on "invalid var".
Now here's what I got:
File 1 (my version): The only manual change I did was to add the tag "Fav" for the top item clothing. -> This works fine in vam, the tag also was added correctly in Other Tags
File 2 (ai version): Did the exact same change I did. Now the var actually manages to be valid. BUT, the single top item clothing is not in vam (the rest of the clothing are).

Also I can't seem to share actual .var, or .rar files. So here's the single edited files (.vam)

Edit: Ok, after much looking into it, I finally have something that works. Apparently, "The stale ZIP64 data was the real root cause the whole time."
 

Attachments

  • AiVersion-Mara_Top_Frostbane3d.vam
    190 bytes · Views: 0
  • MyVersion-Mara_Top_Frostbane3d.vam
    190 bytes · Views: 0
Last edited:
Upvote 0
Actually, by asking me that, it gave me an idea to check further. -> Both files, with the same changes had mismatching sizes. Fixed that, and now the AI edited one just doesn't load the edited clothing, instead of a full on "invalid var".
Now here's what I got:
File 1 (my version): The only manual change I did was to add the tag "Fav" for the top item clothing. -> This works fine in vam, the tag also was added correctly in Other Tags
File 2 (ai version): Did the exact same change I did. Now the var actually manages to be valid. BUT, the single top item clothing is not in vam (the rest of the clothing are).

Also I can't seem to share actual .var, or .rar files. So here's the single edited files (.vam)

Edit: Ok, after much looking into it, I finally have something that works. Apparently, "The stale ZIP64 data was the real root cause the whole time."

That is because we do not allow archives or scripts to be posted in the forums. If you have something you want to submit, especially a plugin or script, it has to go through the resource review process.
 
Upvote 0
That is because we do not allow archives or scripts to be posted in the forums. If you have something you want to submit, especially a plugin or script, it has to go through the resource review process.
I know? Never wanted to publish the script in the forums?
 
Upvote 0
Back
Top Bottom