HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

Bug: HASS.Agent keeps crashing

Open klkohl opened this issue 3 years ago • 7 comments

Whenever HASS.Agent starts it runs for a few seconds then crashes/disappears from task bar. I've tried uninstalling and reinstalling. Any suggestions to resolve this would be greatly appreciated.

klkohl avatar Aug 30 '22 17:08 klkohl

What version of Windows are you using?

You can try the beta: https://github.com/LAB02-Research/HASS.Agent/releases/tag/2022.13.0-beta2

LAB02-Admin avatar Aug 31 '22 06:08 LAB02-Admin

Windows 10.

I'll try the beta.

klkohl avatar Aug 31 '22 13:08 klkohl

Same with me the app always disappear on taskbar. Im using windows 11. And already try the beta.

pejoeazmi21 avatar Sep 04 '22 23:09 pejoeazmi21

I have the same issue :( I see the following error in my event viewer: Application: HASS.Agent.exe CoreCLR Version: 6.0.422.16404 .NET Version: 6.0.4 Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.InteropServices.COMException (0x80010002): Aanroep is door het berichtenfilter geannuleerd. (0x80010002 (RPC_E_CALL_CANCELED)) at HASS.Agent.Media.MediaManager.MediaMonitor() at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback() `

I'm running windows 11. I also tried reinstalling the program, but that did not help either

Alderto1995 avatar Sep 07 '22 21:09 Alderto1995

Beta isn't working either.

klkohl avatar Sep 07 '22 22:09 klkohl

That's a helpful log @Alderto1995, I'll look into it, thanks

LAB02-Admin avatar Sep 08 '22 07:09 LAB02-Admin

I've been experiencing crashing for a few months on my Windows 10 PC, sometimes it quits after a few seconds, sometimes it lasts a few hours or days before it terminates itself. No issues with my Windows 11 PC. I have just installed the latest 2022.13 beta 2 and it is still crashing. Event viewer shows the following:

Application: HASS.Agent.exe
CoreCLR Version: 6.0.322.12309
.NET Version: 6.0.3
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFDB60DD70F (00007FFDB5F10000) with exit code c0000005.

And

Faulting application name: HASS.Agent.exe, version: 2022.13.0.0, time stamp: 0x62cf0990
Faulting module name: coreclr.dll, version: 6.0.322.12309, time stamp: 0x6216cac2
Exception code: 0xc0000005
Fault offset: 0x00000000001cd70f
Faulting process ID: 0x2e60
Faulting application start time: 0x01d8c9151729f98c
Faulting application path: C:\Users\sluna\AppData\Roaming\LAB02 Research\HASS.Agent\HASS.Agent.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.3\coreclr.dll
Report ID: 4b6144a5-5481-4400-a73e-badf216ea428
Faulting package full name: 
Faulting package-relative application ID: 

My Windows version is 10 Pro 21H2 (19044.2006)

slunat avatar Sep 15 '22 15:09 slunat

Just tried installing this on my windows 10 machine and it opened fine the first time and then each time after that it just closes out when I try and click the icon in the system tray. Uninstalled and reinstalled and got the same thing.

cbarth3 avatar Oct 31 '22 02:10 cbarth3

To everyone here; if I make a debug build, would you be willing to test it? It'll give some more info (hopefully) in the logs for me to work with.

LAB02-Admin avatar Oct 31 '22 10:10 LAB02-Admin

I'm willing.

klkohl avatar Oct 31 '22 11:10 klkohl

Same here

cbarth3 avatar Oct 31 '22 14:10 cbarth3

Okay, great :)

There are two things I'd like to try, the first is focussed on getting more info. Please download this debug build:

https://shares.lab02-research.org/tests/156/hass.agent.zip

And place it anywhere on your PC. You can then copy your current hass.agent's config dir, it should be located in %appdata%\LAB02 Research\HASS.Agent\config.

Completely close the current running hass.agent instance, and launch the debug variant. As soon as it crashes, please send me the logs in the logs subfolder.

Note: after a reboot, the normal version will start.

LAB02-Admin avatar Nov 01 '22 09:11 LAB02-Admin

That is perfect thank you @cbarth3, I'll fix it

LAB02-Admin avatar Nov 02 '22 20:11 LAB02-Admin

I've published a new beta for you to test @cbarth3:

https://shares.lab02-research.org/tests/156/hass.agent.zip

In your case, it was because mqtt is disabled but the mediaplayer doesn't properly check that. So this might not be the fix for the rest (I did fix a few other things as well though, so worth a try).

Let me know how it goes - if it crashes again, please send the new logs :)

LAB02-Admin avatar Nov 03 '22 08:11 LAB02-Admin

Thanks, This version works for me, I hade same issue as cbarth3.

engell90 avatar Nov 03 '22 11:11 engell90

The previous version is working for me now. I had uninstalled it previously, but reinstalled when you reached out. So I didn't try the beta version. Glad it's working for everyone now.

klkohl avatar Nov 03 '22 17:11 klkohl

Great!

LAB02-Admin avatar Nov 03 '22 21:11 LAB02-Admin

The latest one will stay running now and allow me to open the tray icon and adjust the settings. Now I just need to figure out why I can't connect to it from home assistant.

cbarth3 avatar Nov 03 '22 23:11 cbarth3

Connect what exactly @cbarth3?

LAB02-Admin avatar Nov 04 '22 08:11 LAB02-Admin

Connect what exactly @cbarth3?

The local api connection. Gives me failed to connect. Screenshot_20221104_091701

cbarth3 avatar Nov 04 '22 14:11 cbarth3

Have you executed the port reservation:

image

If it doesn't work after that, open a new ticket and we'll sort it out

LAB02-Admin avatar Nov 04 '22 16:11 LAB02-Admin

I'm getting the same error as @slunat and have just run the debug build and it's crashed after which it's crashing on startup.

I've included the log though the last thing logged is at 13:46:50 and Event Viewer shows the actual crash at 13:52:21 so I'm not sure it's going to help you?

[2022-11-05] HASS.Agent_20221105.log

From what I can ascertain via web search it points to some unmanaged code trying to access memory it shouldn't?

Application: HASS.Agent.exe
CoreCLR Version: 6.0.1022.47605
.NET Version: 6.0.10
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFF3290224B (00007FFF32730000) with exit code c0000005.
Faulting application name: HASS.Agent.exe, version: 2022.14.0.0, time stamp: 0x6331eb0e
Faulting module name: coreclr.dll, version: 6.0.1022.47605, time stamp: 0x6331e1bc
Exception code: 0xc0000005
Fault offset: 0x00000000001d224b
Faulting process id: 0x0x20F8
Faulting application start time: 0x0x1D8F0C2F4DCBA5C
Faulting application path: C:\tools\hass.agent\HASS.Agent.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.10\coreclr.dll
Report Id: f3d92f28-ce6f-4338-92e3-55caf18694f8
Faulting package full name: 
Faulting package-relative application ID:

hastarin avatar Nov 05 '22 03:11 hastarin

I'm not sure it helps but I guess more info can't hurt even if it's just documenting co-incidence. I could still run the normal version when the Beta was failing. I copied my configuration over again in case I'd tweaked anything and then I was able to run the Beta again, so I'll leave it running.

I can see you're using a COM wrapper for Windows Update so I'm going to try removing that sensor to see if it helps.

EDIT: It didn't help but removing all sensors has allowed me to run it, putting the file back crashes on startup. Process of elimination time! ...

EDIT: No luck. I notice when it crashes on startup the cursor changes to a wait cursor shortly before the window disappears.

hastarin avatar Nov 05 '22 03:11 hastarin

Just a note that I noticed I was getting an error in my logs at a similar time, within 30s, of a crash:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 
{2593F8B9-4EAF-457C-B68A-50F6B8EA6B54}
 and APPID 
{15C20B67-12E7-4BB6-92BB-7AFF07997402}

I followed the guide linked below but using the IDs from my error message: https://www.kapilarya.com/fix-event-10016-error-the-application-specific-permission-settings-do-not-grant-local-activation-permission-in-windows-10

I haven't had a crash since, but it might be too early to call it a solution. 🤞

EDIT: I've run both the beta and the normal version for a few hours each without a crash so this is definitely worth trying for others that may see similar entries around the time of the crash.

hastarin avatar Nov 05 '22 07:11 hastarin

Fixes implemented in the latest beta, closing this

LAB02-Admin avatar Nov 09 '22 16:11 LAB02-Admin

Sorry @hastarin completely missed your additions yesterday! Thank you for that, I'll add it to the docs :)

LAB02-Admin avatar Nov 10 '22 09:11 LAB02-Admin

I am experiencing essentially the exact symptoms as one of the others above ( https://github.com/LAB02-Research/HASS.Agent/issues/156#issuecomment-1248246703 ), except I'm on version 14 instead of version 13. I am also on Windows 10.

Given the version difference, I am hesitant to download the debug build that you created, since it isn't a fork from the version of the app that I'm running.

How can I help solve this so it stops crashing?

queesamor avatar Sep 08 '23 05:09 queesamor