Skip to content

\openclaw update\ dry-run passes but apply fails with ETARGET when version not yet on npm registry #87320

Closed

Description

@islandpreneur007

Summary

openclaw update --tag <version> --dry-run reports the update is safe and ready to apply when a fresh stable version exists on GitHub releases but has not yet propagated to the npm registry. The subsequent apply (without --dry-run) then fails with npm ETARGET. This is a confusing UX gap during the npm propagation window after a release.

Reproduction (production observation)

OpenClaw stable v2026.5.26 published to GitHub at 2026-05-27T11:27:24Z (commit 10ad3aa).

At ~12:14Z (~47 min later), npm registry had not yet propagated:

$ npm view openclaw@2026.5.26 version
npm error code E404
npm error 404 No match found for version 2026.5.26

npm view openclaw dist-tags showed latest=2026.5.22, beta=2026.5.26-beta.2 — no 2026.5.26 stable on npm yet.

openclaw update --channel stable --tag 2026.5.26 --dry-run --json during this window resolved cleanly:

  • targetVersion: "2026.5.26"
  • current: "2026.5.24-beta.2"
  • downgradeRisk: false
  • No warnings, output indicated the update path was clean

Running the apply (--channel stable --tag 2026.5.26 --yes --no-restart --json — same flags, no --dry-run) failed before mutation:

npm error code ETARGET
npm error notarget No matching version found for openclaw@2026.5.26.

Installed bytes remained at 2026.5.24-beta.2, no restart happened, safe-fail behavior was correct. But the dry-run had given a green light.

The version was eventually propagated to npm at 13:21Z (1h54m after GitHub release). The same --channel stable --tag 2026.5.26 apply then succeeded cleanly, landing 2026.5.26 (commit 10ad3aa), gateway restarted, validator clean, all post-update gates passed.

Expected behavior

Dry-run should fail at the same gate apply fails, or at minimum surface a warning when the target version is not yet present on the npm registry's latest dist-tag, so the user knows the apply will fail until propagation completes.

Suggested options

  1. Dry-run probes npm latest dist-tag for the target version — fail closed if not yet present (or warn explicitly that "registry has not yet propagated this version; apply will fail until npm publishes")
  2. Document the propagation-lag scenario in the Update docs so users running update --tag <new-stable> within ~2h of a GitHub release know to wait
  3. Have apply automatically fall back to the GitHub package-spec install path when npm ETARGET fires for the requested --tag, since --tag already supports GitHub specs per update.md docs and the source-of-truth GitHub release is unambiguous

