{"record":{"id":"d5fa2f15f5909365","repo":"rust-lang/rust","slug":"url-doesn-t-start-with-dist-server-base","errorCode":null,"errorMessage":"url doesn't start with dist server base: {}","messagePattern":"url doesn't start with dist server base: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/bump-stage0/src/main.rs","lineNumber":196,"sourceCode":"            date: manifest.date,\n            version: \"nightly\".into(),\n        }))\n    }\n\n    fn collect_checksums(&mut self, manifest: &Manifest, components: &[&str]) -> Result<(), Error> {\n        let prefix = format!(\"{}/\", self.config.dist_server);\n        for component in components {\n            let pkg = manifest\n                .pkg\n                .get(*component)\n                .ok_or_else(|| anyhow::anyhow!(\"missing component from manifest: {}\", component))?;\n            for target in pkg.target.values() {\n                for pair in &[(&target.url, &target.hash), (&target.xz_url, &target.xz_hash)] {\n                    if let (Some(url), Some(sha256)) = pair {\n                        let url = url\n                            .strip_prefix(&prefix)\n                            .ok_or_else(|| {\n                                anyhow::anyhow!(\"url doesn't start with dist server base: {}\", url)\n                            })?\n                            .to_string();\n                        self.checksums.insert(url, sha256.clone());\n                    }\n                }\n            }\n        }\n        for artifact in manifest.artifacts.values() {\n            for targets in artifact.target.values() {\n                for target in targets {\n                    let url = target\n                        .url\n                        .strip_prefix(&prefix)\n                        .ok_or_else(|| {\n                            anyhow::anyhow!(\n                                \"url doesn't start with dist server base: {}\",\n                                target.url\n                            )","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/bump-stage0/src/main.rs#L178-L214","documentation":"Thrown by collect_checksums (the per-target url/hash loop) when a target's url field does not start with the configured dist_server prefix (config.dist_server + '/'). The prefix is stripped so the checksum map is keyed by a server-relative path; a url that is not under the dist server base would produce a wrong key.","triggerScenarios":"A component target url in the manifest points to a different host or CDN than config.dist_server; the dist_server value in src/stage0 was changed but the manifest still references the old base; a manifest entry uses an absolute URL to an external mirror.","commonSituations":"Editing the dist_server base in src/stage0 config section; switching manifest source between stable and nightly where URLs differ; an upstream manifest bug publishing an off-base URL.","solutions":["Compare the failing url (printed in the error) against config.dist_server in src/stage0.","Update config.dist_server to the base actually used by the manifest URLs, or fix the manifest so URLs are under the configured base.","If a target legitimately uses an external URL, special-case it rather than relying on the prefix strip."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Before stripping the prefix, check the url is under the configured base.\nlet prefix = format!(\"{}/\", config.dist_server);\nfor target in pkg.target.values() {\n    if let Some(url) = &target.url {\n        if !url.starts_with(&prefix) {\n            eprintln!(\"target url {url} is not under dist server base {}; skipping\", config.dist_server);\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep config.dist_server in src/stage0 aligned with the host used by manifest URLs.","When changing the dist server base, regenerate stage0 against a matching manifest.","Validate manifest URLs are relative to the expected base before bumping."],"tags":["bump-stage0","manifest","url","configuration"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}