Dynmap-Forge/Fabric

Dynmap-Forge/Fabric

888k Downloads

Markers reset on server restart when usign MySQL for map

alurosu opened this issue ยท 9 comments

commented

I've set up a Minecraft 1.16.1 with the latest PaperMC server with Dynmap-3.1-beta-2-spigot. The map is saved in a remote MySQL database.

I can add/remove markers with no issues. When I restart the server it clears everything new saved in the MarkerFiles table. When I stop, the data is there.

{"sets": {"player_markers": {"hide": false,"circles": {},"areas": {},"label": "Player Markers","markers": {"dog--161-220-world": {"markup": false,"x": -161.20491496670442,"icon": "sign","y": 64.0,"dim": "16x16","z": 220.32777644624107,"label": "Turtles!! "}},"lines": {},"layerprio": 0},"markers": {"hide": false,"circles": {},"areas": {},"label": "Markers","markers": {"_spawn_world": {"markup": false,"x": -196.0,"icon": "world","y": 72.0,"dim": "16x16","z": 261.0,"label": "Spawn"}},"lines": {},"layerprio": 0}},"timestamp": 1596263059605}

But when the server starts, the data is overwritten with default I guess:

{"sets": {"player_markers": {"hide": false,"circles": {},"areas": {},"label": "Player Markers","markers": {},"lines": {},"layerprio": 0},"markers": {"hide": false,"circles": {},"areas": {},"label": "Markers","markers": {"_spawn_world": {"markup": false,"x": -196.0,"icon": "world","y": 72.0,"dim": "16x16","z": 261.0,"label": "Spawn"}},"lines": {},"layerprio": 0}},"timestamp": 1596262006614}

Is there a way I can fix the markers and still keep the map loaded in the database?

Later Edit: the same thing happens regardless if the data is saved in MySQL or not, I tested a default setting and I have the same issue

commented

@alurosu no longer the case in beta-4-617 (1.18.1), markers persist after restart, update and retry. If it still happens to you please reopen this

commented

Duplicate of #1936

commented

I have tested a little bit and found out something that might help. When I manually add markers with OP I used this command:

/dmarker add id:<id> <label> icon:<icon> set:<set-id>

In the "set:" argument I used both "player_markers" (which I created) and the default "markers". After restart only the custom set "player_markers" was emptied. The default was intact.

In my plugin I have:

dapi = (DynmapAPI) pluginManager.getPlugin("dynmap");
if (dapi!=null) {
player_markers = dapi.getMarkerAPI().getMarkerSet("player_markers");
if (player_markers == null)
player_markers = dapi.getMarkerAPI().createMarkerSet("player_markers", "Player Markers", dapi.getMarkerAPI().getMarkerIcons(), false);
}

I don't know what to make of this? Do you have any ideas?

commented

Thats good data, did you ever use the /dynmap reload command? I'vve noticed that causes the markers config to become incredibly unstable and has been a reported bug for awhile

commented

I didn't use /dynmap reload. I stopped the server and then ran the java -jar paper.. command.

As a workaround I am using player_markers = dapi.getMarkerAPI().getMarkerSet("markers"); where the markers are not deleted.

commented

No errors when I stop:

[20:27:14 INFO]: [dynmap] Disabling dynmap v3.1-beta-2-389
[20:27:14 INFO]: [dynmap] Unloaded 11 components.
[20:27:14 INFO]: [dynmap] Stopping map renderer...
[20:27:14 INFO]: [dynmap] Saved 3 pending tile renders in world 'world'
[20:27:14 INFO]: [dynmap] Disabled
[20:27:14 INFO]: [Vault] Disabling Vault v1.7.2-b107
[20:27:14 INFO]: Saving players
[20:27:14 INFO]: Saving worlds
[20:27:14 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[20:27:14 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[20:27:15 INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[20:27:15 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:27:15 INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[20:27:15 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:27:15 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[20:27:15 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:27:15 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:27:15 INFO]: Flushing Chunk IO
[20:27:15 INFO]: Closing Thread Pool
[20:27:15 INFO]: Closing Server

I don't think it's related. The markers are overwritten when the server starts. At least that's what I can see in the database. Can you reproduce my bug?

commented

oh strange, so your error is on startup but not on server closing?

Can you enable verbose logging for dynmap in the configuration.txt and pastebin the startup log? (be sure to redact sensitive info)

commented

I can only help with a local run. Can't restart the live server that is connected to the database. The markers disappear even locally, so that should not be a problem. Here's the pastebin: pastebin.com/iyeyLCnd

I said that the issue is on start because I think the database didn't update on stop. That's what I remember. I can't test that at the moment. So maybe ignore that part considering that the bug happens locally as well (with no db connection).

commented

Great thanks for this. Its very helpful in narrowing down the issue- I'm fairly new to the dynmap team and still learning the backend but I hope to figure this out as its a very common issue with many causes (one of which was the /dynmap reload command)

I've nailed it down the an issue with certain operations that close dynmap and more often than not its papermc servers not spigot servers. Im wondering if its related to the issue in #3066

Are there any shutdown errors from dynmap in the log?