Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error: "An unexpected error occurred" dialog. InvalidOperationException: Call from invalid thread #1078

Closed
hector2m opened this issue Jan 1, 2025 · 4 comments · Fixed by #1099
Labels
bug Something isn't working crash Bugs involving the app crashing to desktop

Comments

@hector2m
Copy link

hector2m commented Jan 1, 2025

What happened?

Installing StabilityMatrix an unexpected error message dialog appears.
InvalidOperationException
stabilitymatrix-log-2025-01-01-11-34-56.zip

Exception Details

Exception

InvalidOperationException: Call from invalid thread

Sentry ID

e2f58de2

Stack Trace

   at Avalonia.AvaloniaObject.GetValue[T](StyledProperty`1 property)
   at FluentAvalonia.UI.Controls.ItemsRepeater.OnItemsSourceViewChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Utilities.WeakEvent`2.Subscription.OnEvent(Object sender, TEventArgs eventArgs)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at DynamicData.Binding.ObservableCollectionAdaptor`2.Adapt(IChangeSet`2 changes, IObservableCollection`1 collection) in /_/src/DynamicData/Binding/ObservableCollectionAdaptor.cs:line 124
   at DynamicData.Binding.ObservableCollectionAdaptor`2.Adapt(IChangeSet`2 changes, IObservableCollection`1 collection) in /_/src/DynamicData/Binding/ObservableCollectionAdaptor.cs:line 113
   at DynamicData.ObservableCacheEx.<>c__DisplayClass28_0`2.<Bind>b__1(IChangeSet`2 changes) in /_/src/DynamicData/Cache/ObservableCacheEx.cs:line 582
   at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value)
--- End of stack trace from previous location ---
   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception)
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
   at System.Reactive.Concurrency.ObserveOn`1.Context._.OnErrorPosted(Object error)
   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

v2.13.0

### What Operating System are you using?

Windows
@hector2m hector2m added bug Something isn't working crash Bugs involving the app crashing to desktop labels Jan 1, 2025
@MareStare
Copy link

MareStare commented Jan 3, 2025

Same happens for me. I'm using Windows 11, and this error happens when I initially set up StabilityMatrix using "Portable Mode" for the data directory, then Forge for Web UI and Pony Diffusion V6 XL for models (although I think the model in the first-time setup doesn't matter).

Exception

InvalidOperationException: Call from invalid thread

Sentry ID

cce8b5f6

Stack Trace

   at Avalonia.AvaloniaObject.GetValue[T](StyledProperty`1 property)
   at FluentAvalonia.UI.Controls.ItemsRepeater.OnItemsSourceViewChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Utilities.WeakEvent`2.Subscription.OnEvent(Object sender, TEventArgs eventArgs)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at DynamicData.Binding.ObservableCollectionAdaptor`2.Adapt(IChangeSet`2 changes, IObservableCollection`1 collection) in /_/src/DynamicData/Binding/ObservableCollectionAdaptor.cs:line 124
   at DynamicData.Binding.ObservableCollectionAdaptor`2.Adapt(IChangeSet`2 changes, IObservableCollection`1 collection) in /_/src/DynamicData/Binding/ObservableCollectionAdaptor.cs:line 113
   at DynamicData.ObservableCacheEx.<>c__DisplayClass28_0`2.<Bind>b__1(IChangeSet`2 changes) in /_/src/DynamicData/Cache/ObservableCacheEx.cs:line 582
   at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value)
--- End of stack trace from previous location ---
   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception)
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
   at System.Reactive.Concurrency.ObserveOn`1.Context._.OnErrorPosted(Object error)
   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)```

@ilgrank
Copy link

ilgrank commented Jan 3, 2025

I've been able to reproduce it on two different computers (Windows 10 22H2 + Windows 11 23H2), with a fresh portable install of StabilityMatrix. It happens selecting Forge, no matter the model.

Update:: Seems that even the UI choice has no effect. Removed all folders, started again from scratch but using ComfyUI and got the same error

Possibily related to AvaloniaUI/Avalonia#6004 ?

Update2: Installing from scratch v2.12.4 does not incurr in any error, so the issue is just with 2.13.0
After installing 2.12.4 you can safely update to 2.13.0 with no error.

@mohnjiles
Copy link
Contributor

Sorry folks, we're pretty sure what the issue is & should have a fix out soon ™️. In the meantime, if you skip the first-time install, you should be able to install the web UIs via the Add Package button on the Packages tab without this issue.

@Kitniak
Copy link

Kitniak commented Jan 5, 2025

The same problem, "Call from invalid thread" while installing.
stabilitymatrix-log-2025-01-05-17-38-21.zip
stabilitymatrix-log-2025-01-05-17-15-46.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash Bugs involving the app crashing to desktop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants