Nexus-Mods / Nexus-Mod-Manager

GNU General Public License v2.0
982 stars 165 forks source link

Creating installation backup crashes NMM with The given path's format is not supported exception #119

Closed IlanF closed 6 years ago

IlanF commented 7 years ago

Trying to create a mod list backup (tools menu -> backup and restore -> create installation backup) and getting this error

Nexus Mod Manager has encountered an error and needs to close.

Exception: 
Message: 
    The given path's format is not supported.
Full Trace: 
    System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at Nexus.Client.ModManagement.CreateBackupTask.DoWork(Object[] p_objArgs)
   at Nexus.Client.ThreadedBackgroundTask.RunThreadedWork(Object p_objArgs)
   at Nexus.Client.Util.Threading.TrackedThread.RunParameterizedThread(Object p_objParam)
   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)

TraceLog20170627185645.txt

Tried backing up to the same drive NMM is installed on, and to 2 other drives, also tried starting NMM as administrator and running the same backup, same results.

TraceyC77 commented 6 years ago

Just got this error as well

Wasdsensei commented 6 years ago

Getting this error every time the program tries to open, after having made a backup.

Tracelog follows: Trace file has been created: TraceLog20180209182713.txt Mod Manager Version: 0.63.14.0 OS version: Microsoft Windows NT 6.1.7601 Service Pack 1 Installed .NET Versions: CDF SP 0 v2.0.50727 SP 2 v3.0 SP 2 v3.5 SP 1 v4 SP 0 v4.0 SP 0 v4.5: 4.6 or later Tracing is forced: True

Discovering Game Mode Factories... Looking in: D:\Program Files\Nexus Mod Manager\GameModes Checking: BreakingWheel.dll Initializing: Nexus.Client.Games.BreakingWheel.BreakingWheelGameModeFactory Checking: DarkSouls.dll Initializing: Nexus.Client.Games.DarkSouls.DarkSoulsGameModeFactory Checking: DarkSouls2.dll Initializing: Nexus.Client.Games.DarkSouls2.DarkSouls2GameModeFactory Checking: DragonAge.dll Initializing: Nexus.Client.Games.DragonAge.DragonAgeGameModeFactory Checking: DragonAge2.dll Initializing: Nexus.Client.Games.DragonAge2.DragonAge2GameModeFactory Checking: DragonsDogma.dll Initializing: Nexus.Client.Games.DragonsDogma.DragonsDogmaGameModeFactory Checking: Fallout3.CSharpScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Fallout3.CSharpScript.dll: cannot find dependency CSharpScript, Version=1.1.6310.19283, Culture=neutral, PublicKeyToken=null Checking: Fallout3.dll Initializing: Nexus.Client.Games.Fallout3.Fallout3GameModeFactory Checking: Fallout3.XmlScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Fallout3.XmlScript.dll: cannot find dependency AntlrUtil, Version=1.1.6310.19282, Culture=neutral, PublicKeyToken=null Checking: Fallout4.CSharpScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Fallout4.CSharpScript.dll: cannot find dependency CSharpScript, Version=1.1.6310.19283, Culture=neutral, PublicKeyToken=null Checking: Fallout4.dll Initializing: Nexus.Client.Games.Fallout4.Fallout4GameModeFactory Checking: Fallout4.XmlScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Fallout4.XmlScript.dll: cannot find dependency AntlrUtil, Version=1.1.6310.19282, Culture=neutral, PublicKeyToken=null Checking: FalloutNV.CSharpScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\FalloutNV.CSharpScript.dll: cannot find dependency CSharpScript, Version=1.1.6310.19283, Culture=neutral, PublicKeyToken=null Checking: FalloutNV.dll Initializing: Nexus.Client.Games.FalloutNV.FalloutNVGameModeFactory Checking: FalloutNV.XmlScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\FalloutNV.XmlScript.dll: cannot find dependency AntlrUtil, Version=1.1.6310.19282, Culture=neutral, PublicKeyToken=null Checking: GamebryoBase.dll Checking: Grimrock.dll Initializing: Nexus.Client.Games.Grimrock.GrimrockGameModeFactory Checking: Morrowind.dll Initializing: Nexus.Client.Games.Morrowind.MorrowindGameModeFactory Checking: NoMansSky.dll Initializing: Nexus.Client.Games.NoMansSky.NoMansSkyGameModeFactory Checking: Oblivion.dll Initializing: Nexus.Client.Games.Oblivion.OblivionGameModeFactory Checking: Skyrim.CSharpScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Skyrim.CSharpScript.dll: cannot find dependency CSharpScript, Version=1.1.6310.19283, Culture=neutral, PublicKeyToken=null Checking: Skyrim.dll Initializing: Nexus.Client.Games.Skyrim.SkyrimGameModeFactory Checking: Skyrim.XmlScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\Skyrim.XmlScript.dll: cannot find dependency AntlrUtil, Version=1.1.6310.19282, Culture=neutral, PublicKeyToken=null Checking: SkyrimSE.CSharpScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\SkyrimSE.CSharpScript.dll: cannot find dependency CSharpScript, Version=1.1.6310.19283, Culture=neutral, PublicKeyToken=null Checking: SkyrimSE.dll Initializing: Nexus.Client.Games.SkyrimSE.SkyrimSEGameModeFactory Checking: SkyrimSE.XmlScript.dll Cannot load D:\Program Files\Nexus Mod Manager\GameModes\SkyrimSE.XmlScript.dll: cannot find dependency AntlrUtil, Version=1.1.6310.19282, Culture=neutral, PublicKeyToken=null Checking: Starbound.dll Initializing: Nexus.Client.Games.Starbound.StarboundGameModeFactory Checking: StateOfDecay.dll Initializing: Nexus.Client.Games.StateOfDecay.StateOfDecayGameModeFactory Checking: TESO.dll Initializing: Nexus.Client.Games.TESO.TESOGameModeFactory Checking: WarThunder.dll Initializing: Nexus.Client.Games.WarThunder.WarThunderGameModeFactory Checking: Witcher2.dll Initializing: Nexus.Client.Games.Witcher2.Witcher2GameModeFactory Checking: Witcher3.dll Initializing: Nexus.Client.Games.Witcher3.Witcher3GameModeFactory Checking: WorldOfTanks.dll Initializing: Nexus.Client.Games.WorldOfTanks.WoTGameModeFactory Checking: XCOM2.dll Initializing: Nexus.Client.Games.XCOM2.XCOM2GameModeFactory Checking: XRebirth.dll Initializing: Nexus.Client.Games.XRebirth.XRebirthGameModeFactory Loading Game Mode Factories for Installed Games... Loading SkyrimSE: Supported Loading FalloutNV: Supported Loading Morrowind: Supported Loading Skyrim: Supported Loading Oblivion: Supported Loading Starbound: Supported Loading Fallout3: Supported Loading DragonAge: Supported Determining Game Mode: (From Selection Form) SkyrimSE Game Mode Factory Selected: Skyrim Special Edition (SkyrimSE) Creating Game Mode mutex (Attempt: 0)

