Shopkeepers

Shopkeepers

2M Downloads

Disappearing Shopkeepers?

blablubbabcDEV opened this issue ยท 12 comments

commented

Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/322

Originally posted by quietlikeafox (Jun 15, 2015):

What steps will reproduce the problem?I have no idea to be honest. We have a lot of shopkeepers (around 20+) and they trade items like food, building materials and items that are enchanted with TimTheEnchanter (not vanilla enchants). The shopkeepers are made (mostly by me, the server owner) and they stick around for a decent period of time (a month) and then disappear with no Error logs.What is the expected output? What do you see instead?Expected output - The Shopkeepers spawn in with every restart
What I see - They disappeared completelyWhat version of the product are you using?Shopkeepers 1.46Do you have an error log of what happened?It didn't produce one.Please provide any additional information below.I read in the comments about a save.yml but the only thing in the Shopkeepers folder is the config.yml . Save-instantly is set to true but I'm not sure where it is saving to. This problem has happened about 4 times. Each time I just remake the shopkeepers but I decided to make a ticket this time. Do you need a list of what plugins I'm using? Thank you for looking at this and any help you can give. It is really appreciated.

commented

Originally commented by quietlikeafox (Jun 15, 2015):

I just made a shopkeeper and the save.yml just came up. Now to wait for an error?

commented

Originally commented by blablubbabc (Jun 15, 2015):

[at]quietlikeafox:
If you have save-instantly set to true (as it is by default) it should rewrite the save.yml with the latest shopkeeper data everytime you edit a shopkeeper.
So try adding the items which you usually add to your shops and check if you encounter an error in your server log while doing that. Also check for errors after reloading shopkeepers, in case an error happens during the loading of the save file.

        Edited Jun 15, 2015
commented

Originally commented by quietlikeafox (Jun 16, 2015):

The shopkeeper that I made had no problems over night. I have an old back up and I'm putting the old shopkeepers back in to see if I get an error. I did multiple restarts and reloads with the old shopkeepers in and I haven't gotten any errors. Also not having a save.yml makes more sense since there were no shopkeepers present to have a save.yml for and I just didn't pay enough attention to the things in the folder any time I went in there. Would Phatloots cause any problems?

commented

Originally commented by blablubbabc (Jun 15, 2015):

