goatcorp / FFXIVQuickLauncher

Custom launcher for FFXIV
https://goatcorp.github.io/
GNU General Public License v3.0
2.85k stars 334 forks source link

Dalamud crashes on launch with "The file exists" error #332

Closed Jessidhia closed 3 years ago

Jessidhia commented 3 years ago
System.IO.IOException: The file exists.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
   at XIVLauncher.Dalamud.DalamudLauncher.Download(String addonPath, Boolean staging) in D:\Sapphire\FFXIVQuickLauncher\XIVLauncher\Dalamud\DalamudLauncher.cs:line 195
   at XIVLauncher.Dalamud.DalamudLauncher.Run(DirectoryInfo gamePath, ClientLanguage language, Process gameProcess, Boolean doDownloads) in D:\Sapphire\FFXIVQuickLauncher\XIVLauncher\Dalamud\DalamudLauncher.cs:line 103
   at XIVLauncher.Dalamud.DalamudLauncher.DoWork(Object state) in D:\Sapphire\FFXIVQuickLauncher\XIVLauncher\Dalamud\DalamudLauncher.cs:line 48
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)
Version: 5.2.0.0
Git Hash: 7f46f54
Context: Unhandled
OS: Microsoft Windows NT 6.2.9200.0
64bit? True
DX11? True
Addons Enabled? True
Auto Login Enabled? True
Language: English
LauncherLanguage: English
Game path: ...\steamapps\common\FINAL FANTASY XIV Online

Addons: []

It looks like the code tries to guard against this issue with an .Exists() check but it seems GetTempFileName() just throws an exception instead. Now, why would GetTempFileName() throw an error...

goaaats commented 3 years ago

Make sure there's space on your hard drive, clear out your temp folder, then try again - see if it still errors out

Jessidhia commented 3 years ago

There was, uh, an impressive amount of mostly 0KB files named tmp[0-9A-F]{1,4}.tmp, going all the way to FFFF; however, deleting only (all of) them did not help with the error... I kept deleting more things from %temp% and then eventually it started working, not sure what exactly I deleted that helped.

Jessidhia commented 3 years ago

After updating plugins and then closing the game, a tmpE572.tmp file was left in the %temp% dir; the contents are a PE file (well, dll): image

It seems that there are some temp file leaks around...

goaaats commented 3 years ago

I doubt this is a problem with XIVLauncher, but if it comes up again we'll have a look.

Jessidhia commented 3 years ago

The error has returned again, this time when using the patch installer; at any rate, using the official launcher to finish patching and then using quick launcher again got the same error. There's some file leak somewhere, in either the launcher or Dalamud...