LAB02-Research / HASS.Agent

Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.
https://hassagent.lab02-research.org
MIT License
1.56k stars 68 forks source link

Misc: crashing on startup - FirstChanceException: A task was canceled #378

Open angus123321 opened 9 months ago

angus123321 commented 9 months ago

[2023-12-12] HASS.Agent_20231212_002.log

i had it working and connected to HA with MQTT. but now it crashes on startup or shortly after

i do have an error but its from a different time.

2023-12-12 03:09:42.099 -05:00 [FTL] [PROGRAM] FirstChanceException: A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at MQTTnet.Client.MqttClient.TrySendKeepAliveMessagesAsync(CancellationToken cancellationToken)
2023-12-12 03:09:42.100 -05:00 [FTL] [PROGRAM] FirstChanceException: The operation was canceled.
System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at MQTTnet.Implementations.MqttTcpChannel.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2023-12-12 03:09:42.100 -05:00 [FTL] [PROGRAM] FirstChanceException: The operation was canceled.
System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Threading.SemaphoreSlim.WaitUntilCountOrTimeoutAsync(TaskNode asyncWaiter, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
joestump commented 9 months ago

@angus123321 same for me. I see the maintainer is looking for folks to help/take it over so unsure if we'll have a path forward.

ImaBadCoder commented 9 months ago

So glad to see that I am not the only one with this issue. Been troubleshooting without any luck. like @angus123321 , I also had it working, then noticed that it stopped a few days ago.

siw1973 commented 3 months ago

@angus123321 @joestump @ImaBadCoder

Anyone fixed this, I installed it one a single user in a non default location, then hacked about using Task Schedular to try and get it to work for second login.

Started crashing and the full uninstall, reboot and proper install but still crashing within about 5 minutes.

Cleared out old entries using MQT Explorer but still crashing.