Commit 6b4dadf
authored
fix(seeder): replace curlFetch with Node.js CONNECT tunnel in fredFetchJson (koala73#2451)
* chore: redeploy to pick up WORLDMONITOR_VALID_KEYS fix
* fix(seeder): replace curlFetch with Node.js CONNECT tunnel in fredFetchJson
Seeder Railway containers use node:22-alpine (no curl). fredFetchJson was
routing through curlFetch when PROXY_URL is set, causing spawnSync curl
ENOENT on every FRED series — all 22 series failed silently.
Fix: replace curlFetch call in fredFetchJson with a pure Node.js
HTTPS-through-HTTP-proxy CONNECT tunnel using built-in http/tls/https
modules. No new dependencies. curlFetch is kept for ais-relay.cjs callers
(Dockerfile.relay installs curl via apk add).
Root cause confirmed via logs: spawnSync curl ENOENT on all 22 FRED series.
* fix(seeder): try direct first, proxy as fallback in fredFetchJson
* chore(seeder): TODO to consolidate all curlFetch/proxy patterns into one helper
* fix(seeders): remove curl dependency from disease-outbreaks and fear-greed
Both seeders used curl as primary fetch path when PROXY_URL was set.
The Decodo proxy was returning SSL_ERROR_SYSCALL causing fetch failures.
Replace with native fetch() — same direct-first pattern as fredFetchJson
after the FRED fix. No fallback needed: these feeds are publicly accessible,
and partial failures are already handled by per-source try/catch.
* fix(seeder): add User-Agent to proxy tunnel; destroy socket on CONNECT failure
P1: httpsProxyFetchJson was missing User-Agent header — AGENTS.md requires
it for all server-side fetches; FRED CDN/WAF may reject headless requests.
P2: TCP socket left open on non-200 CONNECT response; call socket.destroy().1 parent cc3c50c commit 6b4dadf
3 files changed
Lines changed: 106 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
301 | 308 | | |
302 | 309 | | |
303 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
304 | 318 | | |
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
308 | 322 | | |
309 | 323 | | |
310 | 324 | | |
| 325 | + | |
| 326 | + | |
311 | 327 | | |
312 | 328 | | |
313 | 329 | | |
| |||
321 | 337 | | |
322 | 338 | | |
323 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
324 | 408 | | |
325 | 409 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
330 | 418 | | |
331 | 419 | | |
332 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 44 | | |
62 | 45 | | |
63 | 46 | | |
| |||
131 | 114 | | |
132 | 115 | | |
133 | 116 | | |
134 | | - | |
| 117 | + | |
135 | 118 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
147 | 125 | | |
148 | 126 | | |
149 | 127 | | |
| |||
268 | 246 | | |
269 | 247 | | |
270 | 248 | | |
271 | | - | |
| 249 | + | |
272 | 250 | | |
273 | 251 | | |
274 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 6 | | |
25 | 7 | | |
26 | 8 | | |
| |||
33 | 15 | | |
34 | 16 | | |
35 | 17 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
43 | 22 | | |
44 | 23 | | |
45 | 24 | | |
| |||
0 commit comments