Tshock crashes on start

Discussion in 'Help and Support' started by Lunazaki, Jul 14, 2015.

  1. Lunazaki

    Lunazaki Level 0

    Joined:
    Jul 14, 2015
    Messages:
    3
    When I start Tshock it crashes before I can do anything with the following error message:
    07/14/15 11:34:21] [Server API] Verbose: TerrariaApi - Server v1.19.0.0 started.
    [07/14/15 11:34:21] [Server API] Verbose: Command line: "F:\Documents\Documents\New folder\tserver\TerrariaServer.exe"
    [07/14/15 11:34:21] [Server API] Verbose: OS: Microsoft Windows NT 6.1.7601 Service Pack 1 (64bit: True)
    [07/14/15 11:34:21] [Server API] Verbose: Mono: False
    [07/14/15 11:34:21] [Server API] Info: Plugin TShock v4.3.3.0 (by The TShock Team) initiated.
    [07/14/15 11:34:22] [Server API] Error: Server crashed due to an unhandled exception:
    System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at Terraria.Main.WorldListSortMethod(WorldFileData data1, WorldFileData data2)
    at System.Array.FunctorComparer`1.Compare(T x, T y)
    at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
    at System.Collections.Generic.ArraySortHelper`1.DepthLimitedQuickSort(T[] keys, Int32 left, Int32 right, IComparer`1 comparer, Int32 depthLimit)
    at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
    --- End of inner exception stack trace ---
    at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
    at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
    at System.Collections.Generic.List`1.Sort(Comparison`1 comparison)
    at Terraria.Main.LoadWorlds()
    at Terraria.Main.DedServ()
    at Terraria.ProgramServer.InnerStart(String[] args)

    It worked fine for a while before this happened.
    I have the right version of both Tshock and the .NET (4.3.5 and 4.5)
    I'm using WIndows 7 Ultimate
    Things I've already tried:
    Reinstalling Terraria
    Deleting and redownloading Tshock
    Restarting computer
    Scanning for viruses - None were found
     
    • Bad Reading Bad Reading x 1
    #1 Lunazaki, Jul 14, 2015
    Last edited: Jul 14, 2015
  2. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    716
  3. Lunazaki

    Lunazaki Level 0

    Joined:
    Jul 14, 2015
    Messages:
    3
    Thanks, the server works after deleting the worlds. For some reason I can't open any worlds in TEdit though.
    Also, I now get a different error after putting the world back in without opening it in TEdit:
    [07/14/15 12:14:16] [Server API] Verbose: TerrariaApi - Server v1.19.0.0 started.
    [07/14/15 12:14:16] [Server API] Verbose: Command line: "F:\Documents\Documents\New folder\tserver\TerrariaServer.exe"
    [07/14/15 12:14:16] [Server API] Verbose: OS: Microsoft Windows NT 6.1.7601 Service Pack 1 (64bit: True)
    [07/14/15 12:14:16] [Server API] Verbose: Mono: False
    [07/14/15 12:14:16] [Server API] Info: Plugin TShock v4.3.3.0 (by The TShock Team) initiated.
    [07/14/15 12:14:17] [Server API] Error: Server crashed due to an unhandled exception:
    System.ArgumentNullException: Value cannot be null.
    Parameter name: path
    at System.IO.Path.GetFullPathInternal(String path)
    at System.IO.File.InternalGetLastWriteTimeUtc(String path, Boolean checkHost)
    at System.IO.File.GetLastWriteTime(String path)
    at Terraria.Main.DedServ()
    at Terraria.ProgramServer.InnerStart(String[] args)
     
  4. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    716
    Gonna be honest with you: I've never seen that error before in my life. Try taking the spaces out of your directory (make sure that the folder names and filenames don't have spaces).
     
  5. Lunazaki

    Lunazaki Level 0

    Joined:
    Jul 14, 2015
    Messages:
    3
    There were no spaces, I guess I'll try reinstalling terraria and tshock again

    My guess is that my world is somehow corrupted.
    I suppose I'll have to start all over again
     
  6. nicatronTg

    nicatronTg Shank / hakusaro
    TShock Founder TShock Admin

    Joined:
    Jul 21, 2011
    Messages:
    716
    There's definitely a space in "New Folder."
     
  7. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,597
    This happens when your world metadata is broken and the server tries to find the last time the world was modified.
    Open the world in your Terraria client and it should fix the metadata
     
    • Useful Useful x 1
  8. Lughir

    Lughir Level 0

    Joined:
    Jun 8, 2016
    Messages:
    1
    I'm having the same problem, opening the world in the Terraria client works fine. However, this does not change anything about the errormessage, unfortunately.

    Code:
    D:\GameUtils\Tshock>TerrariaServer.exe
    TerrariaAPI Version: 1.22.0.0 (Protocol v1.3.0.8 (156))
    TShock 4.3.13.0 (Yoraiz0r R0cks) now running.
    AutoSave Enabled
    Backups Disabled
    Welcome to TShock for Terraria. Initialization complete.
    [Server API] Info Plugin TShock v4.3.13.0 (by The TShock Team) initiated.
    Terraria Server v1.3.0.8
    
    [Server API] Error Server crashed due to an unhandled exception:
    System.ArgumentNullException: Value cannot be null.
    Parameter name: path
       at System.IO.Path.GetFullPathInternal(String path)
       at System.IO.File.InternalGetLastWriteTimeUtc(String path, Boolean checkHost)
       at System.IO.File.GetLastWriteTime(String path)
       at Terraria.Main.DedServ()
       at Terraria.ProgramServer.InnerStart(String[] args)
    
    As can be seen, there is no space in the filepath (before there was, but it doesn't change anything). Anyone who has an idea?
     
  9. bigbuzieks

    bigbuzieks Level 0

    Joined:
    Jun 17, 2016
    Messages:
    1
    Dude Thanks that helped me alot
     
  10. kahadrin

    kahadrin Level 0

    Joined:
    Dec 5, 2016
    Messages:
    4
    im also having this issue, did anyone ever figure out how to resolve this?
     
  11. Elithas

    Elithas Level 1

    Joined:
    Nov 1, 2016
    Messages:
    5
    Code:
    [Server API] Error Server crashed due to an unhandled exception:
    System.ArgumentNullException: Value cannot be null.
    Parameter name: path
       at System.IO.Path.GetFullPathInternal(String path)
       at System.IO.File.InternalGetLastWriteTimeUtc(String path, Boolean checkHost)
       at System.IO.File.GetLastWriteTime(String path)
       at Terraria.Main.DedServ()
       at Terraria.ProgramServer.InnerStart(String[] args)
    
     
  12. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    See the above post:
    Otherwise you are using old version of TShock.