Repository navigation
"Cannot access a disposed object" after clicking image in [inferencer] gallery panel #1367
Description
Activity
I think I've tracked it down.
2025-09-02 20:07:46.5540|DEBUG|StabilityMatrix.Avalonia.Services.InferenceClientManager|Model index changed, reloading shared properties for Inference 2025-09-02 20:07:46.6364|INFO|StabilityMatrix.Core.Services.ModelIndexService|Loaded 12 models from database in 383.47msI'd just deleted a checkpoint (not the one I was using at the time).
I'm NOT messing with any models tonight and still getting this when clicking on an image in the inferencer gallery.
2025-09-09 23:47:13.7331|WARN|StabilityMatrix.Avalonia.Program|Unhandled "ObjectDisposedException": "Cannot access a disposed object. Object name: 'IServiceProvider'."|System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) 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.X11.X11PlatformThreading.CheckSignaled() at Avalonia.X11.X11PlatformThreading.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)Still present in 2.15.2. Can't zero-in on what [sequence of] actions causes this. This time I clicked on a photo in the inferencer's gallery (vertical scroll list on the right).
## Exception ```ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.``` ### Sentry ID [`7ba6c849`](https://stability-matrix.sentry.io/issues/?query=id%3A7ba6c8490f974e53be8d9023f431de1e&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) 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.X11.X11PlatformThreading.CheckSignaled() at Avalonia.X11.X11PlatformThreading.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)```Still present in 2.15.3.
## Exception ```ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.``` ### Sentry ID [`7be9e969`](https://stability-matrix.sentry.io/issues/?query=id%3A7be9e96910454567b93fd678c1be6fe1&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) 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.X11.X11PlatformThreading.CheckSignaled() at Avalonia.X11.X11PlatformThreading.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)```2.15.4 (still on Linux):
## Exception ```ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.``` ### Sentry ID [`96e3a002`](https://stability-matrix.sentry.io/issues/?query=id%3A96e3a002082d4f16b5063d184b7a17d9&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) 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.X11.X11PlatformThreading.CheckSignaled() at Avalonia.X11.X11PlatformThreading.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)```- changed the title
[-]"Cannot access a disposed object" after image drag-and-drop[/-][+]"Cannot access a disposed object" after clicking image in [inferencer] gallery panel[/+]on Dec 17, 2025 Issue still present. Attached a screenshot to show the state when the error occurs. What I did what triggered it: Tried dragging the top item on the inference gallery tab to Img2Img. It's clearly there in the inference folder.
## Exception ```ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.``` ### Sentry ID [`868e4432`](https://stability-matrix.sentry.io/issues/?query=id%3A868e44327d214c759e9cef0a860f49a2&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) 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)```
This issue is stale because it has been open 60 days with no activity. Remove the stale label or comment, else this will be closed in 7 days.
- addedstaleStale issue or inactive for long period of timeStale issue or inactive for long period of time
on Mar 5, 2026 Please un-stale. Still seeing this on 2.16.0-dev.2 on Linux.
- removedstaleStale issue or inactive for long period of timeStale issue or inactive for long period of time
on Mar 7, 2026 This issue is stale because it has been open 60 days with no activity. Remove the stale label or comment, else this will be closed in 7 days.
- addedstaleStale issue or inactive for long period of timeStale issue or inactive for long period of time
on May 6, 2026 Still present. See attached logzip.
- removedstaleStale issue or inactive for long period of timeStale issue or inactive for long period of time
on May 7, 2026 This was from simply clicking an image in the Galley panel (inferencing page). v2.16.0-pre.1
The good news is it seems the "Continue" button will indeed let me continue.
## Exception ```ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.``` ### Sentry ID [`213d7346`](https://stability-matrix.sentry.io/issues/?query=id%3A213d7346256f4eaf8cdd39157472b815&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()```Still present unfortunatly. But continue does work thankfully.
Exception
Object name: 'IServiceProvider'.``` ### Sentry ID [`c386aa22`](https://stability-matrix.sentry.io/issues/?query=id%3Ac386aa224ca24062935e8b97c8f01148&referrer=sm-app-ex&statsPeriod=90d) ### Stack Trace ``` at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType) at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get[TService]() at StabilityMatrix.Avalonia.ViewModels.Inference.ImageFolderCardViewModel.OnImageClick(LocalImageFile item) at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()```This issue is stale because it has been open 60 days with no activity. Remove the stale label or comment, else this will be closed in 7 days.
- addedstaleStale issue or inactive for long period of timeStale issue or inactive for long period of time
on Aug 22, 2026 - added a commit that references this issue
on Aug 29, 2026 This issue was closed because it has been stale for 7 days with no activity.
What happened?
Drag-and-drop image from the gallery (right side of inferencer) into the prompt window:
Seems to happen at random. I can tell it's about to happen when I flip to an existing generation tab and the model (checkpoint) selector is blank.
Note the .PNG generation appears to be fine (i.e. no metadata corruption). Drag-and-drop of said image works if I restart SM.
Steps to reproduce
See above.
Relevant logs
Version
v2.15.0-pre.2+fdf2ae0
What Operating System are you using?
Linux