H
Homarr3w ago
vicary

Weather Widget - TRPCClientError: fetch failed

I am having the exact same behavior at https://discord.com/channels/972958686051962910/1329939764094308525, but I am already at 1.20.0 the same issue still persist. The widget never works since installation for like 99% of the time, it successfully fetched weather info for around 30 minutes after I changed the pi-hole integration from IP address to a local hostname. And then it starts failing again and never worked since. Here is a list of things I tried: 1. Disabling pi-hole doesn't help, the query logs shows successful resolution to api.open-meteo.com 2. Fetching the URL within the container gives me HTTP 200 with an empty body, no connection errors. 3. Rebooting or restarting the homarr container doesn't help
Solution:
Turns out it's Node's implementation of Happy Eyeballs (RFC 6555) is messing up normally working connections during a race between ipv4 and ipv6. Adding the following env var removes the issue: ``` NODE_OPTIONS=--network-family-autoselection-attempt-timeout=500...
Jump to solution
14 Replies
Cakey Bot
Cakey Bot3w ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
vicary
vicaryOP3w ago
This is one of the failling logs:
2025-05-21T07:36:33.921Z error: tRPC Error with query on 'widget.weather.atLocation'
at Object.onError (/app/apps/nextjs/.next/server/app/api/trpc/[trpc]/route.js:1:5059)
at Object.onError (/app/apps/nextjs/.next/server/app/api/trpc/[trpc]/route.js:1:4213)
at /app/apps/nextjs/.next/server/chunks/1295.js:98:5069
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:7029
at async /app/apps/nextjs/.next/server/chunks/1295.js:86:836978
caused by TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /app/apps/nextjs/.next/server/chunks/2517.js:6:95625
at async p.middlewares (/app/apps/nextjs/.next/server/chunks/1295.js:89:357167)
at async u (/app/apps/nextjs/.next/server/chunks/1295.js:92:68)
at async u (/app/apps/nextjs/.next/server/chunks/1295.js:92:68)
at async t (/app/apps/nextjs/.next/server/chunks/1295.js:92:403)
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:4887
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:7029
at async /app/apps/nextjs/.next/server/chunks/1295.js:86:836978
caused by AggregateError code="ETIMEDOUT"
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7)
2025-05-21T07:36:33.921Z error: tRPC Error with query on 'widget.weather.atLocation'
at Object.onError (/app/apps/nextjs/.next/server/app/api/trpc/[trpc]/route.js:1:5059)
at Object.onError (/app/apps/nextjs/.next/server/app/api/trpc/[trpc]/route.js:1:4213)
at /app/apps/nextjs/.next/server/chunks/1295.js:98:5069
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:7029
at async /app/apps/nextjs/.next/server/chunks/1295.js:86:836978
caused by TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async /app/apps/nextjs/.next/server/chunks/2517.js:6:95625
at async p.middlewares (/app/apps/nextjs/.next/server/chunks/1295.js:89:357167)
at async u (/app/apps/nextjs/.next/server/chunks/1295.js:92:68)
at async u (/app/apps/nextjs/.next/server/chunks/1295.js:92:68)
at async t (/app/apps/nextjs/.next/server/chunks/1295.js:92:403)
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:4887
at async /app/apps/nextjs/.next/server/chunks/1295.js:98:7029
at async /app/apps/nextjs/.next/server/chunks/1295.js:86:836978
caused by AggregateError code="ETIMEDOUT"
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7)
Meierschlumpf
Meierschlumpf3w ago
ETIMEDOUT indicates that there is something in between like a proxy that Homarr is not using (but curl / wget maybe does?)
vicary
vicaryOP3w ago
I have a Wifi router and nothing else, the only thing being router's DNS points back to this node's Pi Hole. It should really be the same. How should I grab the relevant network info the tRPC server sees?
Meierschlumpf
Meierschlumpf3w ago
Okay then I don't have a clue why this could happen...
vicary
vicaryOP3w ago
Just tried fetching from the node environment, the ETIMEOUT is almost instantaneous. 🤔
$ docker exec -it homarr bash
/app# node
> await fetch('https://api.open-meteo.com/v1/forecast?latitude=...')
Uncaught TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async REPL1:1:47 {
[cause]: AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
code: 'ETIMEDOUT',
[errors]: [ [Error], [Error] ]
}
}
$ docker exec -it homarr bash
/app# node
> await fetch('https://api.open-meteo.com/v1/forecast?latitude=...')
Uncaught TypeError: fetch failed
at node:internal/deps/undici/undici:13510:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async REPL1:1:47 {
[cause]: AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
code: 'ETIMEDOUT',
[errors]: [ [Error], [Error] ]
}
}
Turns out it's because undici prefers IPv6, confirmed using curl --ipv6 in container's shell. But I don't know how to enable IPv6 in the container 😦
Meierschlumpf
Meierschlumpf3w ago
Can you try setting NODE_OPTIONS="--dns-result-order=ipv4first" as env variable?
vicary
vicaryOP3w ago
Interestingly this env var seems to do nothing, running node --dns-result-order=ipv4first inside the container also produce failing fetches.
Meierschlumpf
Meierschlumpf3w ago
Hmm okay, was worth a try
vicary
vicaryOP3w ago
Breaking down the error causes reveals that ETIMEOUT is specifically about the IPv4 connection, because the error message with IPv6 is ENETUNREACH.
AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
code: 'ETIMEDOUT',
[errors]: [
Error: connect ETIMEDOUT 94.130.142.35:443
at createConnectionError (node:net:1677:14)
at Timeout.internalConnectMultipleTimeout (node:net:1736:38)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '94.130.142.35',
port: 443
},
Error: connect ENETUNREACH 2a01:4f8:13b:2e04::2:443 - Local (:::0)
at internalConnectMultiple (node:net:1211:16)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
errno: -101,
code: 'ENETUNREACH',
syscall: 'connect',
address: '2a01:4f8:13b:2e04::2',
port: 443
}
]
}
AggregateError [ETIMEDOUT]:
at internalConnectMultiple (node:net:1139:18)
at internalConnectMultiple (node:net:1215:5)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
code: 'ETIMEDOUT',
[errors]: [
Error: connect ETIMEDOUT 94.130.142.35:443
at createConnectionError (node:net:1677:14)
at Timeout.internalConnectMultipleTimeout (node:net:1736:38)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '94.130.142.35',
port: 443
},
Error: connect ENETUNREACH 2a01:4f8:13b:2e04::2:443 - Local (:::0)
at internalConnectMultiple (node:net:1211:16)
at Timeout.internalConnectMultipleTimeout (node:net:1741:5)
at listOnTimeout (node:internal/timers:590:11)
at process.processTimers (node:internal/timers:523:7) {
errno: -101,
code: 'ENETUNREACH',
syscall: 'connect',
address: '2a01:4f8:13b:2e04::2',
port: 443
}
]
}
It's only node's fetch fails at this point, 1. ❌ node's fetch fails 2. ✅ deno's fetch works 3. ✅ bun's fetch works 4. ✅ curl -4 works The same behavior is observed in all 3 environments: 1. homarr's alpine container 2. Raspberry Pi OS 3. macOS
Solution
vicary
vicary3w ago
Turns out it's Node's implementation of Happy Eyeballs (RFC 6555) is messing up normally working connections during a race between ipv4 and ipv6. Adding the following env var removes the issue:
NODE_OPTIONS=--network-family-autoselection-attempt-timeout=500
NODE_OPTIONS=--network-family-autoselection-attempt-timeout=500
vicary
vicaryOP3w ago
I have no way to tell if 500ms is a good value in general for DNS latencies being variable, and I genuinely think Node.js really messed things up at this specific number.
Meierschlumpf
Meierschlumpf3w ago
Interessting...
vicary
vicaryOP3w ago
More context about the short default of 250ms here: https://github.com/nodejs/node/issues/54359 While the contributor is strongly arguing for this value, there is quite a large number of users seeked help after said implementation last year. So yeah, I'm not sure how well they think they understand their own community.
GitHub
Happy eyeballs implementation times out prematurely · Issue #54359...
Version v20.12.2 Platform Linux 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? In an IPv4-only environment: NODE_DEB...

Did you find this page helpful?