Player shopkeepers missing with 2.14
FatherWh0 opened this issue ยท 7 comments
Preliminaries:
- Shopkeepers version: `2.14.0'
- Spigot version: `paper #77 1.18.1'
- I have checked that my issue/question does not get answered by:
- The documentation.
- The FAQ.
- The Known Issues.
- I have checked all open and closed issues, but none seems to fit my issue/question.
Reproduction on a fresh and up-to-date Spigot server:
I was <able >
to reproduce my issue on a freshly set up and up-to-date Spigot server (currently <Insert output of /version command on up-to-date Spigot server>
) with the latest version of Shopkeepers (currently <Insert latest tested Shopkeepers version>
), with no other plugins and with no kinds of other server or client mods.
The issue: From the 2.14 snapshot to the 2.14.0 release Player shopkeepers are missing, those attached to chests. Only admin shopkeepers are spawning. There are no console errors.
Provide a detailed description of your problem and add as much information as possible which could help to reproduce the issue.
I updated to 2.14 snapshot with my update to 1.18.1 and the player shopkeepers are not spawning. Their chests can be opened by any player. I didn't post of coarse, being a snapshot.
Unfortunately, I updated to the 2.14.0 and the shopkeepers are still missing.
There are no errors in the log.
Include:
- Description of the issue.
- Step-by-step instructions on how to reproduce the issue.
- Observed behavior.
- Expected behavior.
- If items with special attributes are involved: Include instructions on how to create those items.
- Server logs (from server startup until issue). Consider enabling debug mode in the config for additional console output.
- If modified from default: Plugin configurations.
- ... Anything else that might be useful to reproduce and identify the issue.
Player shops work fine for me on v2.14.0. And although there is the potential for upgrades to and from snapshot version to not work, I did not encounter any issues while developing the v2.14.0 release, during which I regularly switched from one version to the next until I reached reached the v2.14.0 release version. So I am currently also not aware of any backwards incompatible changes in this chain of snapshot to release versions.
I will need more information.
Unfortunately, since you didn't report this issue right away, it is difficulty to retrospectively figure out what initially caused your player shops to break. What I would need to do that would be:
- The original non-v.2.14.0 version you started the upgrade from.
- Your save.yml file from that version.
- The exact v2.14.0-SNAPSHOT version you upgraded to.
- The server startup log from this upgrade, to check for any errors.
- The save.yml file after this partially failed upgrade attempt.
However, right now, I am not sure this debugging is worth the trouble. Maybe we can instead resolve the issue by getting your player shops to spawn again, without having to fully debug what initially caused them to break.
There are two possibilities:
- Maybe the data for these player shops is still fine, but something is preventing from getting loaded. In that case, I need:
- Your current
save.yml
file. - The startup section of your server log when running the v2.14.0 release version.
- Your current
- Maybe some issue during the upgrade to the snapshot version corrupted the data of your player shops. In that case you hopefully still have a backup from before you upgraded to the Shopkeepers snapshot version. There are two more possibilities then:
- You reattempt the upgraded with this backup version. However, this will revert the state of all admin shopkeepers to that of your backup version.
- If you know that there have been changes to your admin shops since you started using the snapshot versions, and you want to retain those changes, we need to merge your current save file with your backup file. I.e. we need to remove the corrupted data of all player shops from your current save file and instead the previous player data from your backup save file. If your save files contain many shopkeepers, this will be painful to do manually. In that case we would need to write some kind of script to do the player shop data replacement.
I would suggest we start investigating possibility 1 and check if the player shop data is still fine, but something is preventing it from loading. So to start with that I need the information listed above.
If your player shop chests got already severely griefed, because they were no longer protected while you ran the snapshot version without the player shops being loaded correctly, I am not sure how I can help, other than hoping that you still have some backup of your world and player files with which you could revert to the previous world state.
Sadly there is no backup from b4 the 1.18 upgrade. It was too long ago.
https://pastebin.com/ZfDW6YK
save.zip
there is the current save with the missing shopkeepers.
Thank you very much for your help.
The log you sent is already expired again.
However, I am able to load your save file on v2.14.0 without any errors. However, it might very well be that it no longer contains the data for the player shops that you are missing. Currently it contains the data of 69 shopkeepers. There are some player shops, but most of them, except at least one, are empty (they have no trade offers set up). These player shops that are found inside the save file load fine.
Sadly there is no backup from b4 the 1.18 upgrade. It was too long ago.
Without a backup, and without the save file still containing the data for the player shops, I doubt that there is anything that can now be done to restore these player shops ..
For the future, I would suggest you check for issue after upgrades right away, and also keep backups around for longer than a few weeks. But this won't help in your situation right now.
The only thing that remains now is to investigate what caused these player shops to disappear, so that if this was caused by a bug in the Shopkeepers plugin, that the issue can at lease be prevented to occur again in the future or for other servers.
For this, your server logs would be very helpful, from the time you performed the upgrade up until you noticed that player shops are gone. Do you by chance still have these server logs around?
If this are a lot of logs, or you suspect that they might contain sensitive data, you can also send them privately, e.g. via Discord or a PM on either dev.bukkit.org or spigotmc.org.
There have been some refactors in v2.14.0 related to the removal of player shops of inactive players. Do you use this feature? If yes, check if the inactivity time configured inside the config is still setup the way you expect it to be. Also please send me your config file. I will check if I can spot any bugs that might have been introduced with these refactors. In addition, your logs might very helpful to check if there is some issue with this feature, since the plugin logs whenever it removes shops of players that it detects to be inactive.
Also, if you still have the exact snapshot version you initially upgraded to (either the plugin jar file, or a version number that contains the commit hash, maybe extracted from one of your server logs), that would be useful as well. Maybe it contained some changes that were later reverted again in subsequent snapshots.
Another potential problem might have been that you accidentally ran the server with two versions of the plugin (i.e. 2 plugin jars). Since the two jars contain a plugin with the same name, I think the server then randomly picks one of these jar files. However, it is undefined which one it picks, and it might even pick differently with every server start / reload. One potential issue with this could then have been that you once ran the snapshot version, which migrated your save data for the next version. And then after a server restart, the server picked the other, older plugin jar. If this has been the case, it is unclear if and how this might have affected the save data. The newest Shopkeepers version has a better check to detect plugin downgrades that might affter the save data. But this has been improved only very recently.
Make sure that you only have one Shopkeepers plugin jar inside your plugins folder.
I identified one potential bug that could in theory have resulted in the incorrect deletion of player shops. However, the conditions to trigger this bug are so specific that I currently consider it to be very unlikely to actually have caused this issue.
The conditions are as follows:
- The plugin is being reloaded.
- The still pending asynchronous task that checks for inactive players is somehow taking longer than 10 seconds to complete (how many shop-owning players do you have on your server? In my tests this task never took longer than a fraction of a second, but I have not tested this with very large amounts of shop owners yet).
- During the reload, the
player-shopkeeper-inactive-days
setting is changed from some non0
value to0
(i.e. disabled).
If all of these conditions are met, there was a chance for shop owners to be incorrectly considered as 'inactive' and their shopkeepers deleted. Do these conditions sound like they might have applied in your case?
Other than that I was not able to spot any problems with the code related to the deletion of inactive player shops that could explain this issue.
In either case, if these player shops were deleted by this feature, you should be able to find corresponding entries inside your server logs.
If this is a one-off that only happened to me
Without having identified the cause of why this happened to you, I cannot assess how likely it is for you or anyone else to encounter this issue again in the future. But I can understand if you don't want to spend any more time on investigating the cause of this issue if it cannot help restore your lost player shop data.