Flow-Launcher / Flow.Launcher

:mag: Quick file search & app launcher for Windows with community-made plugins
https://flowlauncher.com
MIT License
8.14k stars 317 forks source link

Flow doesn't start when loading plugin fails #57

Closed DonKonfetti closed 4 years ago

DonKonfetti commented 4 years ago

Are you submitting a bug report?

Yes

Steps to reproduce

  1. Install Wox processkiller plugin
  2. Restart Flow
  3. Nothing happens, Flow silently crashes while starting

Flow Launcher Error Window text

Detailed logs

I've used dnSpy to look into this issue. I see that loading the processkiller plugin fails and some unhandled exceptions occurs. This is the relevant content of the output window:

14:10:31.671 Flow.Launcher.exe (CoreCLR: clrhost): 'C:\Users\schwarz\AppData\Roaming\FlowLauncher\Plugins\Wox.Plugin.ProcessKiller-952489db-c7fc-4f54-b718-81a1f74467e0\Wox.Plugin.ProcessKiller.dll' geladen.
14:10:31.717 Ausnahme ausgelöst: "System.Reflection.ReflectionTypeLoadException" in System.Private.CoreLib.dll
14:10:31.719 Zustatzinformation: Unable to load one or more of the requested types.
14:10:31.795 Flow.Launcher.exe (CoreCLR: clrhost): 'C:\Users\schwarz\AppData\Local\FlowLauncher\app-0.9.1\System.Reflection.Metadata.dll' geladen.
14:10:31.798 Flow.Launcher.exe (CoreCLR: clrhost): 'C:\Users\schwarz\AppData\Local\FlowLauncher\app-0.9.1\System.Collections.Immutable.dll' geladen.
14:10:31.969 Flow.Launcher.exe (CoreCLR: clrhost): 'C:\Users\schwarz\AppData\Local\FlowLauncher\app-0.9.1\de\PresentationFramework.resources.dll' geladen.
14:10:32.013 Ausnahme ausgelöst: "System.IO.IOException" in PresentationFramework.dll
14:10:32.016 Zustatzinformation: Die Ressource "images/app_error.png" kann nicht gefunden werden.
14:10:32.062 Ausnahme ausgelöst: "System.IO.IOException" in PresentationCore.dll
14:10:32.064 Zustatzinformation: Die Ressource "images/app_error.png" kann nicht gefunden werden.
14:10:32.104 Flow.Launcher.exe (CoreCLR: clrhost): 'C:\Users\schwarz\AppData\Local\FlowLauncher\app-0.9.1\de\System.Xaml.resources.dll' geladen.
14:10:32.124 Ausnahme ausgelöst: "System.Xaml.XamlObjectWriterException" in System.Xaml.dll
14:10:32.126 Zustatzinformation: Die Angabe eines Werts für "System.Windows.Baml2006.TypeConverterMarkupExtension" führte zu einer Ausnahme.
14:10:32.189 Ausnahme ausgelöst: "System.Windows.Markup.XamlParseException" in PresentationFramework.dll
14:10:32.192 Zustatzinformation: Die Angabe eines Werts für "System.Windows.Baml2006.TypeConverterMarkupExtension" führte zu einer Ausnahme.

And this is the log content:

2020-05-20 14:06:37.2944|INFO|App.OnStartup|Begin Flow Launcher startup ---------------------------------------------------- 2020-05-20 14:06:37.3244|INFO|App.OnStartup|Runtime info: Flow Launcher version: 0.9.1 OS Version: Microsoft Windows NT 10.0.18363.0 IntPtr Length: 8 x64: True 2020-05-20 14:06:38.0739|INFO|Flow Launcher.Infrastructure.Alphabet.Initialize|Preload pinyin cache <418ms> 2020-05-20 14:06:38.0739|INFO|Flow Launcher.Infrastructure.Alphabet.Initialize|Number of preload pinyin combination<0> 2020-05-20 14:06:38.0972|INFO|ImageLoader.Initialize|Preload images cost <718ms> 2020-05-20 14:06:38.0972|INFO|ImageLoader.Initialize|Number of preload images is <56>, Images Number: 58, Unique Items 52 2020-05-20 14:06:38.6414|INFO|Flow.Launcher.Plugin.Program.Main|Preload programs cost <5ms> 2020-05-20 14:06:38.6414|INFO|Flow.Launcher.Plugin.Program.Main|Number of preload win32 programs <368> 2020-05-20 14:06:38.6430|INFO|Flow.Launcher.Plugin.Program.Main|Number of preload uwps <45> 2020-05-20 14:06:38.7044|FATAL|UnHandledException|

