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

Duplicate islands in database #505

Closed
wellnesscookie opened this issue Jan 30, 2019 · 20 comments
Closed

Duplicate islands in database #505

wellnesscookie opened this issue Jan 30, 2019 · 20 comments
Assignees
Labels
Status: Monitoring Monitoring the issue to see if it is fixed or if more information becomes available Type: Bug
Milestone

Comments

@wellnesscookie
Copy link
Contributor

wellnesscookie commented Jan 30, 2019

Description
Random players happen to lose access to their islands. They are able to go /is and teleport to them, but unable to interact with chests, place & break blocks, or so (Even owners).

Steps to reproduce the behavior:

  1. We receive complains on a player being unable to interact on his island, as he is not a part of it. So we investigate and find out next:

  2. We type /bsbadmin info <owner/member> (Considering specified player is the one complaining)

  3. See picture of: /bsbadmin info player - everything looks alright. (Keep watch on the island location and coordinates)

  4. We teleport to the island and type /bsbadmin info (*While standing on it)

  5. See picture of: /bsbadmin info - The island is recognized as unregistered (Free/Available). Comparing these pictures and island locations, it's obvious that it's the same island.

  6. All of the bugged islands seem to pop up in this list: https://pastebin.com/PLGsPrRc .

Expected behavior
Players not loosing access to islands and being unable to interact with the same.

Server Information:

  • Database being used:
    MySQL

  • OS:
    Debian GNU/Linux 9

  • Java Version:
    Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
    Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

  • Addons installed?
    [23:30:32] [main/INFO]: [CHAT] Bentobox version: 1.2.1-SNAPSHOT
    [23:30:32] [main/INFO]: [CHAT] Loaded Game Worlds:
    [23:30:32] [main/INFO]: [CHAT] skyblock (skyblock)
    [23:30:32] [main/INFO]: [CHAT] Loaded Add-Ons
    [23:30:32] [main/INFO]: [CHAT] BSkyBlock 1.2.0
    [23:30:32] [main/INFO]: [CHAT] Biomes 0.4.1
    [23:30:32] [main/INFO]: [CHAT] ASBwarp 1.0
    [23:30:32] [main/INFO]: [CHAT] Challenges 0.3.1-SNAPSHOT
    [23:30:32] [main/INFO]: [CHAT] WelcomeWarps 1.1-SNAPSHOT
    [23:30:32] [main/INFO]: [CHAT] Level 1.1-SNAPSHOT

  • Other plugins?
    [06:32:17 INFO]: 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*

Additional context
*We couldn't figure out when does it occur, but we suspect it does on server restart.
*Necessary translations are provided on the picture. (Vlasnik=Owner; forgotten)
*How we get to recover islands?

  1. We ask the owner to kick all members from his team
  2. We unregister the island with /bsbadmin unregister (Owner)
  3. We reRegister the island to him, and the problem is resolved. They reinvite each other. Both commands show information propertly, they have gained full access to theirs island once more.

*It doesn't happen twice with same islands, or at least it did not until now, but we get this problem from time to time. (1 complain every 2/3 days)

@tastybento
Copy link
Member

Thanks for the comprehensive bug report. The overlapping island log is the most important.

Now, I don't know why there would be overlapping islands, that root cause will need to be discovered. I'm hoping this is something that has been fixed, but it may still be occurring.

One issue that must be addressed is that the overlapping islands are not being cleared from the database. They will hang there forever causing problems and depending on the loading order, it could be that the zombie island gets loaded first blotting out the genuine island. So, they need to be removed or quarantined. I've opted to quarantine them by adding a do-not-load flag to the island object. This is more of a safety thing than anything and at some point, I'll add a purge command to clean up the database.

With this change, there may still be some thrashing until duplicate islands cleaned out because it's just random as to which get loaded first and I can't tell which one is a zombie or which is genuine. Anyway, it should decline over time and you should stop seeing the duplicate island warnings. If you don't then something is still generating them and we need to find out what.

Thanks for your help.

@tastybento tastybento changed the title Players loosing access to their islands Duplicate islands in database Jan 31, 2019
@tastybento tastybento added this to the 1.2.1 milestone Jan 31, 2019
@Poslovitch
Copy link
Member

To tell which one is potentially a zombie, what about getting the most recent "login" of one of its members?

@tastybento
Copy link
Member

@Poslovitch Hmm, maybe. You'd need to check all the members of both islands and create a score to decide the winner. Would that be a good result?

Hopefully, this issue should never occur, but for some reason it did. If we can fix the root cause then hopefully, this'll be moot. I'll reopen this and see if the issue reoccurs after the bad islands are flushed out of the system.

@tastybento tastybento reopened this Jan 31, 2019
@tastybento tastybento added the Status: Monitoring Monitoring the issue to see if it is fixed or if more information becomes available label Jan 31, 2019
@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Feb 14, 2019

Hmm, it seems that players are still losing their islands due to this.

