{"record":{"id":"d7b41c5a6374278f","repo":"Kuberwastaken/claurst","slug":"no-authentication-available-for-remote-settings","errorCode":null,"errorMessage":"No authentication available for remote settings","messagePattern":"No authentication available for remote settings","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/remote_settings.rs","lineNumber":196,"sourceCode":"        tokio::fs::write(&self.cache_path, text).await?;\r\n        Ok(())\r\n    }\r\n\r\n    /// Delete the on-disk cache file.\r\n    pub async fn clear_cache(&self) {\r\n        let _ = tokio::fs::remove_file(&self.cache_path).await;\r\n    }\r\n\r\n    /// Perform a single fetch attempt (no retries).\r\n    ///\r\n    /// Returns:\r\n    /// - `Ok(Some(settings))` — new settings fetched\r\n    /// - `Ok(None)` — 304 Not Modified; caller should keep cached value\r\n    /// - `Err(...)` — transient or permanent failure\r\n    async fn fetch_once(&self, cached_checksum: Option<&str>) -> Result<Option<Value>> {\r\n        let auth = self\r\n            .auth_headers()\r\n            .ok_or_else(|| anyhow::anyhow!(\"No authentication available for remote settings\"))?;\r\n\r\n        let mut req = self.http.get(self.endpoint());\r\n        for (k, v) in &auth {\r\n            req = req.header(k.as_str(), v.as_str());\r\n        }\r\n        if let Some(cs) = cached_checksum {\r\n            req = req.header(\"If-None-Match\", format!(\"\\\"{}\\\"\", cs));\r\n        }\r\n\r\n        let resp = req.send().await?;\r\n        let status = resp.status().as_u16();\r\n\r\n        match status {\r\n            304 => {\r\n                debug!(\"Remote settings: 304 Not Modified — cache still valid\");\r\n                return Ok(None);\r\n            }\r\n            204 | 404 => {\r","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/remote_settings.rs#L178-L214","documentation":"RemoteSettings::fetch_once requires auth headers for the settings endpoint; when auth_headers() returns None it fails instead of making an anonymous request. Remote settings are gated behind authentication, so no credentials means no fetch. fetch_with_retry propagates this as a permanent failure.","triggerScenarios":"Calling fetch_with_retry/fetch_once when the user has no stored credentials (fresh install, logged out, or auth store empty) and the remote settings endpoint requires authentication.","commonSituations":"Running before first login/OAuth flow; credentials expired and were cleared; CI environment without an auth token; auth store file missing or unreadable.","solutions":["Complete the authentication flow so the auth store has valid credentials.","Skip remote-settings fetch when unauthenticated (treat as a no-op rather than an error).","Set the required token env var / config if the auth store supports it."],"exampleFix":"// before\nsettings.fetch_with_retry().await?;\n// after\nif settings.auth_headers().is_some() {\n    let _ = settings.fetch_with_retry().await; // or map Err to a warning\n} // else: keep cached settings","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match settings.fetch_with_retry().await {\n    Ok(Some(s)) => apply(s),\n    Ok(None) | Err(_) => apply_cached(), // 304 or unauthenticated: keep cache\n}","preventionTips":["Complete the auth flow before enabling remote settings sync.","Treat remote settings as best-effort: always keep a cached default.","In CI, provide a token or explicitly disable remote settings."],"tags":["authentication","settings","network"],"backgroundTag":"authentication-required","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}