r2modmanPlus icon indicating copy to clipboard operation
r2modmanPlus copied to clipboard

[BUG] - Unable to deserialize cloned data

Open Reycko opened this issue 2 months ago • 11 comments

Describe the bug When downloading Wesley's Moons in Lethal Company (this may also be an issue with other mods), an error saying 'Unable to deserialize cloned data' appears.

To Reproduce Steps to reproduce the behavior:

  1. Open the mod manager on Lethal Company
  2. Download Wesleys_Moons
  3. Error when the download finishes

Expected behavior The mod finishes downloading, and I can run the game without issues.

Screenshots Image

Additional context System is running on CachyOS, no launch options on r2modman I (reycko) am not the one experiencing the issue, but my friend, I am opening this issue on his behalf

Log files relating to the bug:

8:26:05 PM [ERROR]: [Failed to download mod Magic_Wesley-Wesleys_Moons-6.9.6]: Uncaught Error: Unable to deserialize cloned data.
8:26:30 PM [ERROR]: [Failed to download mod Magic_Wesley-Wesleys_Moons-6.9.6]: Uncaught Error: Unable to deserialize cloned data.
8:26:58 PM [INFO]: Steam folder is: /home/<user>/.local/share/Steam

Reycko avatar Nov 16 '25 19:11 Reycko

Same problem on Linux Mint 21.

dodaucy avatar Nov 16 '25 21:11 dodaucy

Same here Cachy OS 6.17

RaptorCoding avatar Nov 16 '25 21:11 RaptorCoding

To note, I do not have this happen on my machine, which is running arch linux We both have r2modman from AUR package 'r2modman-bin' This only happens to my friend

Reycko avatar Nov 16 '25 21:11 Reycko

I was able to work around this by copying the BepInEx/plugins/Magic_Wesley-Wesleys_Moons folder from a friend and by modifying mods.yml after installing the dependencies.

dodaucy avatar Nov 17 '25 22:11 dodaucy

Another work around is to put it in cache manually.

RaptorCoding avatar Nov 18 '25 01:11 RaptorCoding

I may found the issue. It looks like the error is caused by const buf: Buffer = Buffer.from(response.data); in BetterThunderstoreDownloader.ts (L82), likely due to the buffer limit.

I would suggtest streaming the response into a file rather than loading the response into memory first.

dodaucy avatar Nov 18 '25 10:11 dodaucy

Is the file larger than 2GBs? If so, it's not supported.

There is a half fix here, but it'll proceed to fail because zip libraries (that are secure) don't stream (and so 2GB is attempted to get loaded into memory again) https://github.com/ebkr/r2modmanPlus/pull/1765

ebkr avatar Nov 18 '25 10:11 ebkr

Is the file larger than 2GBs? If so, it's not supported.

There is a half fix here, but it'll proceed to fail because zip libraries (that are secure) don't stream (and so 2GB is attempted to get loaded into memory again) #1765

It's 1.2 gigs

RaptorCoding avatar Nov 18 '25 10:11 RaptorCoding

I believe it actually depends on the memory use of the application at that point. I'd imagine there's some objects still stored in memory that haven't yet been cleared up from downloading, but the running application overhead.

Once the overall memory use exceeds 2GBs, that's when the issue occurs. So it's not that the file has to be 2GB, it's just that it's the general limit.

ebkr avatar Nov 18 '25 11:11 ebkr

I believe it actually depends on the memory use of the application at that point. I'd imagine there's some objects still stored in memory that haven't yet been cleared up from downloading, but the running application overhead.

Once the overall memory use exceeds 2GBs, that's when the issue occurs. So it's not that the file has to be 2GB, it's just that it's the general limit.

But even just downloading it on a fresh session doesn't work and produces the same error ? (By fresh session I mean r2modman that was just opened very recently)

What I've tried: -Updating my system -Updating r2modman -Reinstalling r2modman -Deleting cache folder -Chowning everything in r2modman -Restarting r2modman -Restarting my system -Installing only the mod on a new profile

Only thing that worked was putting the files manually in ~/.config/r2modman-plus/cache/[folder name]/[version]

RaptorCoding avatar Nov 18 '25 11:11 RaptorCoding

But even just downloading it on a fresh session doesn't work and produces the same error ? (By fresh session I mean r2modman that was just opened very recently)

Again, it's memory related. It's also why the other things you've tried wouldn't resolve it.

Only thing that worked was putting the files manually in ~/.config/r2modman-plus/cache/[folder name]/[version]

That's because it looks up from the cache if it's already installed. It skips the download and extract phase.

There is no other workaround for this at the moment, and it's fairly high effort. Given there are like two packages that cause this, it's not a primary concern right now.

ebkr avatar Nov 18 '25 12:11 ebkr