Tracing an Unhandled Exception: Running Threads (1) 3 () Aborted Exception: Message: The given path's format is not supported. Full Trace: System.NotSupportedException: The given path's format is not supported. at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at Nexus.Client.ApplicationInitializer.CreateEnvironmentPaths(IGameMode p_gmdGameMode, ViewMessage& p_vwmErrorMessage) at Nexus.Client.ApplicationInitializer.DoApplicationInitialize(IGameModeFactory p_gmfGameModeFactory, SynchronizationContext p_scxUIContext, ViewMessage& p_vwmErrorMessage) at Nexus.Client.ApplicationInitializer.DoWork(Object[] p_objArgs) at Nexus.Client.ThreadedBackgroundTask.RunThreadedWork(Object p_objArgs) at Nexus.Client.Util.Threading.TrackedThread.RunParameterizedThread(Object p_objParam) 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)

johnnyde94 commented 6 years ago

Same issue here... here is the trace log

TraceLog20180303174841.txt

kkriisgaard commented 6 years ago

I've been getting the same error with FNV, but not with Skyrim (regular edition), and I would like to propose a hypothesis: It appears that the archives are being created in CreateBackupTask.cs, in the DoWork method. On line 377, I believe the final archive is being made. If ModManager.GameMode.ModeId returns a colon (e.g. "Fallout: New Vegas"), or any other illegal character, it will crash because Windows will refuse to create the file. If I'm right, I believe the solution is obvious.

Edit: I was wrong about half of the root cause. Further analysis shows that it might be on line 348 of the previously mentioned file (GameMode.Name contains a colon). I'll set up a pull request and see if I can fix it across the board.