team-abnormals / blueprint

Library that implements the framework of all Abnormals mods
https://www.curseforge.com/minecraft/mc-mods/blueprint
Other
114 stars 33 forks source link

All the mobs using Abnormal Cores throw a "failed to create mob" exception #70

Closed Nexey closed 3 years ago

Nexey commented 3 years ago

I've had an issue with 3.0.0 of upgrade_aquatic where this exception would be spammed in the console. Now running an instance where all the mods are updated, this spam happens on occasion. There will also sometimes be an exception per Abnormal Cores mob while my server is starting.

Here's a gist dating from upgrade_aquatic 3.0.0, I'm aware this isn't the most updated version but the exception is the same for every mob: https://gist.github.com/Nexey/b297c9fdbef2af09c68549ffab5edf16

You need to view the full file and search for "Nexey has made the advancement [Dark Times]" to see where those exceptions start happening.

SmellyModder commented 3 years ago

Does this occur only with a few abnormals mods installed?

Vaelzan commented 3 years ago

I'm trying to track down the source of this issue, because it's causing severe problems in Valhelsia 3 now, and only happening in each of the Team Abnormals mods. Because of this, I was trying to see what was different about the way you were handling things.

The only difference I can see between the way your team is registering mobs and the way other mods do is that you're (as in in each Team Abnormals mod, not in Abnormals Core) handling it it all inside the common setup event inside enqueueWork (so doing it on the main thread later in the setup process) whereas other mods use the registerEntities event, as in this example:

https://github.com/Alex-the-666/AlexsMobs/blob/16f4366712717bf4a07e08d582c2fb46b65ef054/src/main/java/com/github/alexthe666/alexsmobs/entity/AMEntityRegistry.java#L99

It seems to me like it may make more sense to register each entity's spawns and attributes in that event, rather than in the common setup event, just for timing purposes, but I haven't had a chance to test this to see if it resolves it (still keep the deferred register approach for the entity itself).

Edit: I just looked at a few other mods, and Mystical World is handling spawns / attributes inside enqueueWork in the common setup event too, so I think my initial idea might be wrong. If anybody else can see why specifically Team Abnormals mods might be impacted I'd love to know, since that was the only difference I could see. :(

SmellyModder commented 3 years ago

I'm still interested in knowing the answer to my initial question:

Does this occur only with a few abnormals mods installed?

I've been unable to reproduce this on my own with just abnormals mods.

because it's causing severe problems in Valhelsia 3 now

Please send the logs for these. The logs sent by the person opening this issue point to it being a max health attribute issue, but I don't see how that could happen because the attributes would've gotten registered by the time the mobs are getting spawned. I need to know if this can be consistently reproduced and if it occurs with only abnormals mods installed.

Vaelzan commented 3 years ago

(TL;DR at end in case you want to get straight to the answers)

I personally haven't been able to reproduce it at all, ever, so I don't think I'm going to be able to help with the first question, but I suspect that it won't happen with only the Team Abnormals mods installed. My guess is indeed some sort of mod interaction with something else (but I have not the slightest clue as to which). The problem is, that when the issue does occur, it only ever impacts Abnormals mobs, and no others (from the logs I've seen so far anyway).

To add some context, this issue is reported on our Discord several times per day, every day, it's only ever the Team Abnormals mods that are impacted, and the ones that result in that error log spam, while other mods that also add mobs aren't doing the same thing (eg. Mystical World, Druidcraft, Alex's Mobs). I gave my best guess as to why it's only impacting them, but then looking further it seemed like it might be wrong (although there could still be something to the idea of load order).

Since I haven't been able to reproduce it on my own, I can't really help contribute anything other than what other people are reporting to me. The logs that are frequently reported are so incredibly close to OP's logs that it probably won't help by digging them up, since they're basically going to have the same content, and I'm also not physically well enough to really do much more anyway due to illness.

TLDR: Not consistent, but frequent in a large install base. Doubt it will happen with only Abnormals mods, but when it does happen it only impacts Abnormals mobs, thus why I'm talking in this thread, trying to figure out what's different. Can't reproduce myself, only reporting others. Logs all very similar to OP's.

SmellyModder commented 3 years ago

From the evidence so far, this seems like a thread-safety issue, but the fact that it's purely abnormal mobs doing this is weird. If it were a thread-safety issue, then the result would be random, which would explain the inability to reproduce it, and the details of the outcome would also tend to be different. The problem with this explanation is the details of the bad outcome are consistent. Towards the top of the log sent by the OP it says this It is very, very weird that only and ALL abnormal mobs have no attributes. I know of a couple of mods that register attributes in the same way we do, and there are no problems with them. This seems like an incompatibility then of sorts or possibly something even malicious?

SmellyModder commented 3 years ago

A good way of tracking down the cause would be to take out some likely suspects and see if the errors no longer occur.

Vaelzan commented 3 years ago

Yeah, when I was chatting to Bagel earlier I pointed out that Mystical World registers attributes inside enqueueWork in the common setup event, same as you... that's why I edited my post (although they do some things in a different order inside that, but I doubt that matters - it looks like irrelevant stuff).

Agreed that it's very weird. But I've got nothing to go off of right now, unfortunately. I'm not familiar with any mod's 1.16 codebases enough to be able to point to anything obviously wrong (everything I've glanced at looks fine on your end, fwiw, it was just guesswork as to what some other unknown mod might be expecting to exist at a certain time during loading).

It makes it far harder to figure out because I've never had it happen to me in my own testing, whether single or multiplayer. :/

Vaelzan commented 3 years ago

I figure I should update here since, well, people stopped reporting the issue quite so much.

My guess is that whichever (still unknown) conflicting mod was triggering this changed something, so anybody who switched to the latest version of our pack no longer has this problem. I still have zero clue as to why it only impacted Abnormals mods / mobs, but unless it starts getting mass reported again, it might be safe to ignore the issue for a while and just file it under "huh, that was a weird thing to happen".

The most recent report on our end was two days ago, but the person never mentioned which pack version they were running. Compared to the quantity of reports we were getting at the end of January / start of February, this is so drastically different.

I could probably figure it out by looking at the mods that updated between Valhelsia 3.1.6 and Valhelsia 3.1.7/3.1.7a, but I also don't have enough free time to go to that level of detective work currently, so I'm happy to just put this on hold, maybe close the issue entirely if it remains that people are no longer reporting it to us. I'll try to remember to check back in later.

SmellyModder commented 3 years ago

Good to hear that it's not occurring much anymore. I'm still interested in knowing what might've caused this.

I could probably figure it out by looking at the mods that updated between Valhelsia 3.1.6 and Valhelsia 3.1.7/3.1.7a

This would be greatly appreciated. I'll close this for now, but discussion on this issue is still open.