MagicStorage icon indicating copy to clipboard operation
MagicStorage copied to clipboard

Having over 2000+ items stored in storage systems causes chunk "corruption"

Open negativize opened this issue 6 years ago • 36 comments

This issue seems to be consistent and has been reported numerous times on the thread on the Terraria forums. It also seems to be multiplayer-only, as the issued isn't present in singleplayer. The corruption appears to happen after exiting a world with 2000+ items stored.

Problem: when over 2000 or more items total are stored in a system and a server is restarted, everything in the spawn chunk will be erased upon restart (might be chunks around storage that are affected, not sure)

I don't believe this affects wired items (as our wired doors were not erased when the issue happened), but everything else is deleted. I believe this also happens when multiple system have a total storage of 2000+ items. This does not happen when there are over 2000 slots available.

Strangely, NPCs inside the deleted chunk fall are not affected and instead teleport to the position of where there homes were after falling a certain distance.

This corruption doesn't actually "delete" items: in singleplayer, any affected chunks return to their former state and any storage units work as intended. The only way to fix the issue (with my knowledge) is to start the corrupted world in single-player, remove items until less than 2000 are present, and restart the affected world. This fixes the issue and everything is returned to its prior state.

Image taken from forum in singleplayer: image

Image taken from forum in multiplayer: image

Some users are reporting this happens at different limits. (one user reported 8000 - 8500 items being the limit) I would only consider this issue critical in multiplayer, as it basically ruins the gimmick of storage by limiting the server to less than 2000 items. Works fine in singleplayer. Either way, it needs a fix.

negativize avatar Mar 12 '18 04:03 negativize

same issue here altho problem started way before 2k items as we have a mod that adds random stats to items as well, temp work around is have the storage containers in different chunks. in my multiplayer world we moved a bit from spawn and put 4 sets of 5 (hellstone) containers with each set being in a different chunk, fyi the problem doesn't exist for single player so simple take the multiplayer world and open it in single player and move some storage around, then launch host&play to test if it worked

ukilop avatar May 27 '18 18:05 ukilop

bcd349952a435274d3a85fbb42dbad977a482975 should delay this from happening. However I'll still leave this issue open since it's only a temporary fix, and it's planned for the next tModLoader update to fix this permanently.

blushiemagic avatar Aug 03 '18 06:08 blushiemagic

This still happens today, having mods like "Even more modifiers" and "Spirit Mod" (with glyphs) makes this happen even quicker. Not sure what the course of action is, I hardly doubt "take the items out in single player and split them through multiple chunks" is a viable solution at all.

Tenrys avatar Oct 11 '18 21:10 Tenrys

I tried to host another world with less mods and a tiny amount of MagicStorage containers, and the same deal happened. It only seems to happen on my Linux Dedicated Server, when my friends try to host it on their PC it just works without an issue.

Tenrys avatar Oct 15 '18 21:10 Tenrys

Linux VPS with 2 MS systems totaling 450-600 items Linux VPS with 2 MS systems totaling 450-600 items

Windows server with same mods and 12,000+ items. Windows server with same mods and 12,000+ items.

I think the issue is deeper than expected.

Psyda avatar Oct 25 '18 06:10 Psyda

I have been able to consistently reproduce this bug on my mac. It doesn't matter how many items are in the storage units, as long as there is at least one storage unit in a chunk then the whole chunk refuses to load in multiplayer.