Impact

  • Time wasted: ~15-25 min on the failed apply + diagnostic before realizing it was a propagation timing issue
  • User confusion: dry-run green light → apply red, contradictory signals from the same tool with the same flags
  • Workaround in docs (--tag github:openclaw/openclaw#v2026.5.26) is technically accepted but flags targetVersion=null in dry-run output, losing the standard version-resolution preview

Environment

  • OpenClaw 2026.5.24-beta.2 upgrading to 2026.5.26 (stable channel)
  • Linux Ubuntu VPS, global npm install via ~/.npm-global
  • No data loss, no rollback, update eventually succeeded after npm propagation

Filed as UX improvement for future stable releases.

Activity

  1. clawsweeper commented on May 27, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 1, 2026, 3:51 AM ET / 07:51 UTC.

    Summary
    Current main now rejects an uninspectable exact npm target before either dry-run output or installation, addressing the reported green-preview/ETARGET mismatch. This issue must remain open while its formally linked implementation PR is reconciled with that behavior; likely related person: Peter Steinberger (medium confidence).

    Reproducibility: yes. from current source: an exact semver tag becomes the target version, then the updater inspects that exact package target and exits before dry-run output when npm metadata cannot be read or does not match.

    Next step
    Do not queue a duplicate repair while #88683 remains the formally linked implementation candidate; reconcile that PR with current main first.

    Review details

    Best possible solution:

    Reconcile #88683 against the current exact-target preflight, retaining only any proven unique coverage or behavior; once that PR is merged or closed, close this issue as addressed on current main.

    Do we have a high-confidence way to reproduce the issue?

    Yes, from current source: an exact semver tag becomes the target version, then the updater inspects that exact package target and exits before dry-run output when npm metadata cannot be read or does not match.

    Is this the best way to solve the issue?

    Yes for the central issue: current main uses one exact package-target preflight before both preview and installation rather than adding a dry-run-only warning or fallback path. The linked PR still needs comparison to establish whether it has any unique remaining value.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The linked PR remains open and GitHub reports it as dirty, so closing this issue now would leave its declared implementation relationship unresolved despite current main covering the central behavior.

    Codex review notes: model internal, reasoning high; reviewed against 07b7d6446ca1.

    Label changes

    Label changes:

    • add maturity:stable: The primary owner is the CLI updater; the maturity shortlist classifies CLI Updates and Upgrades as M4 Stable.
    • remove clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: The reported contradiction affects a bounded package-update workflow and safely fails before mutation, so it is a normal-priority reliability defect.
    • impact:other: The concrete impact is misleading package-update planning and operator diagnostics rather than data, message, session, auth, or crash behavior.
    • maturity:stable: The primary owner is the CLI updater; the maturity shortlist classifies CLI Updates and Upgrades as M4 Stable.
    Evidence reviewed

    What I checked:

    • Current-main preflight: After resolving a target version, the updater queries the exact install target and exits before dry-run output when metadata lookup fails or returns a different version. (src/cli/update-cli/update-command.ts:393, 07b7d6446ca1)
    • Registry/package-manager contract: The target-status helper runs npm view <exact-spec> ... --json --global through the resolved package-manager command and returns a nonzero lookup as an error, matching the install surface rather than assuming npm availability. (src/infra/update-check-package-target.ts:145, 07b7d6446ca1)
    • Regression coverage: The focused updater test verifies that an exact target metadata failure exits with no schema preflight, service stop, or package-install command. (src/cli/update-cli.test.ts:2993, 07b7d6446ca1)
    • Linked implementation remains open: The provided GitHub context shows Reject unpublished npm targets consistently in update dry-run #88683 is open, explicitly closes this issue, and is currently reported dirty; issue cleanup must wait for that PR to be reconciled rather than opening another fix.
    • Current-main versus release: The checkout identifies current main as 07b7d64, later than released v2026.7.1 (2d2ddc4); this review does not assert a shipped fix version. (07b7d6446ca1)
    • Feature-history routing: Available path history identifies Peter Steinberger as the author of the recent updater refactors and update/schema work surrounding this owner boundary; sparse promisor history prevented attribution of the exact original preflight introduction. (src/cli/update-cli/update-command.ts:393, 0d91b07f5bea)

    Likely related people:

    • Peter Steinberger: Available history shows recent update-command refactors and related package/schema preflight work by Peter Steinberger; current source blame also routes this area to that history boundary. (role: recent area contributor; confidence: medium; commits: 0d91b07f5bea, a89f01abf4e6, a627a77eabfa; files: src/cli/update-cli/update-command.ts, src/infra/update-check-package-target.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. WarrenJones commented on May 27, 2026

    @WarrenJones
  3. added
    P2Normal backlog priority with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 15, 2026
  4. added
    maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jul 29, 2026
  5. steipete commented on Aug 1, 2026

    @steipete
    Contributor

    Thank you, @islandpreneur007, for the clear report. This failure mode is now fixed on current main by #110271, commit a89f01abf4e680df33fda6ab0862660d123d5068.

    The updater now validates the exact requested package/version through its existing owning package manager and configured registry before the shared dry-run/apply split. This also honors custom/private registries, and missing or uninspectable targets fail closed before any installation or service mutation.

    I verified the actual current production updater against an isolated local npm registry in all four cases:

    • Unpublished openclaw@2099.1.1: dry-run exits 1 without claiming success; apply exits 1 without reaching installation or mutating services.
    • Published openclaw@2026.5.26: dry-run prints a successful preview; apply passes preflight and reaches the installation boundary.

    The real exact package-owner command was npm view openclaw@<version> version engines.node openclaw.schemaVersions --json --global. Closing as completed because the fix is already merged. Thanks again for identifying the original misleading-preview bug.

  6. islandpreneur007 commented on Aug 1, 2026

    @islandpreneur007
    Author

    Thanks for the thorough writeup and for testing all four cases against a local registry — the fail-closed-before-mutation framing is exactly right.

    Confirming it shipped: the validation is present in 2026.7.2-beta.5 (ee929db). The bundled updater carries the schemaVersions/engines.node metadata query along with the fail-closed paths (npm view produced incomplete package metadata (missing: …), npm view produced invalid JSON), so consumers on the current beta line already have it.

    Happy for this to stay closed.

  7. locked as resolved and limited conversation to collaborators on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions