HearthSim / Hearthstone-Deck-Tracker

A deck tracker and deck manager for Hearthstone on Windows
https://hsreplay.net/downloads/
4.61k stars 1.11k forks source link

Crash after migrating to new system #4232

Open solomongrundy6 opened 3 years ago

solomongrundy6 commented 3 years ago

Bug report

I recently migrated my install to a new system by using the backup feature in the settings of HDT. Worked fine, all stats and decks and options seemed to migrate fine. However, now upon finishing a ranked game, HDT will crash.

Expected Behavior

No crashing

Actual Behavior

Crashing

Steps to reproduce behavior

Playing a ranked game

Log/Screenshots

Here is a crash log from this issue, they all seem to have the same error (Illegal characters in path).

########## 2/8/2021 11:20:08 PM ##########
System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.Combine(String path1, String path2)
   at Hearthstone_Deck_Tracker.Stats.GameStats.get_HasReplayFile() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\GameStats.cs:line 386
   at Hearthstone_Deck_Tracker.Stats.LastGames.<>c.<Load>b__27_0(GameStats x) in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\LastGames.cs:line 135
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Hearthstone_Deck_Tracker.Stats.LastGames.Load() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\LastGames.cs:line 135
   at Hearthstone_Deck_Tracker.Stats.LastGames.get_GameInfos() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\LastGames.cs:line 37
   at Hearthstone_Deck_Tracker.Stats.LastGames.Add(Guid deckId, Guid gameId, String hero) in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\LastGames.cs:line 86
   at Hearthstone_Deck_Tracker.Stats.LastGames.Add(GameStats game) in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\Stats\LastGames.cs:line 82
   at Hearthstone_Deck_Tracker.GameEventHandler.SaveAndUpdateStats() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\GameEventHandler.cs:line 761
   at Hearthstone_Deck_Tracker.GameEventHandler.HandleInMenu() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\GameEventHandler.cs:line 95
   at Hearthstone_Deck_Tracker.LogReader.Handlers.LoadingScreenHandler.Handle(LogLine logLine, IHsGameState gameState, IGame game) in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\LogReader\Handlers\LoadingScreenHandler.cs:line 69
   at Hearthstone_Deck_Tracker.LogReader.LogWatcherManager.OnNewLines(List`1 lines) in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\Hearthstone Deck Tracker\LogReader\LogWatcherManager.cs:line 144
   at HearthWatcher.LogWatcher.<Start>d__18.MoveNext() in D:\a\Hearthstone-Deck-Tracker\Hearthstone-Deck-Tracker\HearthWatcher\LogWatcher.cs:line 62
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Logfile: C:\Users\Luigi\AppData\Roaming\HearthstoneDeckTracker\Logs\hdt_log.txt

Here is the tail end of my hdt_log when the error occurs - the timestamps lead me to believe the tracker crashes when it tries 'Saving DeckStats'?

8:40:14 PM|Info|GameEventHandler.HandleTurnStart >> --- Player turn 15 ---
8:40:14 PM|Info|Player.Draw >> [Player] id=39, cardId=BT_249, cardName=Scrap Golem, zonePos=5,Info={turn=15, originalZone=DECK, hasOutstandingTagChanges=true, OriginalController=2, latestCardId=BT_249}
8:40:17 PM|Info|GameEventHandler.HandlePlayerHeroPower >> PlayerHeroPower (id:UNG_934t2 turn:15 from:-1)
8:40:21 PM|Info|Player.PlayToGraveyard >> [Opponent] id=64, cardId=HERO_01, cardName=Garrosh Hellscream, zonePos=0,Info={turn=15, originalZone=DECK, OriginalController=1, latestCardId=HERO_01}
8:40:21 PM|Info|GameEventHandler.HandleWin >> --- Game was won! ---
8:40:21 PM|Info|TurnTimer.Stop >> Stopping turn timer
8:40:21 PM|Info|GameEventHandler.HandleGameEnd >> Game ended...
8:40:21 PM|Info|GameEventHandler.HandleGameEnd >> Format: Wild
8:40:21 PM|Info|GameStats.GameEnd >> Current Game ended after 15 turns
8:40:21 PM|Info|GameEventHandler.HandleGameEnd >> Assigned current game to deck: Taunt Warrior 20XX
8:40:22 PM|Info|LogUploader.Upload >> Uploading 312676859...
8:40:22 PM|Info|LogUploader.TryUpload >> Creating upload request...
8:40:22 PM|Info|LogUploader.TryUpload >> Upload Id: NHfK2RuxxeJv2eQz8VGMnC
8:40:22 PM|Info|LogUploader.TryUpload >> Upload complete
8:40:25 PM|Info|LogUploader.Upload >> 312676859 complete. Success=True
8:40:34 PM|Info|GameV2.CurrentMode >> TOURNAMENT
8:40:35 PM|Info|DeckImporter.FromConstructed >> Found 17 decks, 0 new
8:40:35 PM|Info|GameEventHandler.HandleInMenu >> Game is now in menu.
8:40:35 PM|Info|OverlayWindow.SetTopmost >> Overlay is topmost after 1 tries.
8:40:35 PM|Info|GameEventHandler.SaveAndUpdateStats >> Saving DeckStats
8:41:54 PM|Info|Updater.SquirrelUpdate >> Checking for updates (ignoreDelta=False)
8:42:16 PM|Info|Updater.SquirrelUpdate >> No new updated available
8:45:57 PM|Info|MainWindow.Window_Closing >> Shutting down...
solomongrundy6 commented 3 years ago

I managed to find a workaround for this issue - I initially tried reinstalling from the zip instead of the installer, and adding exceptions in the virus scanner just in case, but the problem persisted. I eventually then uninstalled it again, and just manually copied both the old install folder and my old Roaming\HearthstoneDeckTracker folders instead of using the backup function inside HDT. I have not gotten the error again since.