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

Bug: HASS.Agent keeps crashing #156

Closed
klkohl opened this issue Aug 30, 2022 · 28 comments
Closed

Bug: HASS.Agent keeps crashing #156

klkohl opened this issue Aug 30, 2022 · 28 comments
Assignees
Labels
bug Something isn't working

Comments

@klkohl
Copy link

klkohl commented Aug 30, 2022

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.

@LAB02-Admin
Copy link
Member

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

@klkohl
Copy link
Author

klkohl commented Aug 31, 2022

Windows 10.

I'll try the beta.

@pejoeazmi21
Copy link

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

@Alderto1995
Copy link

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

@klkohl
Copy link
Author

klkohl commented Sep 7, 2022

Beta isn't working either.

@LAB02-Admin
Copy link
Member

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

@LAB02-Admin LAB02-Admin self-assigned this Sep 8, 2022
@LAB02-Admin LAB02-Admin added the bug Something isn't working label Sep 8, 2022
@slunat
Copy link

slunat commented Sep 15, 2022

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)

@cbarth3
Copy link

cbarth3 commented Oct 31, 2022

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.

@LAB02-Admin
Copy link
Member

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.

@klkohl
Copy link
Author

klkohl commented Oct 31, 2022

I'm willing.

@cbarth3
Copy link

cbarth3 commented Oct 31, 2022

Same here

@LAB02-Admin
Copy link
Member

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.

@cbarth3
Copy link

cbarth3 commented Nov 2, 2022

@LAB02-Admin
Copy link
Member

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

@LAB02-Admin
Copy link
Member

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 :)

@engell90
Copy link

engell90 commented Nov 3, 2022

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

@klkohl
Copy link
Author

klkohl commented Nov 3, 2022

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.

@LAB02-Admin
Copy link
Member

Great!

@cbarth3
Copy link

cbarth3 commented Nov 3, 2022

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.

@LAB02-Admin
Copy link
Member

Connect what exactly @cbarth3?

@cbarth3
Copy link

cbarth3 commented Nov 4, 2022

Connect what exactly @cbarth3?

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

@LAB02-Admin
Copy link
Member

Have you executed the port reservation:

image

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

@hastarin
Copy link

hastarin commented Nov 5, 2022

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
Copy link

hastarin commented Nov 5, 2022

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
Copy link

hastarin commented Nov 5, 2022

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.

@LAB02-Admin
Copy link
Member

Fixes implemented in the latest beta, closing this

@LAB02-Admin
Copy link
Member

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

@queesamor
Copy link

I am experiencing essentially the exact symptoms as one of the others above ( #156 (comment) ), 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?

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

No branches or pull requests

9 participants