You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
futurerate.py: requests.get() has no timeout - a stalled Nord Pool connection freezes the main loop indefinitely (follow-up to #1469) #4525
The Nord Pool day-ahead fetch in futurerate.py (download_futurerate_data_func, currently line 415) calls:
r=requests.get(url)
with no timeout argument. If the TCP connection stalls silently (established but no response - e.g. a mid-transfer network drop, rather than a clean connection failure), no exception is raised, so the surrounding try/except from #1469 never fires, and the call blocks the main prediction loop forever.
This happened to me on 2026-08-15 at midnight (v8.48.1): the update run reached the futurerate fetch and the main loop then hung for over 4 hours until I restarted the add-on manually. Because background threads (Solcast, Axle, history pruning) keep running, the add-on looks healthy - predbat.status stays on its last value with error=false, and no new plan runs happen. Meanwhile the inverter stayed latched in the last commanded state (a force-export slot in my case), which drained the battery to 0% overnight and missed the whole cheap import window.
Log extract (everything from the main loop simply stops after the fetch line; the LoadML timeout 2 hours later is a downstream symptom - it was waiting for the prediction cycle to complete):
2026-08-15 00:00:02.305444: FutureRate: Detected import tariff E-1R-INTELLI-FIX-12M-26-06-13-E agile False export tariff E-1R-AGILE-OUTGOING-19-05-13-E agile True
2026-08-15 00:00:02.305478: Fetching futurerate data from https://dataportal-api.nordpoolgroup.com/api/DayAheadPrices?date=DATE&market=N2EX_DayAhead&deliveryArea=UK¤cy=GBP
[no further main-loop output - no more "PredBat - update at" headers or plan calculations]
2026-08-15 02:06:29.719588: Error: LoadMLComponent: run() exceeded 7200s timeout:
2026-08-15 02:06:29.719688: Warn: LoadMLComponent: run() returned False
This looks like the same failure family as #1469 ("Internet connection failure not trapped, predbat freezes", Sept 2024). That fix added the try/except, which handles connection errors - but a silent stall raises nothing to catch. The bare requests.get(url) has been unchanged since futurerate.py was created in the #1655 code split (Nov 2024) and is still on current main.
Expected behaviour
A hung Nord Pool connection should time out after a bounded period, get caught by the existing exception handler, retry (the existing 3-attempt loop), and fall back to cached rates - i.e. exactly what the #1469 error path already does for clean failures.
Suggested one-line fix:
r=requests.get(url, timeout=30)
(or timeout=(10, 30) for separate connect/read timeouts). I've been running this patch locally on two installs since the incident with no ill effects - a stalled fetch now falls back to cached data as intended.
Activity
fix: add timeout=30 to requests.get() in futurerate.py and octopus.py…
fix: add timeout to requests.get() in futurerate.py and octopus.py (s…