So the save.yml files doesn't get created at all for you? It should reside inside the shopkeepers folder next to the config.yml.
The only case I am aware of where this save file gets removed (and by that all shopkeepers as well), is if some error pops up during the saving, for example if it tries to save some custom item it is not able to save for some reason. It should also print an error stacktrace to your server log then though..
So maybe try setting up shopkeepers with all kinds of special/plugin created items you usually use / used in the past and see if any errors pop up in your server log for those items. Once you have found the conflicting item / the plugin which creates that item the issue can either be reported to the author of that plugin, or spigot.
The items which I am aware of which cause those issues are:
player heads with custom texture data (and no owner)
an item with a custom plugin-created enchantment (an enchantment which doesn't exist in default minecraft)

commented

Originally commented by quietlikeafox (Jun 15, 2015):

[at]blablubbabc:
I'll do that and keep a very close eye on it. I don't have player head shops but I am using TimTheEnchanter that puts enchants like Sharpness 10 and etc. on items. It doesn't put custom enchants on items. If it does I'm not using it like that. And no... no save.yml was ever made. Should I remove the plugin, download a new one and put it in?

commented

Originally commented by quietlikeafox (Jun 16, 2015):

[at]blablubbabc:
I guess file write permissions aren't an issue, as it saved successfully before already and you didn't mess with file permissions in the meantime.

I haven't messed with the config file or the 'save.yml' other than to replace it with an old copy that I had from an old backup of the server.
I guess you didn't create a folder named 'save.yml'.
No. When I made a new shopkeeper yesterday to test out the items themselves it made the 'save.yml' by itself. I think I got confused and thought it had never made one period. But since there were no Shopkeepers then I suppose there was no need for a 'save.yml' to be there.
Did you by chance removed/replaced the complete shopkeepers folder while shopkeepers/the server was running? If so, did the error pop up right at the next save, or did the error pop up later, with successful saves happening in the meantime?
The server was stopped when I put the backup of 'save.yml' into the Shopkeepers file. The error didn't happen after 2 restarts and a '/shopkeeper reload'.
When exactly did this error occur? Right after a reload/restart?
It happened about an hour and a half after a restart. I was working with WorldGuard and noticed that the 'save.yml' had been updated/edited/removed in the Dropbox.
Did some other program mess with the file (like open it) while the server was running / when the error occured? Not sure if something like Dropbox might cause issues here.. maybe you could disable syncing for that folder and try again for some while to see if it still happens.
The file was open in Notepad+ + while the server was running, but wasn't being edited. I don't see anything else interacting with the 'save.yml' other than it being deleted. I'll have to try disable syncing, putting the old 'save.yml' in and trying again. Seriously thank you for your help. Do you all have a donation link?

commented

Originally commented by blablubbabc (Jun 17, 2015):

[at]quietlikeafox:
Quote:The file was open in Notepad+ + while the server was running, but wasn't being edited.

I have just tried opening the save.yml file on a bunch of text editors while my local test server was running and saving to it (on windows 8, not sure how much differently linux behaves regarding locking files in this case etc.), and wasn't yet able to reproduce the error.
I really hope that the issue will not come up for you again with dropbox being disabled, because I am currently running out of ideas what could be causing it.. :(
Quote:Seriously thank you for your help. Do you all have a donation link?

No problem, however I don't feel like my help has resolved this issue yet.

Nevertheless, I have setup a donation link (hopefully it works, never done that before) and added it to the front page of Shopkeepers. There is also a link to the donation link of Nisovin (which is basically the same link as the one in the top-right corner of this page).

commented

Originally commented by quietlikeafox (Jun 17, 2015):

I removed all of my files from dropbox and so far that seems to have fixed the problem. Apparently the plugin doesn't like dropbox. Which is good to know. I guess I'll let you know if it happens again in the future?

commented

Originally commented by quietlikeafox (Jun 16, 2015):

I guess I got "lucky" and the error happened. I noticed that my dropbox said that the save.yml had been removed from Shopkeepers and when I checked the console it brought up the error. I think I did this pastebin thing correctly.
http://pastebin.com/5Uys1x1s
To be honest I don't understand it :S Let me know if you need more info though.

commented

Originally commented by blablubbabc (Jun 16, 2015):

[at]quietlikeafox:
Hm, this makes it even harder to find the issue if it only happens occasionally/randomly.

I am currently searching for issues/situations which might cause this error.
I guess file write permissions aren't an issue, as it saved successfully before already and you didn't mess with file permissions in the meantime.
I guess you didn't create a folder named 'save.yml'.
Did you by chance removed/replaced the complete shopkeepers folder while shopkeepers/the server was running? If so, did the error pop up right at the next save, or did the error pop up later, with successful saves happening in the meantime?
When exactly did this error occur? Right after a reload/restart?
Did some other program mess with the file (like open it) while the server was running / when the error occured? Not sure if something like Dropbox might cause issues here.. maybe you could disable syncing for that folder and try again for some while to see if it still happens.

commented

Originally commented by blablubbabc (Jun 17, 2015):

[at]quietlikeafox:
Great to know. The next update will include a few tiny changes in the saving handling, so that it retries the saving a few times (with tiny waiting in between) if it fails.
So if some program (like Dropbox) is locking the save file only for a very short duration (less than 500ms currently), Shopkeepers should be able to recover from that then.
It also attempts to check if writing to the save file is possible before removing the old save data, so hopefully the data doesn't get completely lost in the case that file removal is possible, but freshly writing the file (with the new save data) is not possible due to writing not being possible for some reason.
I will close this ticket now as fixed. Let me know if the issue happens again.

        Edited Jun 17, 2015
commented

Originally closed by blablubbabc (Jun 17, 2015)