{"record":{"id":"746bc5ba11681602","repo":"nikivdev/code","slug":"registry-returned","errorCode":null,"errorMessage":"registry returned {}","messagePattern":"registry returned (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":428,"sourceCode":"                }\n            }\n        }\n        if let Some(value) = max_suffix {\n            return format!(\"{}-{}\", base, value + 1);\n        }\n    }\n    base\n}\n\nfn fetch_registry_versions(registry_url: &str, package: &str) -> Result<Vec<String>> {\n    let client = Client::builder().timeout(Duration::from_secs(10)).build()?;\n    let url = format!(\"{}/packages/{}/versions.json\", registry_url, package);\n    let resp = client.get(url).send()?;\n    if resp.status().as_u16() == 404 {\n        return Ok(Vec::new());\n    }\n    if !resp.status().is_success() {\n        bail!(\"registry returned {}\", resp.status());\n    }\n    #[derive(Deserialize)]\n    struct VersionsResponse {\n        versions: Vec<String>,\n    }\n    let parsed: VersionsResponse = resp.json()?;\n    Ok(parsed.versions)\n}\n\nfn fetch_manifest(\n    client: &Client,\n    registry_url: &str,\n    name: &str,\n    version: Option<&str>,\n) -> Result<RegistryManifest> {\n    let url = match version {\n        Some(version) => format!(\n            \"{}/packages/{}/{}/manifest.json\",","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/registry.rs#L410-L446","documentation":"fetch_registry_versions GETs `<registry_url>/packages/<package>/versions.json` to list existing versions (used by calver_version to dedupe same-day releases). A 404 is treated as an empty list (new package); any other non-success status bails with 'registry returned <status>'.","triggerScenarios":"During calver-based publish, the versions.json request returns a non-success, non-404 status — e.g. 401/403 on a private package, 500 on registry failure, or a proxy returning 502/503.","commonSituations":"Registry requires auth for listing versions of a private package; registry outage or load balancer error page; misconfigured registry_url pointing at a non-registry host.","solutions":["Check the status code: 401/403 means you need credentials for listing versions of that package.","Verify registry_url is correct and the registry is healthy (5xx/502/503 → retry later).","If behind a proxy, ensure it forwards requests to the registry rather than serving error pages."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// Pre-flight: check registry reachability before publish\nlet health = client.get(format!(\"{}/health\", registry_url)).send()?.status();\nif !health.is_success() {\n    return Err(format!(\"registry unhealthy ({}) — aborting calver publish\", health));\n}","typeGuard":null,"tryCatchPattern":"match publish(opts) {\n    Err(e) if e.to_string().contains(\"registry returned\") => {\n        if e.to_string().contains(\"50\") {\n            retry_with_backoff(3, || publish(opts.clone()));\n        } else {\n            eprintln!(\"Registry rejected version listing (auth for private packages?) — check credentials.\");\n            std::process::exit(1);\n        }\n    }\n    other => other,\n}","preventionTips":["Ensure listing credentials are available for private packages (401/403 on versions.json).","Health-check the registry before release windows.","Verify registry_url points at the actual registry, not a proxy error page.","Retry on 5xx with backoff; 404 is fine (treated as new package)."],"tags":["network","http","registry","versioning"],"backgroundTag":"http-request-failed","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}