Repository navigation
Closed
Labels
Description
Part of #4839 (split from it in task TALE-176).
Problem
#4839 addendum 4, defect 11, and addendum 5, defect 13.
| # | Defect | Code | What the operator sees |
|---|---|---|---|
| 11 | The Unix installer reports API errors as a missing release | On the curl path, scripts/install-cli.sh:159-167 captures the HTTP status (:166). Only an empty body, 403 or 429 falls back to the redirect (:179-184): :179 if [ -z "$releases_json" ] || [ "$http_code" = "403" ] || [ "$http_code" = "429" ]; then. Any other status with a non-empty body goes on to the asset scan (:189) and ends at :191 [ -z "$tag" ] && error "No release found with ${asset_name} binary". That includes a 401 from an unrelated or expired GITHUB_TOKEN in CI, which the script sends whenever it is set (:161-162), a 404 or a 5xx |
The operator is told there is no release for their platform, when the request was refused or failed. The fix, unsetting or fixing GITHUB_TOKEN or retrying later, is never suggested. Only runs without VERSION do the lookup (:216-219) |
| 13 | The build-from-source hint builds the wrong binary | For an architecture without a release asset, install-cli.sh:46 says "Build from source instead: clone https://github.com/${REPO} and run 'bun run build' in tools/cli.". tools/cli/package.json:8 (build) runs build:linux (--target=bun-linux-x64, :10), then build:mac (--target=bun-darwin-arm64, :13), both with --outfile=dist/tale, so the second overwrites the first. check:bundle (:17) only reads the bytes (tools/cli/scripts/check-bundle.ts:58), so build succeeds |
Someone on an unsupported architecture, for example 32-bit ARM, follows the hint and gets a macOS arm64 dist/tale that can't run there. The hint doesn't say where the binary lands or how to put it on PATH. An unsupported OS gets no hint at all (:38 error "Unsupported OS: $os") |
Notes, all at 29e9445:
- optimize agent tools #11: the wget path isn't affected. It captures no status (
http_code="",:176), and its body is empty on HTTP errors (:169-170), so it falls back to the redirect. - switch chat agent to stream output #13: the install guide mentions the message but gives no steps (
docs/en/self-hosted/install/cli-install.md:40, DE:44, FR:40).tools/cli/README.md:801-824has the steps. They start withbun install(:807), which the hint omits (buildrunsgenerateitself,package.json:8), and say each target writestools/cli/dist/tale, so build one per artifact (:820-821). They say nothing aboutPATH. - switch chat agent to stream output #13: a host build as bug(cli): digit-led project names can never deploy, --host rewrites .env even on --dry-run, and the Windows installer closes the session on error #4839 suggests (
bun build --compile --outfile=dist/tale src/index.ts, orbun src/index.ts) needsbun installandbun run generatefirst.src/generated/is gitignored (tools/cli/.gitignore:3) and imported statically (tools/cli/src/lib/deployment/build.ts:1). Without--define TALE_COMPILED=true,deploy preparerefuses with "Prepare deployments with the compiled Tale CLI executable." (build.ts:8-10). - switch chat agent to stream output #13: no compile script targets an architecture that reaches
:46. Whether Bun runs on 32-bit ARM at all can't be determined from the repo.
The Windows mirror. Both scripts say they mirror each other "function for function and message for message" (install-cli.sh:11-12, scripts/install-cli.ps1:14-15).
- optimize agent tools #11, partly shared.
Get-LatestTag(install-cli.ps1:200-232) sends the token whenever it is set (:203-205) and falls back to the redirect only for 403, 429 or no status::215if ($statusCode -eq 403 -or $statusCode -eq 429 -or -not $statusCode) {. But it doesn't claim a missing release. On a 401, 404 or 5xx,Invoke-RestMethodthrows and the script stops at:219Write-Err "Failed to fetch releases. $_", with the error text. It doesn't suggest fixingGITHUB_TOKENeither. - switch chat agent to stream output #13, not shared. It has no architecture branch and no build hint. It always downloads the single x64 binary (
:11-12,:22$Platform = "windows",:312).
Expected
- optimize agent tools #11: treat any non-200 status like 403/429 (fall back to the redirect), and name the status when that fails too. Apply the same to
install-cli.ps1:215. - switch chat agent to stream output #13: point to a host-target build that includes
bun install,bun run generateand--define TALE_COMPILED=true, and say where to put the result. Or document it in the install guide and link there.
Regression (tools/cli/scripts/install-cli.test.ts, Unix block :86-251):
- optimize agent tools #11: run
get_latest_tagwithDOWNLOADER=curl,ASSET_NAME=tale_linuxand acurlmock that answers the API with a JSON body and 401, and the redirect with a tag. It must print that tag; with the redirect failing too, the error must name the status. At 29e9445 it exits 1 with "No release found with tale_linux binary". No test reachesget_latest_tagtoday: the fixture pinsVERSION: '9.8.7'(:69), and thecurlmock (:23-39) has no API case. - switch chat agent to stream output #13: next to
selects ${asset} for ${os}/${arch}(:236-250), aunamestub for Linux/armv7l must get a hint that builds for the host. At 29e9445 it saysbun run build.
Severity and owner
- Severity: not stated in bug(cli): digit-led project names can never deploy, --host rewrites .env even on --dry-run, and the Windows installer closes the session on error #4839 (addenda 4 and 5 give none).
- Owner: CLI (installers).
- Evidence: static reading at
train29e9445, same atfeature-train12625af (the install guides differ there, but not at the cited lines); nothing was run. The cited paths are unchanged attrain1ae4a95 andfeature-train2334ceb. - 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).
Activity
fix(cli): fall back on any release API error and fix the build hint
docs: amend the v0.5.95 release notes
docs: amend the v0.5.95 release notes