Exception

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Wox.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Das System kann die angegebene Datei nicht finden.
   Source: System.Private.CoreLib
   TargetAssembly: System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
   TargetModule: System.Private.CoreLib.dll
   TargetSite: System.RuntimeType[] GetTypes(System.Reflection.RuntimeModule)
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Flow.Launcher.Core.Plugin.PluginsLoader.<>c__DisplayClass4_1.<DotNetPlugins>b__1() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginsLoader.cs:line 56
   at Flow.Launcher.Infrastructure.Stopwatch.Debug(String message, Action action) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 19
   at Flow.Launcher.Core.Plugin.PluginsLoader.DotNetPlugins(List`1 source) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginsLoader.cs:line 37
   at Flow.Launcher.Core.Plugin.PluginsLoader.Plugins(List`1 metadatas, PluginsSettings settings) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginsLoader.cs:line 23
   at Flow.Launcher.Core.Plugin.PluginManager.LoadPlugins(PluginsSettings settings) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 94
   at Flow.Launcher.App.<OnStartup>b__14_0() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\App.xaml.cs:line 69
   at Flow.Launcher.Infrastructure.Stopwatch.Normal(String message, Action action) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 31
   at Flow.Launcher.App.OnStartup(Object sender, StartupEventArgs e) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\App.xaml.cs:line 96
   at System.Windows.Application.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   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)

Environment

Assemblies - Flow.Launcher

2020-05-20 14:06:38.7675|FATAL|UnHandledException|

Exception

System.IO.IOException: Die Ressource "images/app_error.png" kann nicht gefunden werden.
   Source: PresentationFramework
   TargetAssembly: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationFramework.dll
   TargetSite: System.IO.Stream GetStreamCore(System.IO.FileMode, System.IO.FileAccess)
   at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   at MS.Internal.IO.Packaging.PackagePartExtensions.GetSeekableStream(PackagePart packPart, FileMode mode, FileAccess access)
   at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.get_ContentType()
   at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
   at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)
   at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)

System.Windows.Markup.XamlParseException: Die Angabe eines Werts für "System.Windows.Baml2006.TypeConverterMarkupExtension" führte zu einer Ausnahme.
   Source: PresentationFramework
   TargetAssembly: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   TargetModule: PresentationFramework.dll
   TargetSite: Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Flow.Launcher.ReportWindow.InitializeComponent() in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ReportWindow.xaml:line 1
   at Flow.Launcher.ReportWindow..ctor(Exception exception) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\ReportWindow.xaml.cs:line 21
   at Flow.Launcher.Helper.ErrorReporting.Report(Exception e) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\Helper\ErrorReporting.cs:line 16
   at Flow.Launcher.Helper.ErrorReporting.DispatcherUnhandledException(Object sender, DispatcherUnhandledExceptionEventArgs e) in C:\Workbench\Git\Flow.Launcher\Flow.Launcher\Helper\ErrorReporting.cs:line 30
   at System.Windows.Threading.Dispatcher.CatchException(Exception e)
   at System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)
   at System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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)
jjw24 commented 4 years ago

Hey how's it going.

Is this a plugin that you have been using or is it one that you want to try out?

DonKonfetti commented 4 years ago

Just a plugin I've been using with Wox. Crashes Flow at startup. Flow should handle such cases gracefully.

jjw24 commented 4 years ago

Yeah agree, got a pr in to handle it better.

We will also need to work on the integration of plugins that are not on core.

jjw24 commented 4 years ago

Closing. Further developments tracked in #95