{"record":{"id":"9b67bfb29284b044","repo":"louis-e/arnis","slug":"failed-to-fetch-data","errorCode":null,"errorMessage":"Failed to fetch data","messagePattern":"Failed to fetch data","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":369,"sourceCode":"            (ground, t.elapsed())\n        });\n\n        let t = std::time::Instant::now();\n        // A local file was already parsed up front (to derive the bbox), so reuse that data.\n        // Terrain-only carries no objects. Otherwise fetch from Overpass, in parallel with the\n        // Overture and land-cover fetches spawned above.\n        let raw_data = if skip_objects {\n            osm_parser::OsmData::empty()\n        } else if let Some(data) = preloaded_osm.take() {\n            data\n        } else {\n            retrieve_data::fetch_data_from_overpass(\n                effective_bbox,\n                args.debug,\n                args.downloader.as_str(),\n                args.save_json_file.as_deref(),\n            )\n            .expect(\"Failed to fetch data\")\n        };\n        bench.report(\"osm_fetch\", t.elapsed());\n\n        // A panicked worker already reported itself through the panic hook, so\n        // degrade instead of taking the whole run down with it.\n        let (overture_data, overture_dur) = overture_handle.join().unwrap_or_else(|_| {\n            eprintln!(\n                \"{} Overture fetch failed, continuing without Overture buildings.\",\n                \"Warning:\".yellow().bold()\n            );\n            (overture::OvertureData::default(), std::time::Duration::ZERO)\n        });\n        bench.report(\"overture_fetch\", overture_dur);\n        let (ground, ground_dur) = ground_handle.join().unwrap_or_else(|_| {\n            eprintln!(\"{} Terrain fetch failed.\", \"Error:\".red().bold());\n            std::process::exit(1);\n        });\n        bench.report(\"terrain_total\", ground_dur);","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/louis-e/arnis/blob/34048924d9365795fb0d832e76140a3fbdc413d9/src/main.rs#L351-L387","documentation":"In run_cli, the Overpass fetch is the fallible path: retrieve_data::fetch_data_from_overpass returns Result<OsmData, Box<dyn Error>>, and the CLI unwraps it with .expect(\"Failed to fetch data\"). The function tries multiple Overpass servers (Arnis mirror plus public instances) with several downloaders (reqwest/curl/wget) and gives up only when every server/attempt fails — network outage, DNS failure, HTTP 429/5xx, timeouts, or an unparseable response.","triggerScenarios":"Calling the CLI (run_cli, from main) with an online fetch when: no internet/DNS resolution fails; all Overpass endpoints return 429 (rate-limited) or 504 (server overload, common for large bboxes); the configured downloader ('reqwest', 'curl', 'wget') is unavailable or blocked by a proxy/firewall; the response is not valid Overpass JSON/XML so parse_overoverpass_response fails.","commonSituations":"Generating a world for a very large bounding box that times out on public Overpass instances; running during an Overpass maintenance window; corporate proxy blocking the requests; spamming retries and getting rate-limited; typo in --downloader so the external tool isn't found.","solutions":["Re-run later or reduce the bounding box size — public Overpass servers are rate-limited and often overloaded","Switch downloader with --downloader curl (or wget) if reqwest is blocked by TLS/proxy issues","Check connectivity/DNS and any proxy env vars (HTTP_PROXY/HTTPS_PROXY); test one endpoint manually with curl","Use --save-json-file with a previously downloaded dump, or preload a local OSM JSON file so no network fetch happens","Consider self-hosting or using an alternative Overpass mirror if the default endpoints keep failing"],"exampleFix":"// before\n./arnis --bbox 48.10,11.55,48.16,11.60 --downloader reqwest\n// after: smaller area and alternate downloader, saving the raw JSON\n./arnis --bbox 48.12,11.57,48.14,11.59 --downloader curl --save-json-file munich.json","handlingStrategy":"retry","validationCode":"fn overpass_reachable() -> bool {\n    std::process::Command::new(\"curl\")\n        .args([\"-sf\", \"-m\", \"10\",\n               \"https://api.arnismc.com/overpass/api/interpreter?data=[out:json];out;\"])\n        .output().map(|o| o.status.success()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match retrieve_data::fetch_data_from_overpass(bbox, debug, downloader, save_file) {\n    Ok(data) => data,\n    Err(e) => {\n        eprintln!(\"Overpass fetch failed: {e}\");\n        eprintln!(\"Retrying with curl after backoff...\");\n        // exponential backoff retry, then fall back to a local JSON file\n        retry_or_load_cached(bbox)?\n    }\n}","preventionTips":["Keep bounding boxes small; split huge regions into multiple runs","Prefer --downloader curl/wget when reqwest hits TLS or proxy problems","Cache successful fetches with --save-json-file and reuse them offline","Retry with backoff — 429/504 from Overpass are usually transient","Monitor Overpass server status pages before large generations"],"tags":["network","overpass-api","rust","panic","http"],"backgroundTag":"overpass-fetch-failed","analyzedSha":"34048924d9365795fb0d832e76140a3fbdc413d9","analyzedAt":"2026-09-03T14:05:17.283Z","contentChangedAt":"2026-09-03T14:05:17.283Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}