Repository navigation
Closed
Labels
Description
Problem
Three operator-facing defects in the Tale CLI's install and deploy path. Each contradicts docs/en/self-hosted/install/cli-install.md and leaves the operator with a refusal or a changed system they didn't ask for. main acd5dbd10:
| # | Defect | Code | What the operator sees |
|---|---|---|---|
| 1 | A project whose folder name starts with a digit can't be deployed. tale init derives the ID from the folder name and allows a leading digit (tools/cli/src/lib/project/generate-project-id.ts:7, :16-36; lib/actions/init.ts:254). Every tale deploy checks the same ID against /^[a-z][a-z0-9-]{0,62}$/ (lib/deployment/tag-automation-protocol.ts:26-29, called at lib/actions/deploy.ts:226-229) |
For ~/2024-site, tale dev works, but every deploy, the first included, stops with "✗ Invalid deployment project." The message names neither the rule nor the fix (rename the project ID or the folder) |
|
| 2 | tale deploy --host <domain> rewrites .env permanently, --dry-run included. lib/actions/run-deploy.ts:95 calls ensureProductionDomain(projectDir, { host: options.host }) before anything checks dryRun. With a flag host it writes HOST, SITE_URL and TLS_MODE=letsencrypt (lib/config/ensure-env.ts:295-313; :130-136) |
The docs say --host overrides HOST "for one run" (cli-install.md:671) and --dry-run previews "without touching anything" (:133). Instead a preview switches a TLS_MODE=external site to Let's Encrypt in .env, and the change stays |
|
| 3 | The documented Windows install closes the operator's PowerShell on any error. The docs install with irm …/install-cli.ps1 | iex (cli-install.md:35). The script's Write-Err ends with exit 1 (scripts/install-cli.ps1:29), and under iex that exit ends the caller's session. The script also sets $ErrorActionPreference = "Stop" in the caller's scope (:17) |
On any installer error the console window closes, taking the red "Error: …" line and its recovery hints with it. After a successful install the user's session keeps ErrorActionPreference=Stop. The installer tests run the script with -File in a fresh process (tools/cli/scripts/install-cli.test.ts:271-280), so the iex path is never exercised |
Expected
- Generate IDs that satisfy the deploy rule (prefix a letter when the folder starts with a digit), or accept the init pattern at deploy. Either way, the refusal should name the rule and the fix.
- Apply
--hostto the run only. Under--dry-run, write nothing, and report what.envwould change. - In the PowerShell installer,
throw(orreturnfrom a main function) instead ofexit, and don't change the caller'sErrorActionPreference. Add an installer test that runs it throughiexin a child session.
-
Regression:
- a deploy-path unit test with project ID
2024-site-abc123; - a
run-deploytest asserting.envis unchanged after--dry-run --host; - a PowerShell test that the calling session survives an installer error.
On
acd5dbd10all three fail. - a deploy-path unit test with project ID
Severity and owner
- Severity: medium. (1) blocks deployment outright for affected projects, (2) silently changes production TLS configuration, and (3) hides the installer's own diagnostics.
- Owner: CLI (deploy and installers).
- Related: release: re-running the v0.5.78–v0.5.80 releases moved
:latestimages and GitHub Latest back to v0.5.79 #4740 (installer release fallback). - Found by: Review A (TALE-358), 2026-10-12 08:15 Zurich occurrence, oldest-due
cli.install-deployUX-CLARITY slice. Static reading atacd5dbd10, verified at the cited lines; nothing was run. The same sweep found 13 lower-priority message-clarity leads, which are listed in Review A's receipt and not filed here.
Activity
yannickmonney commentedon Oct 12, 2026
Addendum (Review A, TALE-358, 2026-10-12 16:15 Zurich occurrence): a fourth defect in the same path, at
main4cde0834a. Paths are undertools/cli/src/.tale deploy --override-allasks for consent only after the deploy, including the restart it forces. For the reseed's sake,--override-allimplies--stopand force-recreates the services (lib/actions/run-deploy.ts:84-90,:138-140), sodbandproxyrestart too. First come the snapshot (lib/actions/deploy.ts:469), the rollout (:818) and the file sync (:823). Only then doesreseedAllOrgsFromBuiltin(:835-840) check consent (lib/actions/reseed-all-orgs.ts:113-125)--yes, the job fails with "--override-all requires --yes (-y) when stdin is not a TTY (e.g. CI)." The new version and the db/proxy restart are already live, so the pipeline reports a failed deploy that actually happened. Interactively, an operator who reads the factory-reset warning and declines gets "Aborted by user." and then "Deployment complete! Version … is now live", after taking the downtime that only the reseed neededExpected: resolve the
--override-allconsent before anything changes, next to the existing--override/--override-allusage check (run-deploy.ts:54-62) and beforeensureDocker. Declining, or a missing--yeswithout a TTY, must leave the running deployment untouched.--dry-runkeeps its current early return.Regression: a
run-deploytest withoverrideAll, no TTY and no--yesthrows before any docker call, and an interactive decline makes no deploy call. On4cde0834aboth reachdeploy().Severity and owner: medium, CLI. This is static reading, verified at the cited lines. I didn't run it.
yannickmonney commentedon Oct 12, 2026
Addendum 2 (Review A, TALE-358, 2026-10-12 16:15 Zurich occurrence): the documented upgrade preview fails, at
main4cde0834a. Paths are undertools/cli/src/.tale deploy --dry-runinspects the target image it hasn't pulled. On an install already at automation writer protocol 2, the dry-run branch callsadmitTagAutomationImagebefore anything is pulled (lib/actions/deploy.ts:358-363, while the images are only logged as "Would pull"). That runsdocker image inspecton the target version's platform image (lib/deployment/tag-automation-protocol.ts:118-134). The real deploy only does this after its pull succeeds (deploy.ts:394-408)docs/en/self-hosted/operate/upgrades.md:22-37:tale update --version <target>, thentale deploy --dry-run) stops with "The installed automation writer protocol could not be read safely." and exit code 5, whenever the target images aren't on the host yet, which is normal before an upgrade.protocolReadreports any failed docker read with that one sentence (lib/deployment/automation-protocol.ts:49-67), so it blames the installed protocol, not the missing target imageExpected:
Regression: a
deploydry-run test on a protocol-2 install with the target image absent. It finishes the preview and names the pending check. On4cde0834ait throws the sentence above. No test drivesdeploy()withdryRunand protocol 2 today:deploy-preflight.test.tscovers dry-run without the protocol, and there is notag-automation-protocoltest file.Severity and owner: medium, CLI. The preview step the upgrade guide prescribes fails for every protocol-2 upgrade, with a misleading cause. This is static reading, verified at the cited lines. I didn't run it.
yannickmonney commentedon Oct 12, 2026
Addendum 3 (Review A, TALE-358, 2026-10-13 00:15 Zurich occurrence): a prompt in a non-interactive shell prints only "Aborted.".
maindf7cd70f7, paths undertools/cli/src/.utils/prompt.ts:65-72throwsNonInteractiveErrorwith a useful message: "Cannot prompt (…) — this is not an interactive terminal. Re-run with --yes to accept defaults, or run it in an interactive shell." Bututils/run-command.ts:19counts that error as a user abort, andhandleError(:28-33) prints onlyerrorLine('Aborted.')and exits 4--yesis never showntale deploy provisionwithout--yescan never be confirmed. It refuses a terminal on stdin (commands/deploy/provision.ts:223-226, "Provide private native instance JSON on stdin."), then asksconfirm(…)unless--yesis set (:278-287).confirmneeds stdin to be a terminal (utils/prompt.ts:61-63)--yesis required. Bundle deployment probably passes--yes, so this mainly hits operators running the documented backend-local phase (cli-install.md:313) by handExpected: print the
NonInteractiveErrormessage, keeping exit code 4 if that's the contract, and reserve "Aborted." for Ctrl-C. Fordeploy provision, require--yes, or say so in the stdin message and the docs.Regression: a
run-commandtest where aNonInteractiveErroris thrown in non-JSON mode. The output contains "--yes". Ondf7cd70f7it is just "Aborted.".Severity and owner: medium-low, CLI. This is static reading, verified at the cited lines. I didn't run it.
yannickmonney commentedon Oct 12, 2026
Addendum 4 (Review A, TALE-358, 2026-10-13 00:15 Zurich occurrence): four install and deployment errors that hide their cause.
maindf7cd70f7, paths undertools/cli/src/.operationalFailureturns everyz.ZodErrorinto the caller's fixed sentence (commands/operational-failure.ts:36). The managed deployment commands pass "Deployment input does not match its schema." (commands/deploy/managed.ts:30-35)lib/deployment/identity.ts:976-981wrapsoptions.provision(context)in a barecatch { throw externalDepError('Native configuration provisioning failed.'); }ConfigError/CliErrormessages thatoperationalFailuredeliberately keeps and aNonInteractiveError. The specific, safe reason is thrown awaylib/deployment/acceptance-health.ts:158-161turns any failure, whether DNS or TLS, a non-200 answer, an unexpected body or an older version still serving (throw new Error('health version'),:150-151), into "The declared origin did not prove the expected healthy serving version."scripts/install-cli.sh:159-166captures the HTTP status, but only an empty body, 403 or 429 falls back to the redirect (:178-183). A 401 (for example, an unrelated or expiredGITHUB_TOKENin a CI environment, which the script sends automatically), 404 or 5xx with a JSON body goes on to the asset scan and ends with "No release found with ${asset_name} binary" (:190)GITHUB_TOKENor retrying later, is never suggestedExpected:
operationalFailure(or re-throwCliError,ConfigErrorandNonInteractiveError) and keep the fixed sentence for unexpected errors only.Regression: a deploy test with a bundle spec missing a required field shows that field's path. On
df7cd70f7it shows only the fixed sentence.This is static reading, verified at the cited lines. I didn't run it.
yannickmonney commentedon Oct 13, 2026
Addendum 5 (Review A, TALE-358, 2026-10-13 04:15 Zurich occurrence): four more dead ends.
main715dc15ad, paths undertools/cli/src/.deployment.jsonisn't named.lib/deployment/bundle.ts:120and:123calllstaton the directory and the manifest before any explicit check. For a path that doesn't exist,lstatthrows Node'sENOENT, which isn't aCliError,ConfigErrororZodError.operationalFailuretherefore replaces it with the caller's fixed summary (commands/operational-failure.ts:37)tale deploy --bundle ./bundelreports "Deployment failed. Review the source pins, paths, permissions and retained recovery receipts." The explicit checks right after ("Deployment bundle must be a regular directory.", "Deployment manifest is not a bounded regular file.") would have said what's wrong, but they never runscripts/install-cli.sh:46says "Build from source instead: clone … and run 'bun run build' in tools/cli."tools/cli/package.json'sbuildrunsbuild:linux(--target=bun-linux-x64) and thenbuild:mac(--target=bun-darwin-arm64), both with--outfile=dist/tale, so the second overwrites the firstdist/talethat can't run on their machine. Nothing says where the binary lands or how to put it onPATH, and the install guide doesn't mention building from source--yesdoesn't reach the Docker install gate. The root-y, --yespromises to "assume 'yes' for all prompts (non-interactive)" (index.ts:47), andresolveConsenthonours it elsewhere (utils/output-mode.ts:97-99).ensureDockerreads only its ownopts.assumeYes(lib/docker/ensure-docker.ts:594-604), whichrun-deploy.ts:68fills from thedeploysubcommand's--yesalonetale --yes deployin CI is refused with "Docker is not installed and this is a non-interactive shell. Re-run with --yes …". The operator already passed--yes, just before the subcommandtale deploy --bundle <dir> --configuration-onlyobserves the ready runtime throughobserveReadyRuntime(lib/deployment/apply.ts:721-723,:751), and the configuration activation does the same (:872). Both runobserveReadyState(lib/deployment/runtime-apply.ts:1284), whose custody refusals are all worded for client credential export: "Credential export requires the exact ready runtime receipt.", "Managed runtime file drift prevents credential export.", "Managed runtime origin differs from the credential export target." (:1303-1357)Expected:
ENOENTandENOTDIRaround those twolstatcalls and answer with the existing precondition sentences, naming the path.ensureDockeruseresolveConsent(opts.assumeYes), like the reseed prompt does.bun build --compile --outfile=dist/tale src/index.tsintools/cli, or runningbun src/index.ts, and say where to put the result. Or document it in the install guide and link there.This is static reading, verified at the cited lines. I didn't run it.
tale-code-bot commentedon Oct 30, 2026
Split (task TALE-176). TALE-176 fixes defect 2:
tale deploy --hostrewriting.env,--dry-runincluded. Its commit carriesCloses #4839and closes this issue when it reachesmain. The other defects are now issues of their own, each with the evidence and the regression test it needs:tale initare refused by every deploy and rollbackirm | iexcloses the caller's PowerShell on error--override-allasks consent after the rollout; the Docker gate ignores the global--yesdeploy --dry-runinspects the unpulled target image on a protocol-2 installdeploy provisionneeds--yesDefects 1 and 3 are this issue's table; 4 to 15 are addenda 1 to 5. Every part cites code at
train29e9445 (the cited paths are unchanged attrain1ae4a95 andfeature-train2334ceb).The fix for defect 2 is on branch
fix/deploy-host-one-run, waiting for review in TALE-176.--hostserves its host for that run only and never writes.env.--dry-runwrites nothing to.envortale.jsonand logs what a real run would write.fix(cli): serve deploy --host for one run, write nothing on --dry-run