User Error/Bug Related to Restore Point Caused Data Loss?

Hi everyone, I’ve been using MineOS for around a week so far, I’ve been extremely impressed with it - it’s astonishing to see a Linux distribution and server application package that’s so easy to install and configure.

I hit my first problem yesterday, which was probably mainly user error (and ignorance) but the UI didn’t prevent me from making a big mistake. I have hourly automatic Restore points created and I wanted to test it out so that I could use it with confidence if I needed to in future.

Here are the steps I took (times are rough guesses):

07:00 Started playing Minecraft
08:50 Decided to try the Restore function
09:10 Quit Minecraft and with the Server still running (perhaps this was my mistake?) I clicked on the 09:00 Restore point.

There doesn’t appear to be any feedback to the user when the button is pressed. I’m still not entirely sure what action is taken.

09:15 Connected to the server again (I have not restarted the server at all) and played for the next three hours
12:15 Stopped playing and quit Minecraft
12:20 I decided to restart the server as the memory usage was getting high and I wondered if that would reduce.
12:25 Connected to the server again to check all was okay - I’d lost the last three hours of changes to the world!! The world was as it was at 09:00.

I tried using the restore points at 12:00, 11:00 and 10:00 - they were all the same as 09:00.

This seems like a big vulnerability to me. I’m still not entirely sure what the procedure should be. I’m guessing I should have stopped the server, clicked a restore point and then started again? Perhaps the Restore buttons should be disabled unless the server is stopped. Also it would be good to have a ‘Are you sure?’ prompt and some kind of feedback to the user that an action has taken place.

Any thoughts or advice please?

Hi.
An active server has all the changed files in memory, and the backup function backups data written to disc. The server writes to disc when a player exits, a player (with the proper ridghts) uses the “save-all” command, or when you use command “stop” (the same as using the stop button in MineOS). MineOS Node has a function fr periodic saves, unless you left that field blank, where MineOS do not force a save-all.

Now let me break this down for you to see if we can discover where the potential fault happened:
07:00 create restore from saved data
07:00 start playing
08:00 create restore from saved data
09:00 create restore from saved data
09:10 exit server, trigger “save-all” by player exit
09:10 click “restore” using the 09:00 point (this overwriting the 09:10 saved files)
09:15 start playin
10:00 create restore from saved data
11:00 create restore from saved data
12:00 create restore from saved data
12:15 exit server. trigger “save-all” by player exit
12:20 restart server
12:25 connect to server, find 09:00 world.
after this tried restoring using 10, 11 and 12 points.

Ok as you can see, the 10, 11, and 12 points may not have been different from the 09:00, since you where actively playing, and the server had not actually saved the world data to disc and just keeping it in memory. you had a written data at 09:10, but this got overwritten by the restore of the 0900 point.

It is difficult to explain why the server reset itself after a restart. It would help to know which version of MineOS you are running. There are two main versions available now: MineOS python, and MineOS Node. the python version is really defunct, and the node version is recommended. There is a new version under dev, but is has not been released yet.

If I remember correctly it was possible to select a feature called “restore on boot” in older versions of MineOS. In the node version this is removed as it is really not a good function, and it is confusing. It actually ran the restore function from the latest restorepoint. Older versions did not have the “save-all at intervals” function. This is what I want to figure out. If your server is of an older version with the “restore on boot” and “save all at intervals” functions, this can explain why your server reset itself to the 09:00 point. If not there is something else going on…

Hi, thanks for your helpful and informative reply, I appreciate your time.

Firstly, what version am I using? - I downloaded the latest MineOS Turnkey distribution using the link in the Wiki - “Current 64-bit ISO download” based on Debian “Jessie”. I’m struggling to find a mention of version number from the WebUI until I clicked on the user name at the top and selected “git commit:d9a604b”, which took me to a page on github.com hexparrot/mineos-node “bumped express to 4.14.x” on Oct 13 2016. Hopefully that confirms that this is MineOS Node?

Your breakdown looks correct. I was pondering over the “save-all” setting. In the server status window there is a ‘60’ in the “Save-all” box, but I’m not able to change this value. I definitely want to be sure that a restore point is created after a save has been performed. I have changed my archiving time from every 4 hours to 1 hour until I can be confident that this doesn’t happen again (I am performing the save-all and archive function). I have archives for 8am and 12pm and sadly the 12pm version was showing 9am state too.

Just to be clear, I didn’t reboot the machine, the only thing that was restarted was the Minecraft Server using the red Stop button -> Restart. I haven’t changed any “restore on boot” settings, but then it sounds like the version I have doesn’t have this feature anyway.

Hopefully these details can start to narrow things down a little?

Yes, it seems you have the node version. It is a bit dated, so you can use this to update : How to properly update mineos-node

That probably not be the solution to your error, that is just a sidepoint. It do however clear out a host of other bugs :slight_smile:

@hexparrot (creator of MineOS) may have to correct me if I am wrong, but I think that the greyed out “60” in the “save-all” setting is to be considered an example and a suggestion. For it to actually be set, you must write a number there. I suggest something around 60 for it to match your backup timer.

