LordMike / MBW.BlueRiiot2MQTT

Utility to map between Blue Riiots pool API, and Home Assistant MQTT
47 stars 2 forks source link

BlueRiiot stopped updating #66

Closed mcs1998 closed 2 years ago

mcs1998 commented 2 years ago

Dear all, Was running the app via docker for a couple of weeks on a debian buster machine. It was updating fine into my homeassistant. A few days ago, without any apparnet reason I get the following error:

[2022-01-09 06:52:36+00:00 ERR] [MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService] An error occurred while performing the update
System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)
   at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
   at Microsoft.Extensions.Http.PolicyHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at MBW.Client.BlueRiiotApi.BlueClient.LoginWithUsernamePassword(String email, String password, CancellationToken token)
   at MBW.Client.BlueRiiotApi.Builder.UsernamePasswordRequestSigner.LoginIfNeeded(BlueClient client, CancellationToken token)
   at MBW.Client.BlueRiiotApi.BlueClient.PerformHttp[TRequest,TResponse](String path, HttpMethod method, TRequest requestBody, CancellationToken token)
   at MBW.Client.BlueRiiotApi.BlueClient.GetSwimmingPools(Boolean deleted, CancellationToken token)
   at MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService.PerformUpdate(CancellationToken stoppingToken) in /src/MBW.BlueRiiot2MQTT/Service/BlueRiiotMqttService.cs:line 132
   at MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService.ExecuteAsync(CancellationToken stoppingToken) in /src/MBW.BlueRiiot2MQTT/Service/BlueRiiotMqttService.cs:line 75

I assume the app is not communicating with the the blueriiot server. Restart, reload in docker, did not help. I removed the image in docker and reinstalled, to no avail.

I also tried verbose logging of HTTP by adding : -e LoggingMinimumLevelOverride__MBW.Client.BlueRiiotApi=Verbose to the docker command, which did not really change the logs.

Any help would be greatly appreciated. Best regards Michael

LordMike commented 2 years ago

This is a timeout - the BlueRiiot API did not respond within the time limit.

It may just be a hiccup on their end.

mcs1998 commented 2 years ago

Thank you very much for the reply. I have this for 5 days now. I have tried changing passwords etc. The blueriiot app connects fine. The http logging does not appear in the docker logs, can I find those somewhere else? Any other suggestions for troubleshooting? Sorry to be a pain, your help is very much appreciated. Best regards Michael

LordMike commented 2 years ago

It's probably on the lower levels, try the following in addition to the other logging setting you set:

-e LoggingMinimumLevelDefault=Verbose -e LoggingMinimumLevelOverrideSystem.Net.Http.HttpClient.blueriiot=Verbose -e LoggingMinimumLevelOverrideMicrosoft.Extensions.Http=Verbose

LordMike commented 2 years ago

... I will say though, that since it times out, you may have an issue like the following:

The error you have is within the login process, so it's the very first thing it does.

Logs should appear in the console of the blueriiot2mqtt container.

mcs1998 commented 2 years ago

Thank you very much for the great suggestions. I will investigate now and report back when solved. Best regards Michael

mcs1998 commented 2 years ago

You were correct Mike. Docker did not resolve dns, because it would not listen to the hosts loopback address but docker's own internal loop back device. See: https://docs.docker.com/engine/install/linux-postinstall/ I created the following: /etc/docker/daemon.json with: { "dns": ["8.8.8.8", "8.8.4.4", "mylocal dns resolver ip address"] }

Voila, this did the trick. Thank you very much Michael

LordMike commented 2 years ago

Awesome :)