But this time we are unable to locate them with /bsbadmin tp . It leads to the newly generated one.
Previously, /is command tp-ed them to the island, even though they weren't able to interact with things. This player said it generated a new island for him - Could it be due to the quarantine picking up the one and only that has data?

Hmm, any help? At least if we could get a list of quarantined ones with coordinates or a way to find them?

Since now we do not have any useful data about that island. Player did not screenshot or write down coordinates of it, so that alternative is already gone. Therefore we cannot re-register islands to them now. We know that those islands are out there - somewhere

@tastybento
Copy link
Member

Yes. The one that will be loaded first is random. It could be the wrong one. I can write a quarantine handler.

Note to self : create a new Island Manager for quarantine islands.

tastybento added a commit that referenced this issue Feb 14, 2019
@YellowZaki
Copy link
Contributor

It is also happening to me the overlapping issue but unlike OP, users when do /is are not teleported to the Unowned island, a new island is created for them instead. In addition, /bsbadmin info shows the new island, not the unowned.

@tastybento
Copy link
Member

Yes. The latest version is a lot cleaner. The reason Op sees that is because he has older data in the database. What i’m working on this weekend are commands to see the islands in the trash and switch to them if the admin wants to do that.

Poslovitch pushed a commit that referenced this issue Feb 17, 2019
* WIP - adds admin commands to handle damaged island db

Trash, purge, etc.

DO NOT MERGE YET

#505

* Prefixes the island uniqueId with the game mode name.

This enables manual removal of old game mode island files from the
database by admins if required.

* Adds Admin trash and empty trash commands

* Adds various commands for trash management

* Remove unused imports

* Forgot the javadoc in IslandsManager
@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Feb 18, 2019

Another case, I think caused by the same problem, but now when the island with no information was quarantined:

  • We received a complain on player being unable to interact with his island
  • I checked /bsbadmin info MoneyMen - He has the island
  • I tp-ed to him, wrote /bsbadmin info - It says: "You are not on an island", umm.. Not sure how to make it recognised as an island. I checked for bedrock, it was there. I destroyed and replaced with a new one, but still...
  • I did /bsbadmin unregister MoneyMen. When I tried to /bsbadmin register the island I'm standing on to him it said: `
    -There is no island. Confirm to create one.
    -I confirm the command again
    -There is no island. Confirm to create one
    -And it keeps going
    See: http://prntscr.com/mmn10f

Now everyone is not able to generate their island with /is command, even after restart.

It says: Generating new island... - And nothing happens

We still do not have access to the trash commands even though we updated to the latest build a few hours ago. It says that the /bsbadmin trash command does not exists, have you forgotten it?

@baticag
Copy link

baticag commented Feb 18, 2019

Currently I am monitoring database and seeing something interesting.
There are 2 objects with different uniqueIds for the same location of island.
https://i.imgur.com/SPThvaw.png

Sending you both:
Island 1: https://pastebin.com/ArvpjbZB
Island 2: https://pastebin.com/QxapKfy2

Some players are complaining that they lost their islands:

  • He is on his island, he can't do anything
  • I teleport to him by /tp NICK
  • Output of /bsbadmin info is that I am not on island
  • Output of /bsbadmin register NICK is that he already has an island
  • Output of /bsbadmin tp NICK is that no safe warp is found
    Screenshot of all this: https://i.imgur.com/4aYwqYb.png

@tastybento
Copy link
Member

@batica the island files show they are at different coordinates. One is -8400.

@Poslovitch
Copy link
Member

@tastybento Maybe the code is considering this as a duplicate island?

@tastybento
Copy link
Member

@postlovitch I don’t see any evidence of that. I think Batica just made a mistake.

It is not possible to load an island from the database if it has the same center location or overlapping locations. If a duplicate is found, it is marked as “do not load” and put into the island trash. The admin can then look at islands in trash using the admin trash command. The trash and empty trash and switch commands are in the latest build.

If duplicates exist in the database then there is no guarantee what order they will be loaded. It may be the bad island that gets loaded first. In that case the trash command will reveal the legitimate island and the admin can take action like registering the player to the island.

In general, the best way to fix issues like this is to do /bsb trash on the player and see if they have duplicates in trash. If so, run /bsb switchto to put them on the correct island and then empty the trash. If there’s issues use unregister and register.

Dupes can happen in the database - hopefully rarely and most likely due to system crashes or something - but when they do dupes will be quarantined in trash now and admins can use the trash and switchto commands to hopefully fix the issue.

@baticag
Copy link

baticag commented Feb 19, 2019

I missSAW the differents in coordinates that is correct, but that isn't the only thing I wrote in comment. Please see the part of players complaining that they lost their island.

Island trash command isn't registered or something like that, because when we try to use it with latest build, it doesn't exist.

Also @wellnesscookie wrote some additional info and if you can respond to his comments that would be great.

