Open eloekset opened 1 year ago
Application insights on the on-prem Netatmo proxy tracks requests against http://io.adafruit.com/api/.../time/strftime for some reason. This happens twice a minute (on every loop) once it starts. And all requests get http 404 not found.
It's surprising to see this information logged in Application Insights, because there's no logging on the PyPortal device. Application Insights is connected to the on-prem ASP.NET Core web api that proxies the Netatmo API. Requests from PyPortal to http://io.adafruit.com/api should not go through the on-proxy application at all. So how is this possible? If it happens, it's not very surprising that the response is http 404.
This is a diagram showing the unexpected flow when PyPortal.get_local_time()
runs on second and later iterations:
This graph shows how the traffic suddenly switches from the expected http://<local-ip>:8080/api/Display
to http://io.adafruit.com/api/.../time/strftime
endpoint.
The last request that made PyPortal raise TimeoutError took only 257 micro seconds:
That was after 681 failing requests during around 10 minutes:
I just realized that this error has a different message than the first one when the issue was opened. But the error type is the same.
See if the error goes away if the .NET proxy application implements a handler for the route that PyPortal uses to refresh local time:
The display has been running for a while now, and Application Insights proves that it's the on-prem proxy API that is called instead of http://io.adafruit.com/. This is very strange behavior.
The issue doesn't occur when PyPortal is running in my apartment. I guess the router was causing the issue.
The problem is back. And this time it ran for more than 24 hours before it crashed. Application Insights says there was no requests for strftime when PyPortal crashed, so that means it was the official API at io.adafruit.com that was called when TimeoutError occurred.
And now the routing issue happened on my own LAN too:
Error after running through the night. Timeout when calling API to update local time: