{"record":{"id":"9610d3098847c96c","repo":"nikivdev/code","slug":"registry-manifest-upload-failed","errorCode":null,"errorMessage":"registry manifest upload failed ({})","messagePattern":"registry manifest upload failed \\((.+?)\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/registry.rs","lineNumber":208,"sourceCode":"        if !response.status().is_success() {\n            bail!(\"registry upload failed for {} ({})\", bin, response.status());\n        }\n    }\n\n    let manifest_url = format!(\n        \"{}/packages/{}/{}/manifest.json\",\n        registry_url, package, version\n    );\n    let mut request = client\n        .put(manifest_url)\n        .header(\"Authorization\", format!(\"Bearer {}\", token))\n        .body(serde_json::to_string_pretty(&manifest)?);\n    if latest {\n        request = request.query(&[(\"latest\", \"1\")]);\n    }\n    let response = request.send().context(\"failed to upload manifest\")?;\n    if !response.status().is_success() {\n        bail!(\"registry manifest upload failed ({})\", response.status());\n    }\n\n    println!(\"Published {} {} to {}\", package, version, registry_url);\n    Ok(())\n}\n\npub fn install(opts: InstallOpts) -> Result<()> {\n    let name = opts.name.as_deref().unwrap_or(\"\").trim().to_string();\n    if name.is_empty() {\n        bail!(\"package name is required for registry install\");\n    }\n    let global_registry = load_global_registry_config();\n    let registry_url = resolve_registry_url(opts.registry.as_deref(), global_registry.as_ref())?;\n    let client = Client::builder().timeout(Duration::from_secs(60)).build()?;\n    let version = opts.version.clone();\n    let manifest = fetch_manifest(&client, &registry_url, &name, version.as_deref())?;\n    let target = detect_target_triple()?;\n    let target_entry = manifest","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/registry.rs#L190-L226","documentation":"After uploading binaries, publish uploads the package manifest JSON. If the registry returns a non-success status for the manifest upload (optionally with ?latest=1), publish bails with 'registry manifest upload failed (<status>)'. The binaries may already be uploaded at this point, leaving a partially published package.","triggerScenarios":"POSTing the serialized manifest to `<registry_url>/packages/<package>/<version>/manifest.json` and getting a non-2xx response — auth failure, schema rejection, or version conflict.","commonSituations":"Token lacks manifest write permission even though binary upload succeeded; manifest JSON rejected by server validation; version already published with a different manifest.","solutions":["Inspect the returned status and registry-side validation errors for the manifest.","Re-authenticate — the token may permit binary but not manifest writes.","Bump the version if the manifest conflicts with an existing publication.","Re-run publish: binaries are keyed by content hash, so re-upload is safe."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// Pre-flight manifest validation: serializable and version not conflicting\nlet body = serde_json::to_string_pretty(&manifest)?;\nassert!(!body.is_empty());\n// check existing manifest\nlet existing = client.get(format!(\"{url}/packages/{pkg}/{ver}/manifest.json\")).send()?.status();\nif existing.is_success() { return Err(\"version exists; bump the version\".into()); }","typeGuard":null,"tryCatchPattern":"match publish(opts) {\n    Err(e) if e.to_string().contains(\"registry manifest upload failed\") => {\n        eprintln!(\"Binaries uploaded but manifest rejected — inspect registry validation rules, then re-run publish (idempotent for binaries).\");\n        std::process::exit(1);\n    }\n    other => other,\n}","preventionTips":["Validate the manifest against the registry's schema before publishing.","Ensure the token has both binary and manifest write scopes.","Re-running publish is safe: binaries are content-keyed; manifest upload retried.","Check version conflicts before publishing."],"tags":["network","http","publish","manifest"],"backgroundTag":"http-upload-rejected","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}