Mutagen-Modding / Spriggit

A tool to facilitate converting Bethesda plugin files to a text based format that can be stored in Git
GNU General Public License v3.0
88 stars 10 forks source link

Handle FileNotFound assembly errors #83

Open Noggog opened 2 weeks ago

Noggog commented 2 weeks ago
2024-08-24 20:32:54.120 -05:00 [ERR] Error syncing to Mod
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: 
File name: 'Mutagen.Bethesda.Serialization.Yaml, Version=1.23.0.0, Culture=neutral, PublicKeyToken=null'
   at Spriggit.Yaml.Starfield.EntryPoint.Deserialize(String inputPath, String outputPath, Nullable`1 dataPath, IWorkDropoff workDropoff, IFileSystem fileSystem, ICreateStream streamCreator, CancellationToken cancel)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Spriggit.Yaml.Starfield.EntryPoint.Deserialize(String inputPath, String outputPath, Nullable`1 dataPath, IWorkDropoff workDropoff, IFileSystem fileSystem, ICreateStream streamCreator, CancellationToken cancel)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithManyArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Spriggit.Core.DynamicEntryPoint.Deserialize(String inputPath, String outputPath, Nullable`1 dataPath, IWorkDropoff workDropoff, IFileSystem fileSystem, ICreateStream streamCreator, CancellationToken cancel) in D:\a\Spriggit\Spriggit\Spriggit.Core\DynamicEntryPoint.cs:line 58
   at Spriggit.Engine.AssemblyLoadedEntryPoint.Deserialize(String inputPath, String outputPath, Nullable`1 dataPath, IWorkDropoff workDropoff, IFileSystem fileSystem, ICreateStream streamCreator, CancellationToken cancel) in D:\a\Spriggit\Spriggit\Spriggit.Engine\AssemblyLoadedEntryPoint.cs:line 79
   at Spriggit.Engine.Services.Singletons.SpriggitEngine.Deserialize(String spriggitPluginPath, FilePath outputFile, Nullable`1 dataPath, UInt32 backupDays, Nullable`1 localize, IEngineEntryPoint entryPt, SpriggitSource source, Nullable`1 cancel) in D:\a\Spriggit\Spriggit\Spriggit.Engine\Services\Singletons\SpriggetEngine.cs:line 125
   at Spriggit.UI.ViewModels.Transient.LinkVm.SyncToMod(CancellationToken cancel) in D:\a\Spriggit\Spriggit\Spriggit.UI\ViewModels\Transient\LinkVm.cs:line 271

Probably can nuke temp and try again? I thought it did this already, but can double check the logic

gir489returns commented 1 week ago

This might be a case of correlation not being causation, but as soon as 0.27 released my syncs started failing during our testing of ticket #48. Does Spriggit rely on the internet at all for this synchronization process?

Noggog commented 1 week ago

It does rely on internet https://mutagen-modding.github.io/Spriggit/translation-packages/ as well as downloading past CLI releases when translating older targets.

I would like to get it to a spot where it might not hit the internet at all after the first "run" against a specific version. (but dev builds might wig it out and always redownload things)

Are you getting the FileNotFoundException exception when having your errors?

gir489returns commented 1 week ago

Are you getting the FileNotFoundException exception when having your errors?

It was the exception that was occurring when 0.27 released.

From the log I posted in #48

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: Could not find file 'C:\Users\Admin\AppData\Local\Temp\n1vfzhhd.s40\CheatTerminal.esp'.
File name: 'C:\Users\Admin\AppData\Local\Temp\n1vfzhhd.s40\CheatTerminal.esp'
Noggog commented 1 week ago

Gotcha. Looking closer, your FileNotFound error was failing due to:

I think that's a different thing to improve, which I've made a card for here #87


This card is specifically around a FileNotFound error where the missing file is a dll required for the translation packages

System.IO.FileNotFoundException: File name: 'Mutagen.Bethesda.Serialization.Yaml, Version=1.23.0.0...

which i think is a slightly different cause/issue


Are you still getting the FileNotFound exceptions when running currently? If so, is it the #87 style?

gir489returns commented 1 week ago

I think that's a different thing to improve, which I've made a card for here #87

When I worked on a project that reduced 8 mainframes into one giant Spring Batch project, we ran into these similar kinds of esoteric errors. A lot of "FileNotFound" "Class cast exceptions from Object to Object" I even have one printed out and posted on my wall that says "Cannot cast from java.com.dao.Fas91 to java.com.dao.Fas91" which we still to this day never solved. Anyway, what we eventually had to do was starting throwing our own custom exceptions from within the handlers so that when caught, we could use instanceof to figure out what actually was the problem. Maybe the UI could use that as some kind of way to determine what to display to the user? Giving the user helpful information when an exception (edge case) occurs is always hard because you never know how the user is going to use your program until they do. But in this case, had it printed something like "Expected version 0.26, but got unexpected 0.27.0-d version" that would at least make me think I'm out of date.

Are you still getting the FileNotFound exceptions when running currently? If so, is it the #87 style?

No. I've actually batch streamed the process of sorting -> syncing to git where instead of loading the spriggit UI, I just run a BAT file then it sorts and syncs it to Git in one click.