After some testing I think I have figured out why this happens, at least on mac (possibly linux too). It is because System.IO.Compression (which is used by the storage units to compress data before it's sent over the network) requires a library called MonoPosixHelper to be loaded which isn't included in Terraria by default. If you copy libMonoPosixHelper.dylib (on linux it's probably called libMonoPosixHelper.so) to the osx (on linux ~~I'm assuming it's called linux~~ I think it's called lib or lib64, I don't know) directory then the world loads fine.

Edit: tModLoader 0.11 and newer now includes libMonoPosixHelper by default so that should fix this for most people. If upgrading to that version doesn't fix it for you then your issue is probably unrelated to this one.

Fadenfire avatar Dec 27 '18 17:12 Fadenfire

Where exactly is libMonoPosixHelper.so found? Does it come with tModLoader or do I have to download it myself?

MarkusG avatar Mar 24 '19 23:03 MarkusG

You need to extract them from a mono install. Here's a zip with a mac and linux lib. I'm not sure if the linux lib is 64 bit or 32 bit, I just installed mono in a linux virtual machine and grabbed it from the libs directory.

Fadenfire avatar Mar 25 '19 00:03 Fadenfire

It looks like those libraries are 64-bit. I tried both those and copying the library from my own mono installation, but to no avail. The chunk rendered, but the storage system itself still doesn't work. I can deposit items, but it displays "0/0 items" and I can't retrieve them. However, I can retrieve items in singleplayer, which is very confusing.

MarkusG avatar Mar 25 '19 17:03 MarkusG

I have this problem as well on linux as a client, how do I fix this?

drax32 avatar May 17 '19 13:05 drax32

Yep, those files are 64 bit. I put the library file in Terraria's lib64 folder, and can successfully connect to a server with magic storage. I'm on a linux client, and can access all of the items in the Storage Heart.

ultrako avatar Jun 01 '19 00:06 ultrako

Would anyone be able to provide a download for a 32-bit libMonoPosixHelper.dylib? I'm using tModLoader to host these mods and am having the same issue, but the lib in Silly511's zip folder didn't solve the problem. I suspect it's because the current stable version of tModLoader is 32-bit. All other issues are the same.

Edit 07/26/19: I tried loading my world again yesterday and it's... working? It can host a server just fine now. I suspect the most recent tModLoader update did something that let things work, or maybe there was a new update for Magic Storage? Either way, the lib is in the osx folder and the server is functioning. No idea what specifically changed.

halcyonesselion avatar Jun 19 '19 01:06 halcyonesselion

Hello, I would like to add to this problem by saying I am having this same problem on Windows. I have also had this problem after placing 3 empty storage units with no heart side by side. After about 5-10 minutes, my game crashed, I opened it back up (on multiplayer) and the chunk was gone.

cobaltw avatar Jul 15 '19 23:07 cobaltw

I'd suggest pinning this issue, since it seems to be a common problem.

Steffo99 avatar Jul 25 '19 17:07 Steffo99

@Silly511 Thanks, your fix worked on Ubuntu 18.04LTS with tModLoader v0.11.3!

Steffo99 avatar Jul 26 '19 23:07 Steffo99

Encountered the world hole issue, @Silly511 thanks for your fix - it worked for me. I'm going to look through the open issues and point others having similar problems to this thread.

syy1125 avatar Aug 04 '19 04:08 syy1125

Also, https://github.com/blushiemagic/MagicStorage/issues/74#issuecomment-484970403 mentioned that v0.4.3.1 was working for Linux but v0.4.3.2 and later were not. I found commit https://github.com/blushiemagic/MagicStorage/commit/bcd349952a435274d3a85fbb42dbad977a482975 in the history of v0.4.3.2, so I'd say https://github.com/blushiemagic/MagicStorage/issues/41#issuecomment-450196167 is on point.

syy1125 avatar Aug 04 '19 04:08 syy1125

I'm getting wildly varying results with the fix mentioned earlier in the thread. At first it seemed to be working, but now I'm either getting stuck on "Receiving tile data: Complete!" or the client connects, but then freezes and crashes. The steps I've taken is copying the .so file to both lib and lib64.

For reference, I'm on Fedora 30 with modloader 0.11.3 and Magic Storage 0.4.3.4.

ivakam avatar Aug 05 '19 01:08 ivakam

I am using Debian with tmodloader 0.11.5 and it is not working. Similar problem to @ivakam with the .so fix, I get stuck trying to connect at 33% or 40%. I will look into MagicStorage and see if I can find a fix.

Using MagicStorage v0.4.3.1 I got it working. Even loaded up Cheat Sheet and put 100,000+ items in some Storage Hearts. Worked even after relogging/restarting server. I tried the solution in #41 and it got stuck loading into the world. I will stick to v0.4.3.1 and hope that this resolves any issues

warren-fisher avatar Dec 22 '19 01:12 warren-fisher

I can attest that placing libMonoPosixHelper.so into the lib64 library solved the issue for me (Debian 10). Despite using the latest tmodloader (0.11.6.2) that particular library wasn't present which evidently caused the issue.

Reutertu3 avatar May 06 '20 13:05 Reutertu3

I got this issue too, Is anyone knows how to fix this on Windows 10 1903? Magic Storage v0.4.3.5 with tModLoader v0.11.7.1 image

MCwindTIM avatar May 21 '20 20:05 MCwindTIM

tModloaderServer 0.11.7.5, magic storage 0.4.3.5, same issue as described above, system is ubuntu 18.04, can confirm that libMonoPosixHelper.so was not present in tModLoaderServer's linux release and the issue was fixed after manually including the lib file.

tzhouhc avatar Aug 26 '20 22:08 tzhouhc

Just had this issue rear its ugly head again. tModLoader v0.11.8.4, Magic Storage 0.4.3.5. I can't seem to find where tModLoader logs full errors (instead I only get the "Error on message Terraria.MessageBuffer" errors), but I believe this is the same problem. Strangely, there were only a handful of items - somewhere in the neighborhood of 250 items including the chests I hadn't merged into the system yet. Relogging without restarting the server (I run the server in a terminal to make finding and testing things like this easier) caused a chunk of the world to disappear for me, but my two friends running Windows were just fine. Restarting the server and relogging caused all of the blocks to no longer follow visual attachment rules, and getting close to where the chunk of the world went missing caused the client to crash. Unlike previous times I've encountered this problem, tML 0.11.8.4 does have the appropriate 32-bit and 64-bit versions of libMonoPosixHelper.so (I also made sure it was using the provided versions and not my native ones using pmap -p). Swapping in the file provided by Fadenfire did not fix the bug. Everything works fine in singleplayer.

TNTftw21 avatar Jun 12 '21 04:06 TNTftw21

Same issue on Ubuntu 20.04, tmodloader 0.11.8.4, Magic Storage 0.4.3.5. TIles aren't connecting properly and chunks are missing around the storage system. Items are also missing from the system until I restart my game. I also tried default libMonoPosixHelper.so and the provided version to no avail. Works fine in singleplayer for me as well.

hollowharkov avatar Jul 11 '21 21:07 hollowharkov

libMonoPosixHelper.zip This is the version of the library I'm using. It's provided by mono-runtime-common version 6.12.0.122-0xamarin1+ubuntu2004b1. I literally just copied it from /lib to the tML lib64 directory. It got me through the rest of that playthrough without issue.

TNTftw21 avatar Jul 11 '21 23:07 TNTftw21

I can confirm that the fix from TNTftw21 works for me as well, hopefully tmodloader uses that lib in a future update.

hollowharkov avatar Jul 13 '21 04:07 hollowharkov

libMonoPosixHelper.zip This is the version of the library I'm using. It's provided by mono-runtime-common version 6.12.0.122-0xamarin1+ubuntu2004b1. I literally just copied it from /lib to the tML lib64 directory. It got me through the rest of that playthrough without issue.

Both of the LD_PATHS under $STEAM_PATH/tModLoader included the libMonoPosixHelper.so for me, the x86 version being 263K and the 64-bit being 261K in size. Should I override the 64-bit with the older version? I didn't even have mono installed until recently. How was my game even working?

My issue is not about chunk corruption, per se, but rather inability to find certain items in the storage. Does anyone know if the cause the same?

mazunki avatar Dec 31 '21 00:12 mazunki

Does this happen in Crimson worlds too?

flarn2006 avatar Jan 08 '22 08:01 flarn2006

Does this happen in Crimson worlds too?

My worldgen has Fargowilta's Both Evils installed, but if I recall correctly the world "is" a corrupted one. I would be surprised if that's related at all, @flarn2006 .

EDIT: r/whoosh

mazunki avatar Jan 08 '22 09:01 mazunki

I'm also having the Error on message Terraria.MessageBuffer. I am using terraria 1.3.x with the 64bit version of tmodloader. (Linux server). The complete version of mono is installed. I've ran the exe and the script but both methods have the same problem.

I check my linux lib folder and I see the libMonoPosixHelper.so file. However, I don't seem to have a lib64 folder. I created one in the root directory and added the file to it but that doesn't seem to change anything. I've only tried it with a few items and it seems to work but the error still appears in the logs.

aMytho avatar Oct 25 '22 02:10 aMytho