Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Order Conflict: Who Even Knows Who Is At Fault? #430

Closed
nearlyNonexistent opened this issue Jun 24, 2018 · 8 comments
Closed

Load Order Conflict: Who Even Knows Who Is At Fault? #430

nearlyNonexistent opened this issue Jun 24, 2018 · 8 comments

Comments

@nearlyNonexistent
Copy link

Expected behavior

Should load fine with other plugins installed, and Denizen should be able to access Citizens API.

Actual behavior

Doesn't load properly and disables itself, while giving this startup log with a stacktrace:

https://cdn.discordapp.com/attachments/326844192510705664/460516641852096512/latest.log

It also causes Denizen to load before CitizensAPI.

Steps to reproduce

Install these plugins at the same time with DungeonsXL:

https://cdn.discordapp.com/attachments/243948414226661376/460527261704126486/unknown.png

This itself is a dependency graph; yellow representing soft dependencies and red representing hard. Green represents load befores and afters.

Here is a dependency graph with SimplePets disabled but DungeonsXL enabled:

https://cdn.discordapp.com/attachments/243948414226661376/460527534388543490/unknown.png

Not sure if this is on DungeonsXL's side, SimplePets's side, or something else.

@Sataniel98
Copy link
Member

Sataniel98 commented Jun 24, 2018

I'm not sure either to be honest. This seems to be a duplicate of #428, but I'll keep this one open instead as it's more detailed. I'll have a look at it in detail. Did you report this to any other plugins as well?

@nearlyNonexistent
Copy link
Author

nearlyNonexistent commented Jun 24, 2018

Reported to SimplePets and NPC Police. Either seem to be causing the problem but only in the presence of each other, perhaps?

According to NPC Police's developer:

Nah, whatever the orders are. They need to wait for citizens to load it's npc database. Until that happens, its not going to work.
If you make a trait, that needs to get registered before the the NPC DB load happens.
but, to interact with the NPC registry, you need to wait for it to load. This is totally something they have to fix for you.

EDIT:

Actually, it looks like removing ANY plugin in the dependency graph causes the crash to be fixed.

@Nutty101
Copy link

The issue is that when DungeonsXL loads, it's not waiting for Citizens to load the NPC database. So you call out for the registry to load, and it's not initialized. I actually spent a bit on this issue myself before figuring it out on my own plugin's. Older versions of Citizens we never saw this, but more recent versions I started to get reports about it. You can put in a loadafter: [Citizens] and see if that resolves the error.

Quick item from when I was looking at this earlier.
unknown

Notice how it's attempting to read the Citizens NPC registry before it even gets initialized. Thus the error that is occurring.

@Sataniel98
Copy link
Member

I also can well imagine that the issue is caused by DungeonsXL, but I'm not sure why. A "loadafter" option does not exist in Bukkit (see here). To my knowledge, this is what the dependency / softdependency lists are supposed to do. You might have mixed that up with "loadbefore", which quasi adds the plugin as a dependency to a different plugin. DungeonsXL does include Citizens as a softdependency. I can't imagine why it still loads before Citizens. It usually does not.

I'll need to do some testing to isolate the plugin(s) that force(s) DungeonsXL to load before / Citizens to load after DungeonsXL for some reason. If there's no way to fix the order, I'll just find a solution to make it so that DXL doesn't reference the NPC registry on startup.

@Nutty101
Copy link

Lol, you are right on the loadafter. Who knows what I was thinking on that. If i recall, there was some discussion a while ago that depends/softdepends does not promise the load order will be honored. With so many plugins that rely on others, it may not follow the correct order.

If anything else, maybe a scheduled sync that hits on the first tick, that should get it going.

@Sataniel98
Copy link
Member

@nearlyNonexistent I think I've found a fix, but I don't have time to test it right now. Would you mind doing so? https://erethon.de/resources/dungeonsxl-0.16-SNAPSHOT.jar

@nearlyNonexistent
Copy link
Author

nearlyNonexistent commented Jun 25, 2018

Testing the build now.

EDIT:

Works fine, no errors, even fixes Denizen loading before Citizens. I'm curious; what was the fix?

@Sataniel98
Copy link
Member

Removing the reference to Citizens' NPC registry on startup and calling it directly instead in the methods that use it. The reference was made for code clarity only anyway so it won't have any influence on how DXL or Citizens work. It actually didn't take more than removing a single line and Ctrl.+H. Sometimes, the weirdest problems have the simplest solutions... I still have no idea how this could affect the load order of Bukkit - but it works, so I'll just call it a day ¯_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants