Skip to content

bug(cli): deploy --dry-run inspects the unpulled target image on a protocol-2 install #5170

Closed

Description

@tale-code-bot

Part of #4839 (split from it in task TALE-176).

Problem

#4839 addendum 2, defect 5. Paths are under tools/cli/src/ unless noted.

# Defect Code What the operator sees
5 tale deploy --dry-run inspects the target image it hasn't pulled. On an install already at automation writer protocol 2, the dry-run branch admits the target image before anything is pulled. The real deploy only does this after its pull succeeds lib/actions/deploy.ts:373 if (rotatableToUpdate.length > 0 && installedProtocol === 2) and :374 serviceConfig.platformImage = await admitTagAutomationImage(. That runs docker image inspect on the target version's platform image: lib/deployment/tag-automation-protocol.ts:137 const reference = imageRef(config, 'platform'); and :147 await protocolRead(['image', 'inspect', reference], dependencies),. With no platformImage set (deploy.ts:308-311), imageRef resolves to the target version's tag (lib/compose/types.ts:251). protocolRead reports any failed read with one sentence and no cause (lib/deployment/automation-protocol.ts:67 if (!result.success) throw new Error('read refused');, then :69-72). The real deploy pulls first (deploy.ts:423) and admits only after that (:441-447) The documented upgrade preview stops with "The installed automation writer protocol could not be read safely." and exit code 5, whenever the target image isn't on the host yet. That is normal before an upgrade. The guide runs tale update --version <target-version> (docs/en/self-hosted/operate/upgrades.md:27), which leaves running containers alone (:30), then tale deploy --dry-run (:35). The sentence blames the installed protocol, not the missing target image

Notes, all at 29e9445:

  • The "Would pull" lines (deploy.ts:401) come after the admission, so they are never printed when it throws.
  • Protocol-1 installs aren't affected. Their dry-run branch (deploy.ts:378-399) never calls admitTagAutomationImage; it only reports and warns. :379 says why: // The target's protocol is known only once its image is pulled.
  • No test drives deploy() with dryRun. lib/actions/rollback.test.ts, the only deploy() harness, always passes dryRun: false (for example :434). The dryRun: true cases in lib/actions/deploy-preflight.test.ts (:148, :180) test only runDeployPreflight. There is no tag-automation-protocol test file; admitTagAutomationImage is unit-tested in lib/deployment/automation-protocol.test.ts (:125).

Expected

  • In a dry run, skip the image admission when the target image isn't local, and say what the real deploy would check after pulling. Alternatively, read the target's labels from the registry manifest.
  • Name the image and the failed read in the error.

Regression: a deploy dry-run test on a protocol-2 install with the target image absent. Extend lib/actions/rollback.test.ts: it has the protocolFloor and targetProtocol switches (:54, :74) and the image inspect stub (:243-265). Run deploy() with dryRun: true, protocolFloor = 2 and the inspect failing. It must finish the preview and name the pending check. At 29e9445 it throws "The installed automation writer protocol could not be read safely." For the error text, extend the admitTagAutomationImage test in lib/deployment/automation-protocol.test.ts (:125) so that a failed inspect names the image.

Severity and owner

  • Severity: medium (addendum 2): the preview step the upgrade guide prescribes fails for every protocol-2 upgrade, with a misleading cause.
  • Owner: CLI (deploy, upgrades).
  • Evidence: static reading at train 29e9445, same at feature-train 12625af; nothing was run. The cited paths are unchanged at train 1ae4a95 and feature-train 2334ceb.
  • Related: fix(cli): let tale deploy cross the automation protocol cutover #4954 (commit 009f64d) added the protocol-1 dry-run branch at deploy.ts:378-399; the protocol-2 branch still inspects before any pull.

Activity

  1. added
    bug
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    f4be076
  3. added a commit that references this issue on Oct 31, 2026
    70724bf
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

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions