Closed chheiss closed 1 year ago
Hi, does the connection drop on Lupusec system or homeassistant MQTT?
Lupusec system is disconnected for a few seconds every few hours. Mqtt stays connected all the time.
Do you see some kind of exception in the logs when the disconnection occurs or after the disconnection during the next poll?
No, as I don't know when exactly the disconnect occurs, it is once every 24h. When I restart the plugin, it works again.
hey, I have exactly the same problem. The addon loses the connection every 24 hours! After restarting the addon everything works fine again.
The latest version of HA, MQTT and your addon is installed in use.
Hi, Do you get after the disconnection still those messages or not?
[19:38:59 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}
And after disconnection, you have no errors/exceptions in the logs? Best regards, David
And set this value in the config to Debug.
Thanks! I set it up that way now. Nevertheless, I have had a stable connection for 4 days. As soon as there are problems again - I'll post the log
Hi, same problem for me with following in lupusec-addon protocoll:
[06:04:46 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"} [06:04:52 ERR] Call to Lupusec has an error! Request was: Method: POST, RequestUri: 'https://1**********/action/recordListGet', Version: 1.1, Content: <null>, Headers: { Accept: application/json Authorization: Basic ************ X-Token: ********** } {"SourceContext": "Lupusec2Mqtt.Lupusec.LupusecService"} System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. ---> System.TimeoutException: The operation was canceled. ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled. ---> System.Net.Sockets.SocketException (125): Operation canceled --- End of inner exception stack trace --- 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 System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter adapter) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory
1 buffer)
at System.Net.Http.HttpConnection.FillAsync(Boolean async)
at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnection.ChunkedEncodingReadStream.CopyToAsyncCore(Stream destination, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionResponseContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
at System.Net.Http.HttpClient.1 action) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/PollingHostedService.cs:line 258 [06:04:52 ERR] Message: Object reference not set to an instance of an object. {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"} System.NullReferenceException: Object reference not set to an instance of an object. at Lupusec2Mqtt.Lupusec.PollingHostedService.PublishSensor(RecordList recordList, Sensor sensor) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/PollingHostedService.cs:line 214 at Lupusec2Mqtt.Lupusec.PollingHostedService.TryCall[T](T subject, Action
1 action) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/PollingHostedService.cs:line 258
[06:04:52 ERR] Message: Object reference not set to an instance of an object. {"SourceContext": "Lupusec2Mqtt.Lupusec.PollingHostedService"}
System.NullReferenceException: Object reference not set to an instance of an object.
at Lupusec2Mqtt.Lupusec.PollingHostedService.PublishSensor(RecordList recordList, Sensor sensor) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/PollingHostedService.cs:line 214
at Lupusec2Mqtt.Lupusec.PollingHostedService.TryCall[T](T subject, Action1 action) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/PollingHostedService.cs:line 258 [06:04:54 ERR] Call to Lupusec has an error! Request was: Method: POST, RequestUri: 'https:**********/action/deviceListGet', Version: 1.1, Content: <null>, Headers: { Accept: application/json Authorization: Basic ************ X-Token: ***************** } {"SourceContext": "Lupusec2Mqtt.Lupusec.LupusecService"} System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. ---> System.TimeoutException: A task was canceled. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Threading.Tasks.TaskCompletionSourceWithCancellation
1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Lupusec2Mqtt.Lupusec.LupusecTokenHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in /src/Lupusec2Mqtt/src/Lupusec2Mqtt/Lupusec/LupusecTokenHandler.cs:line 24
at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.
and following in mosquitto log (thousands of log entries):
1655095731: New connection from 172.30.32.2:48936 on port 1883. 1655095731: Client <unknown> closed its connection. 1655095851: New connection from 172.30.32.2:48938 on port 1883. 1655095851: Client <unknown> closed its connection. 1655095971: New connection from 172.30.32.2:48940 on port 1883. 1655095971: Client <unknown> closed its connection. 1655096091: New connection from 172.30.32.2:48942 on port 1883. 1655096091: Client <unknown> closed its connection. 1655096192: Saving in-memory database to /data//mosquitto.db. 1655096211: New connection from 172.30.32.2:48944 on port 1883. 1655096211: Client <unknown> closed its connection. 1655096331: New connection from 172.30.32.2:48946 on port 1883. 1655096331: Client <unknown> closed its connection. 1655096451: New connection from 172.30.32.2:48948 on port 1883. 1655096451: Client <unknown> closed its connection. 1655096571: New connection from 172.30.32.2:48950 on port 1883. 1655096571: Client <unknown> closed its connection.
These are not IP addresses from my IP range as they occur in my network. If I restart Mosquitto first and then Lupusec Addon, everything works again for a while.
Hi @xsus95 ,
Thanks for the exception message, I think this helps to identify the problem. I will investigate this during the next days if I have the time.
Best regards, David
@CyberDNS
Hey, Yesterday I disconnected the network connection for a short time. However, there was no message in the Lupus Addon afterwards. In the Mosuqitto log, however, I still have these messages as already written now permanently. BUT: The connection is still running and hassio gets all changes of the states of my Lupus sensors. So a short interruption of the connection can not necessarily be the cause... I am confused.
I will close this issue.
If it is still present in the current version, please open a new issue.
Hi! Not sure if I had asked before, but it would be really great to get the plugin to reconnect after a few minutes, when there has been a connection drop. Thanks!