BCLib

BCLib

31M Downloads

[Bug] DataFixerAPI running on every launch, delaying server start

jmadarg opened this issue · 21 comments

commented

What happened?

DataFixerAPI is running on every launch of a few of the servers we host, this causes a long delay on the server start and also a huge console/log spam with thousands and thousands of lines only with the DataFixerAPI "Inspecting" regions.
The amount of log spam is ridiculous, is at a point where is hard to use the log files for anything.

Here is the log from one of our servers (hosting BCG Plus), the spam starts at line 1082, and it keeps going till the end of the log https://mclo.gs/VqpIrPK#L1082

BCLib

3.0.14

Fabric API

0.91.0

Fabric Loader

0.14.24

Minecraft

1.20.1

Relevant log output

No response

Other Mods

No response

commented

Having the same issue for Minecraft 1.20.1

commented

this issue is so bad it took me over an hour to start my server

unless that is fixed I cant use this mod

doesn't seem like they are, I had to remove the mod as well since it took over 20 minutes to start my server every time.

commented

this issue is so bad it took me over an hour to start my server

unless that is fixed I cant use this mod

commented

Yeah this is really bad. Also when it is "inspecting" it increases my memory usage from 3-4GB to 10GB and even when it has finished it never goes back to normal which is very problematic.

commented

Same issue here. Really hope that it gets fixed soon. It is as if BCLib thinks that a new version of itself has been installed, even when nothing changed.

You can prevent this behavior by disabling "applyPatches". Though that of course isn't ideal for shipping a modpack.

commented

Any updates? This really slows down the startup

commented

Can confirm this is happening on my end as well, pre-generating a world with Chunky exacerbates the issue rendering the server unusable.
latest.log

commented

pretty sure I figured out what the issue is quiqueck/WorldWeaver#12

commented

Hello. Exact same problem as @Steven-OConnell here on 1.20.1 also

commented

pretty sure I figured out what the issue is quiqueck/WorldWeaver#12

This PR was submitted for World Weaver which is still listed as Alpha and only available for 1.21, will this fix be pushed to BCLib as well. (preferably back to 1.20.1 at the very least as that's what most mod packs are still on)

Side note for anyone else who is looking for a fix for this issue, you can set the "applyPatches" property to False in the "main.json" to disable the DataFixer completely.
Oviously that's not an ideal solution, but having a mod effectively soft lock you're server isn't either.

commented

The issue was WorldWeaver having the config loading be done after BCLib tries accessing it for the last version the mod was on, so it shouldn't be an issue on versions that don't use wover?
This is actually happening on older versions as well?

commented

The issue was WorldWeaver having the config loading be done after BCLib tries accessing it for the last version the mod was on, so it shouldn't be an issue on versions that don't use wover? This is actually happening on older versions as well?

This issue was originally opened for 1.20.1, so If what you're saying is indeed the case then the problems that myself and the others in this thread have been experiencing may not be related to this fix.

The issue I've been seeing seems to stem from BCLib thinking there has been and update to either itself or a mod dependent on it, when in fact there hasn't.
You can see this in the log I posted above

Snip from lines 3583 & 3584
[14:53:45] [main/INFO]: [DataFixerAPI] Updating Patch-Level for 'betternether' from 0.0.0 to 9.0.1 [14:53:45] [main/INFO]: [DataFixerAPI] Updating Patch-Level for 'bclib' from 0.0.0 to 3.0.11

commented

yeah that's the same reason it was doing it in wover as well, maybe it was originally in bclib and then was copied over to world weaver? I'll see if I can find a similar thing in the 1.20.1 branch

commented

Ok so I have something that seemed to work?
I'm really not familiar with this codebase and just trying to fix something that's an issue on my own server xD, but 7c697d4 could serve as a starting point for the 1.20 fix?

For anyone who wants to test this out:

(I forked the 1.20 branch which I think works for 1.20.1 as well?)
Please, Please, PLEASE make at least 5 backups and another 5 backups of those backups xD
Then try downloading the build artifacts from here and unzipping only the bclib-3.0.15.jar file, not the ones with -javadoc or -sources at the end. Then use that jar instead of the BCLib version you downloaded from Modrinth or whereever.
Again, please make at least like 20 backups and I'm not at fault for any world corruption or anything.
If you experience a crash or anything like that, I guess just write about it in this issue so somebody who actually knows what they're doing can figure out how to correctly fix this :D

And now for the developers of BCLib:

I'm not gonna create a PR or anything because what I did could've broken like half the mod as I really don't know what I'm doing xD. Also this would need to be fixed on the 1.20, 1.20.3, (maybe more?) branches and me crating multiple PRs for one "simple" thing seems wrong.

Anyway for solving the problem:
The problem seems to be that in the MainMixin the applyWorldPatches method is called before setupWorld, which is what loads the bclib.nbt file containing the old patch version. I tried just moving the setupWorld call into the createAccess mixin, but that crashed when creating a new world (it needs to registry to be ready, which is what the mixin where it's currently at does). So currently in that commit I changed the WorldBootstrap.Helpers.initializeWorldConfig method to be public and removed the newWorld boolean as it was unused, so I could call that in the MainMixin before applyWorldPatches and it seems to work.

commented

Are there any updates on this for 1.20.1? It's pretty painful currently.

commented

Are there any updates on this for 1.20.1? It's pretty painful currently.

As a temp fix you can disable patches in main config of BCLib. It seems to disable that DFApi

commented

Are there any updates on this for 1.20.1? It's pretty painful currently.

As a temp fix you can disable patches in main config of BCLib. It seems to disable that DFApi

Thanks, would you happen to know what that setting actually does? I.e. would disabling it affect future world gen, etc?

commented

Are there any updates on this for 1.20.1? It's pretty painful currently.

As a temp fix you can disable patches in main config of BCLib. It seems to disable that DFApi

Thanks, would you happen to know what that setting actually does? I.e. would disabling it affect future world gen, etc?

I honestly have no idea haha. All I know is that it disables DFA

commented

Disabling it means that the dats fixer thing is disabled. The datafixer is only used when a new version of a mod is released and needs to change something about the existing world (for example a block gets renamed in an update and the old name needs to be replaced in the existing world so there wont just be air there) which, like mentioned by a dev here, most likely isn't going to happen soon with older versions so it would be fine

commented

I honestly have no idea haha. All I know is that it disables DFA

Disabling it means that the dats fixer thing is disabled. The datafixer is only used when a new version of a mod is released and needs to change something about the existing world (for example a block gets renamed in an update and the old name needs to be replaced in the existing world so there wont just be air there) which, like mentioned by a dev here, most likely isn't going to happen soon with older versions so it would be fine

Thank you both!

commented

same problem.