I must say that we now have 3 big problems:

  1. Players can't generate new islands
  2. Islands can't be registered
  3. Players are loosing their islands

@tastybento
Copy link
Member

@baticag understood. I cannot say how the issue happened from your report but it could have been from a previous bug where there are duplicate islands. What likely has happened in this case is that when the server restarted the incorrect island loaded and the player’s island was put in trash. Then when he logged in his island is to put it simply messed up. The best handling for now is to unregister him. Go to the correct island and register him again. But how do you know what the correct island coordinates are? That’s where the trash comes in. Those commands have only just been merged so please wait for a release. In the meantime you can look for islands owned by the player in the database manually.

@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Feb 19, 2019

Hello again, Batica and I come from the same server, so we are talking about the same problem.
Went to the bugged island, wrote /bsbadmin info, it spoke "You are not on an island" - http://prntscr.com/mnbtaq

I just tried as u said:
Unregistering the island with /bsbadmin unregister while standing on it:

If you meant unregistering with /bsbadmin unregister player, well, that's where this part from comment above comes: http://prntscr.com/mnbvsy
This is new, the island is not even recognized as an island? A few days ago, it always went to 'Available/ Unregistered' status.

Tell us if we can help somehow else, we had already offered our database files, configurations and worlds to Poslovitch and you on the discord, but he said he cannot use them since they are SQL based.
http://prntscr.com/mncapr

PoslovitchToday at 7:54 PM
@BONNe1704 nah, it doesn't. And i don't have a web server on my desktop

@wellnesscookie
Copy link
Contributor Author

Discord message:

I just started my localhost to do some tests, and guess what....

database:
    type: YAML
    host: localhost

https://pastebin.com/eidVrwJU

Poslovitch:

Poslovitch Today at 7:04 PM
YAML...
Okay, so SQL databases cannot be blamed
Now, our new culprit may be IslandGrid
We're going forward... forward...

@tastybento
Copy link
Member

Thanks for the support @wellnesscookie. I'm not sure if you're always using the latest builds from the CI, but if you are it's a risk because there will be bugs in there. I would recommend not using them unless we do a release, or unless you like living on the edge. Recently, I made a bug that causes a lot of overlapping islands. Maybe this is the problem. I just fixed it, but there could be more.

I also just fixed another bug with the unregister command - it always requires a name of the player to be in the parameters. (Right now anyway).

@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Feb 21, 2019

@tastybento
Is generation is failing with error in console: https://pastebin.com/sVsESSZw
Every single island in /bsbadmin trash is unowned, and players that had their islands lost cannot be found with /bsbadmin trash, as there it says they do not have any of them in it.
List of all trash islands: https://pastebin.com/ASL0n5xf

Found something what Batica mentioned earlier, but they are in trash.
Discord message: http://prntscr.com/moba7y

I was also looking at the whole list of trash islands, and some of them are recognised as islands on /bsb info, while for others is just said that I am not on an island. I suppose the data fix didn't really fix, hmm... We would like to give it a chance or two more before letting go.

EDIT:
Deleting every island from this list https://pastebin.com/sVsESSZw from database manually allowed us to generate only 1 island, while on next one: https://pastebin.com/SzsRe0Dp

@tastybento
Copy link
Member

Here's some info for you that may help (I'm on a plane so I can't do much right now except web):

Islands in the trash are marked with a field in the database as "donotload = true". So if you want to flush trashed islands you can remove those.

Yes, islands in the trash can have exactly the same coordinates - that's what they are - duplicates.

If you see islands in /bsb info then those are ones that are not in trash - those are the ones that are loaded.

So, just to sum up - islands that are loaded exist in bsb info. If during loading an overlapping or duplicate island is found it is put into the trash. There may be multiple of these. Once everything is loaded, you can do /bsb trash (player) to see if the player has any islands in the trash. If the one in the trash is their "real" island then you can switch them to it using /bsb switchto (number). Once they're in the correct place, I recommend emptying their trash by doing /bsb emptytrash (player).

Now, if the whole database is messed up, I'm really sorry. It may be that any fixes we tried couldn't recover things.

@wellnesscookie
Copy link
Contributor Author

wellnesscookie commented Feb 22, 2019

@Poslovitch , @tastybento ,

wellnesscookie Today at 12:55 AM

  • We won't be doing a database reset, at least not now.
  • We are taking a risk with http://prntscr.com/moenp4 and for now, it seems okay.
  • The generation of new islands has been migrated to +120k in both x and z start coordinates.

The responsibility is on us, and I suppose this is a green light to releasing an official 1.3.0 unless you find something other blocking it now. I think you can flag #505 as done, or not if the core problem of the issue still needs to be monitored.

Thank you for all the help by now, we hope we did contribute anyhow with the above mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Monitoring Monitoring the issue to see if it is fixed or if more information becomes available Type: Bug
Projects
None yet
Development

No branches or pull requests

5 participants