In your minecraft server directory there is a configuration file that contains all information MineOS uses to control your minecraft server:

/var/games/minecraft/servers/(servername)/server.config

In this file you will find a few settings that may not be instantly obvious or available in the WebUI
Please check this file to see if the following settings are there, and what they are set to:

[onreboot]
restore=false
start=true

It is not certain that the setting “restore=” is there, but if it is make sure it is set to “false”.

You should also see a “commit_interval”, this is the “save-all” setting.

Another thing to check (one of the “I’m not stupid you know” things;D) is if the disks on your MineOS server is full or not. Minecraft will happily continue to let you play and create even though the disks are full, but it will discard all new changes from memory when you stop the server, if it can’t write them to disk (I lost about a month of minecraft that way. My players where not happy…)

1 Like

Stupid question, but how do I determine what version of MineOS I’m running? Thanks for the link with the details on performing the update - I followed this and to my eyes it looks like I was already at the latest version (unless I’m misinterpreting the output - copied below)?

root@mineos games/minecraft# git fetch
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 43 (delta 31), reused 34 (delta 22), pack-reused 0
Unpacking objects: 100% (43/43), done.
From https://github.com/hexparrot/mineos-node
   d9a604b..1190870  master     -> origin/master
 * [new tag]         v1.1.7     -> v1.1.7
root@mineos games/minecraft# git reset --hard origin/master
HEAD is now at 1190870 Fireworm tracking (#235)
root@mineos games/minecraft# npm install
adm-zip@0.4.7 node_modules/adm-zip

To me it looks like the current version was v1.1.7 and the latest version that will be installed is also v1.1.7 but I’m not very familiar with any of this!

I had a look in server.config and there is no ‘restore’ parameter listed. Also, there is no ‘commit_interval’ parameter listed. Should this be added? What’s the correct syntax to achieve this?

[java]
java_xmx=2048
java_xms=2048
jarfile=minecraft_server.1.11.2.jar

[onreboot]
start=true

[minecraft]
broadcast=true
profile=1.11.2

The disk is definitely not full - it’s reporting 5.5% usage. What a nightmare for you losing a month of Minecraft!! Wow so sorry to hear that. I’ll definitely keep an eye on the disk usage!

I think I’ll need to see if I can recreate this bug in a repeatable way on a test world/server. I’m still not happy with how the restore feature works. Is there any documentation on the correct procedure?

Thanks for your help and advice!

You are doing the version detection right.
You are on the node version, and the current version is the git release when you pull down the “user” menu in th etop corner. The lates version is 7 days old and is git:1190870, which is the one you just upgraded to :slight_smile: (MineOS’s GIT-hub: https://github.com/hexparrot/mineos-node)

That the “restore” parameter is missing is good. This means that you rserver should not restore on reboot. If you want to be sure you can add the following line under [onreboot]:

restore=false

To define the commit interval it should really just be enough to add the wanted number of minutes in the box in the WebUI. If you want to do it manually you may add the following line under [minecraft]:

commit_interval=60

the number is the number of minutes the interval spans. You can put whatever number you like, and that fits your backup plans there :slight_smile:

1 Like

To be honest, I use the archive function daily instead of the backup function:D This means I never really got into the spesific problem you experienced.

MineOS uses rsync to do its backups, and gzip to make archives. I think that by forcing an hourly save your will head off that problem.

@hexparrot:
Would it be an idea that the backup function forced a save-all before running the backup?

1 Like

Thanks again. When I check the version number now it still takes me to the same GitHub page (git: d9a604b). Is it necessary for me to restart after installing the update?

The weird thing about the ‘Save-all’ box in the GUI is that it’s disabled (read only) and so I can’t change the value from 60.

Thanks. I liked the idea of incremental backups to save on disk space, but it’s a 120GB SSD and if I keep on top of pruning the archives then I agree that it’s probably a better option for me!

The scheduled backup feature that I have selected does a ‘save-all’ first and I’ve seen this pop up whilst playing and in the logs. :slight_smile:

Yep, you have to restart the MineOS webui for the update to take hold. simply run the following command as root:
service mineos restart

This restarts only the WebUI, and leaves your minecraft servers running :slight_smile:
You also have to refresh your browser to make sure it has loaded a fresh copy and not running of a cached copy.

You are right. That is weird. In my installation the 60 is greyed out, but I may overwrite it with my wanted save-all interval (usually 60), which makes it black. I always think of the grey 60 as a reccomendation and exampel more than an actual value. But that you cant even add a number there is weird. try again after restarting the WebUI? Or simply try just clikcing in the frame and enter a new value?

hi JamesPearson and iMelsom,

please confirm what you have set to back-up every hour.

is it /var/games/minecraft/servers/[servername]/backups

or /var/games/minecraft/backup

or /var/backups

for those of us following at home.

thanks!

tNt

Hm. If it saves first, and you saw it pop up ingame, and you still experienced that the savepoint was lagging behind on an old timepoint there is something else wrong. That error would mean that minecraft is not actually writing to disc when it tries a save-all, since MineOS’s backup function backs up written data (using rsync).

Possible explanations:

  1. full disk (you have chekced this, and you are far from full).
  2. a problem with rights, minecraft do not have the rights to write to disk. This usually happens if you use one user to create the server, and another to manage it, and they are not in the same user group, or have the right to use each others files and folders. The biggest NONO is to use the root user to do anything in the WebUI or in shell (other than updates of system and WebUI, and restarts of those two). Using root to create minecraft servers gives really weird behaviour, including loss of data…
  3. a bug or error in the minecraft jar. This error we cannot do anything about until Mojang (or the ones making your chosen minecraft server version) releases a new version hopefully fixing this error.

Thanks for the service restart command! I haven’t done it yet…

…firstly I tried again to change the ‘save-all’ parameter and I can overwrite it! I’m so sure I couldn’t do that before. Oh well, never mind. Thanks for making me look again!

Sorry, I’m muddying the waters here. When I had the problem occur it was the restore points that were not behaving. At that time I was performing an Archive every 4 hours and I didn’t choose the ‘save world’ version of this for some reason. I have subsequently chosen this and I have it archiving every hour.

Oh yes, guess what? I am using ‘root’ to do everything! It was a mistake I made at the beginning when I first logged in and I didn’t realise there was a ‘mc’ user. I’ve been meaning to rectify this based on the recommendations in various documentation but I’ve not got around to doing that yet. I didn’t realise it could have such severe consequences!

I’m learning from my mistakes :slight_smile: and thanks for your guidance. I will delete the server and create it again as the ‘mc’ user.

I’ve also acquired a new server, which I’m currently installing Debian on. I’m going to try installing MineOS on this and further my education. I think doing it from scratch might inform me better than using the simple Turnkey solution. :blush:

1 Like

Hi tNt, I am using the scheduling function from within the MineOS GUI. I have the following CRON:

0 */1 * * *

and I’m using the ‘Command to run’:

save-all then create archive

Hope this helps. I’m very new to this so take my advice with a large pinch of salt! :slight_smile:

Good luck :slight_smile:
I ran down the ubuntu server path and installed MineOS on top. Works like a charm, and I am not going back :smiley:

1 Like

imho the distinction is important to your conversation.

i hate to interupt and correct me if i’m wrong but the “Minutes between committing world to disk via ‘save-all’ (empty to disable)” save-all function describes /var/games/minecraft/servers/[servername]/backups, are saved as 2017-01-04-09-11-06.zip and inside is a ‘world’ save. it can be set to every hour.

restore is a whole server backup including any save archives in /var/games/minecraft/backup, can not be set to every hour and is to be performed manually (except via cron script).

thanks again!

tNt

i did the vmware headless server controlled via vsphere on my laptop for a server with multiple os options including turnkey mineos.

so all 3 are different, lol.

cheers!

tNt

@tNt:
Both backup and archive only handles written data. Both need a “save-all” to get the most resent changes.

Backup uses rsync to take a backup of all new and changed files, leaving unchanged files alone. This gives a smaller footprint of each savepoint. Backups are stored in /var/games/minecraft/backup.
Read more about rsync here: https://www.linode.com/docs/tools-reference/tools/introduction-to-rsync

Archive uses gzip (tar) to create something called a “tarball” containing all the files in a server directory. Since each archive contains the entire server directory, they grow rather big as the world grows. Archives are stored in /var/games/minecraft/archives.
Read more about gzip and tar here: https://www.howtogeek.com/248780/how-to-compress-and-extract-files-using-the-tar-command-on-linux/.

Both use compression to minimize disk usage, but as I said, since minecraft usually handles all gaming and changes to the world in memory, both need a save-all to be able to get all the latest changes. If a save-all is not done, only changes written to disk is archived or backed up.

hmmm, the only place i found a ‘world’ saved to my disk every hour was in /var/games/minecraft/servers/[servername]/backups (since disabled)

not /var/games/minecraft/backup

and not /var/games/minecraft/archives

anyway, JamesPearson needs to stop using root for everything, lol.

cheers!

tNt

You are for the most part running FTB-style servers (if my memory serves me correctly). They come with all sorts of mods, including auto backups. Those backups are stored in the minecraft server directory and not hanlded by MineOS.

Mineos is pretty clear in how it handles it files:

in /var/games/minecraft/ there are the following direcotries:

  • archive : Containint all archive copies created by MineOS
  • backup : Containing all backups created by MineOS
  • import : directory you place the minecraft server archive files you wish to import as a new server
  • profiles : repository for all profiles you have downloaded
  • servers : Where MineOS places all active minecraft servers and their files.

Archive, backup and server is sorted in subdirectories named by each minecraft server then have files from.

So if a server has a plugin or mod that creates its own backups, they are placed in the “servers/[servername]/backup” directory, not the “backup/[servername]” or “archive/[servername]” direcotries

1 Like