Skip to content

Opening models manager leads to crash if any of symlinks are broken #1157

@TuTAH1

Description

@TuTAH1

What happened?

  1. Create some symlinks in models\LoRA (or models\Stable-Diffusion, I guess) leading to other drive
  2. Remove/unmount the drive (or just delete/move the symlink target)
  3. Now if you open the model manager, you'll get a crash

Expected behaviour:
Ignore broken symlinks and continue to read other elements.

Exception Details

Exception

DirectoryNotFoundException: Could not find a part of the path 'N:\Programs\Stable-Diffusion\models\Lora\[REDACTED]\[REDACTED]'.

Sentry ID

9b752652

Stack Trace

at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator`1.Init() at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerableFactory.FileSystemInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized) at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.GetSubfolders(String strPath) at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.GetSubfolders(String strPath) at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.<>c__DisplayClass78_0.<RefreshCategories>b__0(String d) at System.Linq.Enumerable.IEnumerableSelectIterator`2.ToList() at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.RefreshCategories() at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.<>c__DisplayClass63_0.<OnInitialLoadedAsync>b__22(Object _, EventArgs _) at StabilityMatrix.Core.Services.ModelIndexService.RefreshIndexParallelCore() at StabilityMatrix.Avalonia.ViewModels.CheckpointsPageViewModel.Refresh() at AsyncAwaitBestPractices.SafeFireAndForgetExtensions.HandleSafeFireAndForget[TException](Task task, Boolean continueOnCapturedContext, Action`1 onException) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore() at Avalonia.Threading.DispatcherOperation.Execute() at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job) at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback) at Avalonia.Threading.Dispatcher.Signaled() at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg) at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken) at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.StartCore(String[] args) at StabilityMatrix.Avalonia.Program.Main(String[] args)

Version

2.13.3

What Operating System are you using?

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrashBugs involving the app crashing to desktop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions