FatherToast / SpecialAI

Adds additional AI patterns to mobs to make the game more challenging. 'Passive' mobs will fight back, monsters will break light sources and wooden doors, some mobs gain random extra abilities, and villages are more... village-y.
8 stars 7 forks source link

Cannot remove block from "idle_ai.toml" break list on a headless server #19

Closed belathus closed 5 months ago

belathus commented 2 years ago

Yesterday, I made this commit for a modpack I'm working on: https://github.com/belathus/Wanderlust/commit/3ef673692e642b590c4e7a39cdb0125b84c25c52

Unfortunately, when I tried to test this, my server started crashing: https://gist.github.com/belathus/d902c776c9d176a8a6df0ebfa56e949d

I don't think I made a mistake when editing the config, as it seems to work fine in single-player (this isn't causing a crash in single-player). It is only crashing on a headless server.

Sarinsa commented 2 years ago

So you only experience this crash on your dedicated server? It is the server that is crashing, not your client?

belathus commented 2 years ago

That is correct. The crash only happens when a dedicated server is starting.

Sarinsa commented 2 years ago

Have you tried to replicate this problem with only SpecialAI loaded and no other mods present? From what I have seen in the log you posted, the error seems to be entirely related to SpecialAI, but if possible it would be very helpful if you try to replicate the crash with only this mod installed.

belathus commented 2 years ago

I'm failing to duplicate the crash with only a handful of mods installed. I've even tried re-adding mods like Quark (which requires AutoRegLib) and Futurepack just so I had something to remove from the idle_ai config file.

Another thing to note is that SpecialAI does not crash if I do not modify the default config file.

Sarinsa commented 2 years ago

I see. Could you provide a copy of what your config looked like when the crash occurred?

belathus commented 2 years ago

The file in the commit is what I uploaded. I'll take a look to see if it gets modified after the server starts.

FatherToast commented 2 years ago

I would be interested to see the final file after the crash, since the file can be modified during runtime by the mod. Also, could you send the console output/log leading up to the crash? SAI might print something useful right before the crash happens, if we're lucky.

belathus commented 2 years ago

Well, this is bothersome, but I'm no longer able to repeat the crash, even with all of the mods installed and the same exact config file (the only change that appears to have been made is to the comment that lists the default blocks, which changed the order of the list; I used "diff" to check the differences).

I reported this because I got the crash repeatedly after modifying the configs. Each time, I deleted the original config and tried modifying it again and got the same crash. It happened at least 5 separate times, but now I can't repeat it. I've made no updates, I just reverted the config file then re-uploaded it hours later so I could see if it changed the file during runtime. So color me confused.

belathus commented 2 years ago

https://gist.github.com/belathus/6694efc08029e43ce9ffcd399df4003c

Here is a log file of the crash, though, from early this morning.

FatherToast commented 2 years ago

Hm I see, perhaps this is a strange issue with the read/write. Not sure why or how it would happen, though. If it does happen again, try to start the server again without touching the config file - it may resolve itself that way if this is the case.

belathus commented 2 years ago

I got the crash to happen again. https://gist.github.com/belathus/466ad5cc7680ca062c2f9ebe42729361

Here is the config file after the crash: https://gist.github.com/belathus/9a74c73e8e3132bdfc57cf25e71853f2

Letting it restart after a crash just causes it to crash again.

FatherToast commented 2 years ago

Looks like this is specifically the cause: https://gist.github.com/belathus/9a74c73e8e3132bdfc57cf25e71853f2#file-gistfile1-txt-L218 I don't know what causes it to malform the config, however. I suspect this might be an issue with NightConfig, but it might just be a problem with my implementation - I'll keep this open to remind me to look into it.

Sarinsa commented 5 months ago

Fixed