lynnpye / cronmc

Minecraft mod
MIT License
0 stars 0 forks source link

Cannot invoke "it.unimi.dsi.fastutil.ints.IntArrayList.getInt(int)" because "this.wrapped" is null #2

Closed OctavioCore closed 1 year ago

OctavioCore commented 1 year ago

Hi there, For starters, thank you for your work - I've had tremendous trouble finding a mod providing cron-like capabilities for Forge.

But anyway - I found an issue that seems to be associated with this mod, somehow. In my mod pack, I've set up a cron job that clears up drops and entities every 20 and 40 minute of an hour. Soon, we've started experiencing crashes from time to time - and weirdly, the scheduled command time is exactly when a crash happens - precisely at HH:20:00 or HH:40:00. Literally, never crashing in any other circumstances - just in this exact one, when cronmc executes the scheduled command. One of my players have noticed, that the command scheduled at the time of the crash actually executes twice.

I'm using the 1.18.2 version, on Forge 40.1.84. I'm attaching a crash log - maybe you'll find something that might help you there? crash-2022-11-18_22_20.00-server.txt

lynnpye commented 1 year ago

Hi @OctavioCore ,

I'll take a look. Clearly if it's being executed twice, I could imagine that would cause issues.

lynnpye commented 1 year ago

@OctavioCore : can you provide the cronmc-server.toml you are using?

OctavioCore commented 1 year ago

Of course, here you go (Had to change the extension, however it is a .toml file): cronmc-server.txt

lynnpye commented 1 year ago

So, a few things:

1) Regarding multiple executions of a command when only one should be scheduled: I was not able to reproduce this. I used your commands as well as scheduling my test runnables. Not to say it's not happening, just that I couldn't replicate the issue. As a followup, aside from the settings in cronmc-server.toml, are you executing any cronmc related commands in game? Like /cronmc start or stop?

2) Regarding the fact that the error occurs when cronmc fires off the commands: I think this is coincidence, or more accurately, I think if you happened to run that command yourself, outside of cronmc, frequently enough, you would trigger the same exception.

3) Regarding the NullPointerException: I followed the exception stack trace and found it is failing while iterating tracked entities in the chunk. This isn't code that cronmc is involved in. That said, you can see in the stack trace that several mods have applied mixins in methods in this call stack, with "smoothchunk" having touched several points including the most "recent" in the call stack.

My suggestion: Leave cronmc in place, leave your scheduled kill commands in place, possibly even increasing their frequency, i.e. remove the two separate entries for each and add one back with a schedule like "/5 *" to run every five minutes. Then start removing mods that could be interacting with these commands, to see if removing one of these mods causes the problem to stop happening.

My first suggestion would be "smoothchunk", as the stack trace mentions that it is applying a mixin at the exact place in ChunkMap where the exception is happening. If you look at each line of the stack trace, any line that includes the "{re:mixin,..." portion is indicating that there is at least one mod that applied a mixin at that section of code. If removing smoothchunk doesn't address the issue, I would take a look at other mods mentioned in the mixin statements of the stack trace.

OctavioCore commented 1 year ago

1) Nope - only using the schedule from the config

AD. the rest - yeah, it might be a problem with other mods, that Cronmc just shines some light on - I've actually been quite sceptical of Smooth Chunk Saving with this many mods in the pack, and suspected it for some shenanigans back there.

Well - i'll try to pinpoint what's wrong, thank you for your time, and great work ;)

lynnpye commented 1 year ago

If by process of elimination you do determine what is causing the issue, would you mind posting here?

OctavioCore commented 1 year ago

Of course - I'll let you know, when I'll find out what exactly was wrong.

lynnpye commented 1 year ago

@OctavioCore , any updates? If not, I'd like to close the issue.

OctavioCore commented 1 year ago

Oh, right, sorry. Totally forgot.

Well, the issue indeed seems to be caused by smoothchunk (Smooth Chunk Saving) - I've cut it out from the modpack, and crashes pretty much ceased.

The issue can be closed, thank you again ;)