{"record":{"id":"adf59df42048e781","repo":"denoland/deno","slug":"error-adf59d","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/tools/publish/mod.rs","lineNumber":1190,"sourceCode":"        format!(\n          \"Failed to get publishing status for @{}/{} at {}\",\n          package.scope, package.package, package.version\n        )\n      })?;\n    task = registry::parse_response::<registry::PublishingTask>(resp)\n      .await\n      .with_context(|| {\n        format!(\n          \"Failed to get publishing status for @{}/{} at {}\",\n          package.scope, package.package, package.version\n        )\n      })?;\n  }\n\n  if let Some(error) = task.error {\n    // The caller adds the \"Failed to publish <name>@<version>\" context, so only\n    // surface the registry's error message here to avoid a doubled prefix.\n    bail!(\"{}\", error.message);\n  }\n\n  let enable_provenance = std::env::var(\"DISABLE_JSR_PROVENANCE\").is_err()\n    && (auth::is_gha() && auth::gha_oidc_token().is_some() && provenance);\n\n  // Enable provenance by default on Github actions with OIDC token\n  if enable_provenance {\n    // Get the version manifest from the registry\n    let meta_url = jsr_url().join(&format!(\n      \"@{}/{}/{}_meta.json\",\n      package.scope, package.package, package.version\n    ))?;\n\n    let resp = http_client\n      .get(meta_url.clone())?\n      .send()\n      .await\n      .with_context(|| {","sourceCodeStart":1172,"sourceCodeEnd":1208,"githubUrl":"https://github.com/denoland/deno/blob/f7822238cab635a3a19f99f493f675fa81a7f9d8/cli/tools/publish/mod.rs#L1172-L1208","documentation":"JSR accepts a publish as a server-side task; `deno publish` polls the task's status and surfaces the registry's own error message when that task reached the error state (the calling layer adds the 'Failed to publish @scope/pkg@version' prefix, so no doubling here). The text comes straight from JSR — typical examples are 'version already exists', scope authorization failures, or rejected package metadata.","triggerScenarios":"The registry publish task fails server-side: re-publishing an existing version (race between two runs), the authenticated user lacking permission for the scope, or content JSR rejects (name/version rules, invalid files).","commonSituations":"Two CI jobs racing to publish the same version; the token's account was removed from the org/scope; forgetting the version bump after a failed-then-fixed release; JSR incidents.","solutions":["Read the surfaced message: 'already exists' → bump `version` in deno.json; authorization errors → check scope membership on jsr.io for the account tied to the token.","Fix per the message and re-run — publish is idempotent for versions that already succeeded.","If the message suggests an outage, retry later and check https://status.jsr.io."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"#!/usr/bin/env bash\nout=\"$(deno publish 2>&1)\" || {\n  rc=$?\n  if printf '%s' \"$out\" | grep -qi 'already exists'; then\n    echo \"version already on JSR — bump version and re-run\" >&2; exit 10\n  elif printf '%s' \"$out\" | grep -qi 'unauthorized\\|not a member\\|forbidden'; then\n    echo \"scope permission problem — check jsr.io scope membership for this account\" >&2; exit 11\n  fi\n  printf '%s\\n' \"$out\" >&2; exit $rc\n}","preventionTips":["Make version bumps mandatory in the release script so re-publishing an existing version cannot happen.","Serialize publish jobs (concurrency groups in Actions, a release lock) to prevent two runs racing on the same version.","Bump version, then publish, in one atomic pipeline step; keep the registry's raw message in CI logs for triage."],"tags":["publish","jsr","registry","server-error"],"backgroundTag":"registry-publish-failed","analyzedSha":"f7822238cab635a3a19f99f493f675fa81a7f9d8","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}