hass-workstation-service icon indicating copy to clipboard operation
hass-workstation-service copied to clipboard

Crash when starting background service on Win10

Open karwosts opened this issue 3 years ago • 4 comments

Hi, I just installed this this morning and was trying it out.

I started it up and the service was running, I added my broker information and it the app said "All Good".

I tried adding sensors, but oddly none of them seemed to correctly add. When I clicked "Save" in the modal window, the window closed but no sensors were added to the list. Tried a few times and eventually closed the program and tried to relaunch it.

On the second+ time I started the UserInterface, it says the background service is not started. When I click "Start" under background service, the app just crashes.

I picked up 3 events from the crash event viewer, which say:

Application: UserInterface.exe
CoreCLR Version: 5.0.120.57516
.NET Version: 5.0.1
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(String fileName)
   at UserInterface.Views.BackgroundServiceSettings.Start(Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(IInteractive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Controls.Button.OnClick()
   at Avalonia.Controls.Button.OnPointerReleased(PointerReleasedEventArgs e)
   at Avalonia.Input.InputElement.<>c.<.cctor>b__30_9(InputElement x, PointerReleasedEventArgs e)
   at System.Reactive.Subjects.Subject`1.OnNext(T value)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(IInteractive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Input.MouseDevice.MouseUp(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties props, KeyModifiers inputModifiers)
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e)
   at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at UserInterface.Program.Main(String[] args)
Faulting application name: UserInterface.exe, version: 1.0.0.0, time stamp: 0x602c44b3
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1023, time stamp: 0x924f9cdb
Exception code: 0xe0434352
Fault offset: 0x0000000000034b89
Faulting process id: 0x2d74
Faulting application start time: 0x01d77a6348f5e878
Faulting application path: C:\Users\Tim\AppData\Local\Apps\2.0\8KVHWMX9.68D\NXQ9CXTW.TYH\hass..tion_86593894fdd70b70_0001.0000_50d23eae027b2f44\UserInterface.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 4778ac84-1120-4e28-8470-6ac7666a9424
Faulting package full name: 
Faulting package-relative application ID: 
Fault bucket 2035183741270307582, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: JCALVBL2SGBKYKKEEHWJGSKYRUGEU4AX
P2: 1.0.0.0
P3: 602c44b3
P4: System.Diagnostics.Process
P5: 5.0.120.57516
P6: 83fc95a9
P7: 165
P8: 33d
P9: System.ComponentModel.Win32
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER112E.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER13B0.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER13C1.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER13CE.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER13FE.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_JCALVBL2SGBKYKKE_a6264e5ccb6f95df2788aa1218260f5f430b6b3_04766acd_a0264145-75ef-4c44-9685-1d10e92cebb5

Analysis symbol: 
Rechecking for solution: 0
Report Id: 4778ac84-1120-4e28-8470-6ac7666a9424
Report Status: 268435456
Hashed bucket: d6e0a9d5d66f2fd42c3e6cd46f1132fe
Cab Guid: 0

Hope this is helpful.

karwosts avatar Jul 16 '21 17:07 karwosts

Works again after rebooting. I'll let you decide if you want to look into the crash report or just close.

Might want to have a comment in the readme about rebooting after installation, sounds like some others had issues on first install as well.

karwosts avatar Jul 16 '21 19:07 karwosts

I have this same issue. Yes I reboot helps but when I bring the UI up again, eventually the button do not respond then crash.

mkono87 avatar Jul 16 '21 22:07 mkono87

Thanks for creating an issue! The start button does not seem to be working correctly. There is some weirdness that I have to work around because I'm using ClickOnce as the installer. You can try starting the service by opening hass-workstation-service.exe. If you run that file again, it should open the UI for you.

sleevezipper avatar Jul 25 '21 19:07 sleevezipper

i've lately had similar issues. (but have observed the poster's exact situation also).

Been running app on two laptops and pc for fair few months / year. if i'm on teams call (using microphone), my google speaker pauses. When my laptops reach near 100% their smart plug'd chargers switch off until needed again. My automatic sensor lights in the office, doesn't switch off after 10mins if my pc is unlocked (as i'm sat there not moving enough).

Lately been having some issues where its not running. I double run it to see the UI, but its all blank and nothing works. Sometimes a reboot brings it back to normal, sometimes an uninstall / reinstall does the job.

I've had it where a re install brings it back blank, but then the config wont save. then another reboot and its luckily got my old working config.

I think if you uninstall and re install. If you dont restart the config might be locked and you get a un usable blank config which the UI cant work with.

I also have an odd usage issue, I think due to windows 10 and its fast reboot/start up (and this not being a service). If i just restart from being logged on (app running). The app is still running at the logon/lock screen (i presume the windows session gets paused and resumed). If i log off and at some point shut down. Next boot up the app isnt running pre logon.

For both my machines, a Computer based install (ideally with a windows service) would be better than a click once app thing. Is there a way to specify where the config is stored?

rEs-84 avatar Sep 25 '21 08:09 rEs-84