So for some reason today I restarted my server only to have it throw errors at me. I merged over the FS Taming system and had it running no problem, even ran fine after being restarted once or twice. Then last night I spawned a bunch of new mobiles from the new scripts, saved, went to bed. Today started it up and am getting errors. Here they are:
Code:
----------------------------------------------------------------------------
ServUO - [http://www.servuo.com] Version 0.5, Build 5157.1903
Publish 54
Core: Optimizing for 6 64-bit processors
RandomImpl: CSPRandom (Software)
OpenUO Error: Client files not found.
Scripts: Compiling C# scripts...done (cached)
Scripts: Skipping VB.NET Scripts...done (use -vb to enable)
Scripts: Verifying...
Finished (4206 items, 1056 mobiles, 11 customs) (0.81 seconds)
ACC Registered: Server.ACC.CM.CentralMemory
ACC Registered: Server.ACC.PG.PGSystem
ACC Registered: Server.ACC.CSS.CSS
Regions: Loading...done
World: Loading...Error:
System.Xml.XmlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean prese
rveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(String filename)
   at Server.Accounting.Accounts.Load()
   at Server.WorldLoadEventHandler.Invoke()
   at Server.World.Load() in c:\ServUO\trunk\Server\World.cs:line 858
   at Server.Core.Main(String[] args) in c:\ServUO\trunk\Server\Main.cs:line 590

This exception is fatal, press return to exit

EDIT:: 2/19/2014 11:55 PM So I did some searching now that I had a bit more time, and I see a couple other threads saying this is from a corrupt accounts.xml file. I restored just that file from an earlier backup and the world will load, but immediately after throws some errors and closes the server immediately, then restarts it right after. Is this because I cannot just restore the accounts.xml file without restoring everything else as well? I would normally not care about this and just restore my most recent backup, but I did about 3 hours worth of spawning new mobiles so I would like to save that work if possible. Any thoughts on this would be much appreciated.


EDIT2:: 2/20/2014 12:11 AM Alright well, I did some digging in my ServUO folder under Automatic backups starting restoring them each to see where each one was at. The 2nd most recent one had about 80% of my work I had done last night still on it, so I'm just going to restore it from there and call it good. Just to note restoring ONLY the accounts.xml file did NOT work for me, I had to restore all the folders including Accounts, Mobiles, Items, Attachments, etc. Since i'm not sure how automatic backups work on ServUO, if you have this issue I would suggest backing up your current ServUO folder immediately even if it's not working currently, because it may contain automatic backups that could be overwritten if you keep trying to reload your server over and over. Then try restoring your backup saves in the Backups/Automatic starting with most recent and working your way back. Hopefully you can get most of your work restored as I did.
 
Last edited:
Did you get this all sorted out?


I restored just that file from an earlier backup and the world will load, but immediately after throws some errors and closes the server immediately, then restarts it right after
When the server does this it also creates crash logs in the root folder that might help with why it's crashing. I've never tried to restore only accounts file but I have deleted every except the accounts file plenty of times to start fresh without having to recreate my accounts.

ServUO also comes with Emergency Backup program that you can setup to do permanent backups that won't get wiped out from the server restarting over and over. I can dig up my code for this that does 2 daily backups if you need to see how it works.
 
Found my old code for enabling emergency backups. http://craftuo.com/threads/emergency-backup-system.190/#post-1469

Kalamus said:
Add this line to the top of AutoSave.cs:
C#:
using System.Diagnostics;

Find this section:
C#:
public static void Save(bool permitBackgroundWrite)
{
    if (AutoRestart.Restarting)
        return;

    World.WaitForWriteCompletion();

    try
    {
        Backup();
    }
    catch (Exception e)
    {
        Console.WriteLine("WARNING: Automatic backup FAILED: {0}", e);
    }

    World.Save(true, permitBackgroundWrite);
}

Add this code to it:
C#:
public static void Save(bool permitBackgroundWrite)
{
    if (AutoRestart.Restarting)
        return;

    World.WaitForWriteCompletion();

    try
    {
        Backup();
    }
    catch (Exception e)
    {
        Console.WriteLine("WARNING: Automatic backup FAILED: {0}", e);
    }

    World.Save(true, permitBackgroundWrite);

    string emergencyBackupDir = Path.Combine(Core.BaseDirectory, @"Backups\Emergency");
    string emergencyBackupFile = EmergencyBackupTimeStamp() + ".7z";
    string savesDir = Path.Combine(Core.BaseDirectory, "Saves");

    if (!File.Exists(Path.Combine(emergencyBackupDir, emergencyBackupFile)))
    {
        if (File.Exists(Path.Combine(Core.BaseDirectory, "EmergencyBackup.exe")))
        {
            Console.WriteLine("Starting Emergency Backup.");
            ProcessStartInfo startInfo = new ProcessStartInfo();
            startInfo.WorkingDirectory = Core.BaseDirectory;
            startInfo.FileName = Path.Combine(Core.BaseDirectory, "EmergencyBackup.exe");
            startInfo.Arguments = string.Format("{0}{1}{0} {0}{2}{0} 3", "\"", savesDir, emergencyBackupDir);
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            startInfo.CreateNoWindow = true;
            Process.Start(startInfo);
        }
    }
}

private static string EmergencyBackupTimeStamp()
{
    DateTime now = DateTime.Now;

    string dayNight;

    if (now.Hour < 12)
        dayNight = "Morning";
    else
        dayNight = "Night";

    return String.Format("{0}-{1}-{2}-{3}", now.Year, now.Month, now.Day, dayNight);
}
 
Awesome thanks! I've got mine sorted out now but setting up a more thorough automated backup system should definitely help in the future. The strange thing was that my accounts.xml file just went blank. I opened it up to see what was going on and the corrupted one just had nothing in it. The size of the file was still larger than my older accounts.xml files, which is a little weird to me as if it contained no data anymore it should be smaller.
 
If anyone wants to use the emergency backup using the code posted by Kalamus and gets these errors try renaming 7z64.dll to 7z.dll in the base directory. It did the trick for me.
 
Back