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

Blueprints did not load on startup resulting in number of errors #868

Closed
wellnesscookie opened this issue Jul 28, 2019 · 5 comments
Closed
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Milestone

Comments

@wellnesscookie
Copy link
Contributor

wellnesscookie commented Jul 28, 2019

Description

Describe the bug

We did not update our bbox or addons for more than a week, but this morning blueprints did not load. Our blueprints folder: http://prntscr.com/ol36xn
/bsb bp list - lists all blueprints fine, but bsb bp GUI will show none bundles.

Steps to reproduce the behavior

As we did nothing, I do now know what had happened in order to reproduce.
Error on startup:
https://gist.github.com/wellnesscookie/54fd655f5d81dfe0064a0b41502f6f33
Errors on /is or /is create or /is restart:
https://pastebin.com/V0Uh5ncU

Expected behavior

Load blueprints as any day it did before this

Environment

Server

  • OS: Linux Debian/ GNU 9
  • Java version: Java 10

Plugins

Plugins (50): AnimatedNames*, AreaShop, ArmorStandTools, BentoBox, BungeeTabListPlus*, ChatControl, ChestCommands, ChestShop*, ClearLag*, CrateReloaded, EditableSign, Essentials, EssentialsChat*, EssentialsSpawn*, ExecuteEverywhere*, FastAsyncWorldEdit*, FeatherBoard*, HeadDatabase*, HolographicDisplays, HungerKeeperPlus*, IPWhitelist*, IslandBorder, LeaderHeads*, LibsDisguises, LuckPerms, MobManager*, Multiverse-Core*, MVdWPlaceholderAPI*, NickRemover*, NoSleepCMDs*, OpenInv*, PlayerHeads, PlayerPoints*, ProtocolLib*, PvPManager*, PvPManagerBossBar*, RedstoneClockDetector*, RPGHealthIndicator*, SilkSpawners, SkinsRestorer, Spartan, TradeMe, TrophyHeads*, UnbreakingAnvils*, Vault*, VoidGenerator, WorldEdit, WorldGuard, WorldGuardPistonFix*, Yamler*

BentoBox setup

BentoBox and Addons
[16:06:34] [main/INFO]: [CHAT] Running PAPER 1.13.2.
[16:06:34] [main/INFO]: [CHAT] BentoBox version: 1.6.0-SNAPSHOT-b1241
[16:06:34] [main/INFO]: [CHAT] Loaded Game Worlds:
[16:06:34] [main/INFO]: [CHAT] acidisland (acidisland): Overworld, Nether, End
[16:06:34] [main/INFO]: [CHAT] skyblock (skyblock): Overworld, Nether, End
[16:06:34] [main/INFO]: [CHAT] Loaded Addons:
[16:06:34] [main/INFO]: [CHAT] AcidIsland 1.5.0 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] BentoBox-InvSwitcher 0.0.4 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] Biomes 1.5.0.0 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] BSkyBlock 1.5.0 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] Challenges 0.7.5 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] DimensionalTrees 1.1 - SerbCraft (ENABLED)
[16:06:34] [main/INFO]: [CHAT] Level 1.5.0 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] Limits 0.2.3-SNAPSHOT (ENABLED)
[16:06:34] [main/INFO]: [CHAT] SerbCraftAddon 2.4 (ENABLED)
[16:06:34] [main/INFO]: [CHAT] WelcomeWarps 1.5.0 (ENABLED)
Configuration
  • Database: mySQL

Additional context

@wellnesscookie wellnesscookie added Status: Pending Waiting for a developer to start working on this issue. Type: Bug labels Jul 28, 2019
@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Jul 28, 2019

They loaded fine after restart, but this was very odd and I'd like to keep the issue open until some1 can say what had happened and will it again.

Islands that failed to be pasted now have to be manually deleted with /bsb delete in order to fix it, otherwise unsafe teleportation message will be sent to all players that had their island created without the island self being pasted.

@tastybento tastybento self-assigned this Jul 28, 2019
@tastybento tastybento added Status: Under investigation Investigating the interest and the feasability of the issue. and removed Status: Pending Waiting for a developer to start working on this issue. labels Jul 28, 2019
tastybento added a commit that referenced this issue Jul 28, 2019
@tastybento
Copy link
Member

Yes, Blueprints manager was performing badly in that build. I fixed the issue yesterday in e009cf5.

The error you are seeing is caused by line 193 here. The blueprintBundles get results in a null and errors out. However, in line 164, blueprintBundles should have been initialized with the addon and so should not be null. I cannot see a logical reason why that variable would become null, however, I do know that I was seeing the loadBundles method being called multiple times async before I fixed it yesterday so there could have been some kind of race condition going on. Just in case, I've added some defensive code to make sure a null cannot happen in the commits referenced in this ticket. I recommend you use the latest build.

Apart from that, I see that in the very first line of the console log it looks like there is still a schems folder in your addon folder. That should have been removed or renamed a long time ago, so I'm not sure why it's still there. The error is that the plugin is unable to move it to the schems-converted folder - maybe that folder already exists. So, I recommend you remove the old schems folder now.

@tastybento tastybento added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: Under investigation Investigating the interest and the feasability of the issue. labels Jul 28, 2019
@wellnesscookie
Copy link
Contributor Author

Okay. The schems folder error is there for quite a time, but it copied them the first time blueprints build was used. Don't know why it didn't delete itself afterwards or whatever.

Anyway, thanks for this, we'll make sure we use the newest build, though this was very odd to happen since everyday before it worked perfectly.

@tastybento tastybento reopened this Jul 30, 2019
@tastybento
Copy link
Member

tastybento commented Jul 30, 2019

I found a way to replicate this and fix it. By repeatedly reloading the plugin I was able to trigger a situation like this. I don't know why doing that causes it, but I suspect that as the blueprint loading is async, it may be running multi-threaded at that point and a race condition will occur. So, anyway, I wrote the code in a way that it will not bomb out.

@tastybento
Copy link
Member

Okay, I found the root cause - the HashMaps need to be ConcurrentHashMaps so that they can be loaded in a thread safe manner. When the blueprint bundles are loaded from multiple addons it's possible for their to be a clash, e.g., AcidIsland and BSkyBlock are both loading at the same time and the write of one of them is lost because of this clash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants