Trying to debug a broken server folder


  • I'm trying to debug after the crash last night which seemed to result from the post apocalyptic world (seems to require way more processing than prior) and I'm not really sure how to go about it since I am unfamiliar with the code and I don't actually see any when I open the debug in Visual Studio 2015.

    This is what I get each time I try to run the server code now:

    ___________________________________________________________________________________.
    [56:46 Eco.Plugin] Initializing EcoSim...

    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Ionic.Zip.ZipException: Could not read Storage\time.eco as a zip file ---> Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00000000) at position 0x00000000
    at Ionic.Zip.ZipEntry.ReadHeader(ZipEntry ze, Encoding defaultEncoding)
    at Ionic.Zip.ZipEntry.ReadEntry(ZipContainer zc, Boolean first)
    at Ionic.Zip.ZipFile.ReadIntoInstance_Orig(ZipFile zf)
    at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
    --- End of inner exception stack trace ---
    at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
    at Ionic.Zip.ZipFile._InitInstance(String zipFileName, TextWriter statusMessageWriter)
    at Ionic.Zip.ZipFile..ctor(String fileName)
    --- End of inner exception stack trace ---
    at Ionic.Zip.ZipFile..ctor(String fileName)
    at Eco.Plugin.Serialization.DataStore..ctor(String name, ISerializer serializer)
    at Eco.Simulation.EcoSim..ctor()
    --- End of inner exception stack trace ---
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
    at System.Activator.CreateInstanceT
    at Eco.Server.Plugins.PluginManager.AddPluginT
    at Eco.Server.Plugins.PluginManager..ctor()
    at Eco.Server.MainClass.Main(String[] args)

    ___________________________________________________________________________________.

    and Visual studio just tells me:

    "TargetInvocationException was unhandled"

    Since it looks like the problem was a corrupt time.eco file, I tried replacing it (after backing it up of course) and just got this:

    ___________________________________________________________________________________.

    [19:32 Eco.Plugin] Loading plants finished in 39 ms

    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Ionic.Zip.ZipException: Could not read Storage\animals.eco as a zip file ---> Ionic.Zip.ZipException: Cannot read that as a ZipFile ---> Ionic.Zip.BadReadException: Bad signature (0x00000000) at position 0x00000000
    at Ionic.Zip.ZipEntry.ReadHeader(ZipEntry ze, Encoding defaultEncoding)
    at Ionic.Zip.ZipEntry.ReadEntry(ZipContainer zc, Boolean first)
    at Ionic.Zip.ZipFile.ReadIntoInstance_Orig(ZipFile zf)
    at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
    --- End of inner exception stack trace ---
    at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
    at Ionic.Zip.ZipFile._InitInstance(String zipFileName, TextWriter statusMessageWriter)
    at Ionic.Zip.ZipFile..ctor(String fileName)
    --- End of inner exception stack trace ---
    at Ionic.Zip.ZipFile..ctor(String fileName)
    at Eco.Plugin.Serialization.DataStore..ctor(String name, ISerializer serializer)
    at Eco.Simulation.AnimalSim..ctor()
    --- End of inner exception stack trace ---
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, Boolean nonPublic)
    at System.Activator.CreateInstance(Type type)
    at Eco.Simulation.EcoSim.<Load>b__32_0(Type type)
    at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.<ForWorker>b__1() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
    at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
    at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body)
    at Eco.Simulation.EcoSim.Load()
    at Eco.Simulation.EcoSim..ctor()
    --- End of inner exception stack trace ---
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
    at System.Activator.CreateInstanceT
    at Eco.Server.Plugins.PluginManager.AddPluginT
    at Eco.Server.Plugins.PluginManager..ctor()
    at Eco.Server.MainClass.Main(String[] args)

    so it seems that there is more than one thing broken. I figured I would test to see if my computer was the problem, so I extracted from the original backed up zip file and opened from there and everything works perfectly so something happened that broke everything.

    I tried restoring the backup I made right before, but when I load it in the new server and log in there are no items (aside from the default I start with), it's day one, and I seem to be in an empty world with animals floating in the sky. I'm also not sure which files specifically do what, but if I could find some documentation to the source and files and what does what I could probably figure out exactly where the break is.

    For reference, in case anyone has a fresh perspective:

    See world backup here:
    https://drive.google.com/file/d/0B4_9hPPWxAWBdldod3lEZVZ4amc/view?usp=sharing

    See broken server backup here:
    https://drive.google.com/file/d/0B4_9hPPWxAWBNkZpZnJtazNrbW8/view?usp=sharing

    P.S. - I'm not sure if I am allowed to post these. It's all broken, so I figured it would be no harm, but I can delete it immediately if this is a problem. Having an entire server corrupt after an impact and/or computer crash is a problem though, especially if nothing can be restored.

    Oh, and I don't NEED to get the old world working. I was just testing it out. It's just that I'd like to figure out WHY things melted down on me.


  • 5
    Posts
    3839
    Views
    Log in to reply


  • It looks like the zip file became corrupted, somehow. This isn't supposed to happen, but its not really feasible to debug once it does. I will try and take a look with your broken backup.



  • Ok, thanks. The only reason I am interested in this is specifically because it's not supposed to happen. There has to be a cause, and I'd consider bugs that can corrupt an entire server beyond recovery pretty serious.



  • It is, hopefully the backup plugin will result in losing at most 1 hour worth of time from the server.

    Its not supposed to happen in the sense that generally the way a zip file gets corrupt is if the application crashes while writing to the zip file. The server handles this by writing to a temp file, and then renaming that file once the save is complete. Something might we wonky there though.



  • Well, the corruption likely happened when the computer crashed. Right after the impact happened (which was also a bug since the impact was disabled in server settings) I made a backup of the server before exploring the after impact world. The thing is, something wonky happened since the processor appears to have over heated - which has never happened before - and it seems like the server required so much more processing post impact than pre impact. The way the crash happened - an overloaded CPU - may have had something to do with it. Still, even in that scenario, there should be a mechanism to recognize "hey, I'm corrupted!" and tell the user that it needs to be restored from the last known good backup, and maybe backup all the files that could possibly be written to just in case.

    What is even stranger is the problem restoring from that backup. I also think it is interesting that manual backups are in one file, but the folder shows multiple. I guess it writes to the different files separately so that it can write to more than one at a time as needed. Were you ever able to get the backup to load?


5
Posts
3839
Views
Log in to reply

Internal error.

Oops! Looks like something went wrong!