{"record":{"id":"9a5d5667a8136746","repo":"Kuberwastaken/claurst","slug":"remote-settings-not-authorized","errorCode":null,"errorMessage":"Remote settings: not authorized ({})","messagePattern":"Remote settings: not authorized \\((.+?)\\)","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"src-rust/crates/core/src/remote_settings.rs","lineNumber":221,"sourceCode":"            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\n                debug!(\"Remote settings: {} — no settings configured\", status);\r\n                return Ok(Some(Value::Object(Default::default())));\r\n            }\r\n            200 => {}\r\n            401 | 403 => {\r\n                // Auth errors are terminal — no point retrying\r\n                anyhow::bail!(\"Remote settings: not authorized ({})\", status);\r\n            }\r\n            other => {\r\n                anyhow::bail!(\"Remote settings: unexpected status {}\", other);\r\n            }\r\n        }\r\n\r\n        let body: Value = resp.json().await?;\r\n\r\n        // Try to parse as the expected response shape, but be permissive —\r\n        // accept raw settings object if the wrapper is missing.\r\n        let (settings, _checksum) = if let Ok(parsed) =\r\n            serde_json::from_value::<RemoteSettingsResponse>(body.clone())\r\n        {\r\n            (parsed.settings, parsed.checksum)\r\n        } else if body.is_object() {\r\n            (body, None)\r\n        } else {\r\n            anyhow::bail!(\"Remote settings: unexpected response shape\");\r","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/remote_settings.rs#L203-L239","documentation":"The remote-settings fetch received 401 or 403: the stored credentials were rejected by the settings endpoint. Auth errors are treated as terminal (the formatted status is which of the two), so the fetch is not retried and cached settings remain in effect.","triggerScenarios":"Thrown at src-rust/crates/core/src/remote_settings.rs:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-authenticate (log in again) to refresh the token, then retry the settings fetch","Verify the token has the required scope for the settings endpoint","Until fixed, the app continues with locally cached/default settings"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}