{"record":{"id":"61abea19ba56dd2e","repo":"EpicGames/lore","slug":"failed-to-start-maintenance-http-server-err","errorCode":null,"errorMessage":"Failed to start maintenance HTTP server: {err}","messagePattern":"Failed to start maintenance HTTP server: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lore-server/src/http/server.rs","lineNumber":242,"sourceCode":"        )\n        .map_err(|err| anyhow!(\"{} {err}\", presign_content_type_field(err.field())))?,\n    }))\n}\n\nimpl LoreHttpServer {\n    /// Starts a minimal HTTP server that only serves the `/health_check` endpoint.\n    ///\n    /// Used during maintenance mode so that load balancers and monitoring systems\n    /// can still reach the server. Always returns 200 OK (store health checks are\n    /// disabled since the server is intentionally in a reduced state).\n    pub async fn serve_maintenance(\n        host: String,\n        port: i32,\n        user_agent_filter: Arc<UserAgentFilter>,\n        signal: impl Future<Output = ()> + Send + 'static,\n    ) -> Result<()> {\n        let addr = SocketAddr::from_str(format!(\"{host}:{port}\").as_str())\n            .map_err(|err| anyhow!(\"Failed to start maintenance HTTP server: {err}\"))?;\n        info!(\"Starting Lore maintenance HTTP Server: {}\", &addr);\n\n        let health = Arc::new(ServerHealth {\n            immutable_store: Weak::<lore_storage::LocalImmutableStore>::new(),\n            available: AtomicBool::new(true),\n            interval_timeout: None,\n            store_health_check: false,\n        });\n\n        let app = Router::new()\n            .route(\n                \"/health_check\",\n                routing::get(health_check::handler).with_state(health),\n            )\n            .layer(HttpMetricsLayer::new(user_agent_filter))\n            .layer(CoreHopLayer);\n\n        let listener = TcpListener::bind(addr)","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/http/server.rs#L224-L260","documentation":"serve_maintenance parses \"host:port\" into a SocketAddr before binding the maintenance HTTP server. If parsing fails (invalid host or port), the failure is wrapped as \"Failed to start maintenance HTTP server\". The maintenance endpoint never starts.","triggerScenarios":"Calling serve_maintenance with a host that is not an IP/parseable address (e.g. a DNS name with underscores, or empty host) or a port outside 0–65535 / non-numeric.","commonSituations":"Config uses a hostname where a socket address is expected; port configured as \"http\" service name; host left empty in YAML; IPv6 zone syntax mistakes.","solutions":["Check the maintenance host/port settings; the port must be a number 0–65535 and the host an IP address.","Use 0.0.0.0 or 127.0.0.1 for the host instead of a DNS name if parsing keeps failing.","Resolve DNS names to IPs outside the config, since SocketAddr::from_str does not do DNS lookup."],"exampleFix":"// before (config)\nmaintenance_host = \"maintenance.internal\"  // not parseable as SocketAddr\n// after\nmaintenance_host = \"0.0.0.0\"\nmaintenance_port = 9090","handlingStrategy":"validation","validationCode":"\"127.0.0.1:9090\".parse::<std::net::SocketAddr>()\n    .map_err(|e| format!(\"maintenance addr invalid: {e}\"))?;","typeGuard":null,"tryCatchPattern":"match serve_maintenance(...).await {\n    Err(e) if e.to_string().contains(\"Failed to start maintenance HTTP server\") => {\n        eprintln!(\"check maintenance host/port settings: {e}\");\n        std::process::exit(1);\n    }\n    other => other?,\n}","preventionTips":["Use IP literals (0.0.0.0, 127.0.0.1) for host fields, not DNS names.","Keep ports as integers in the 0–65535 range in config and env.","Render config templates with strict empty-value checks so host is never blank."],"tags":["network","config","address-parsing","startup"],"backgroundTag":"invalid-url-format","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}