balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
454 stars 139 forks source link

balena os download fails if given suffix in latest ESR releases #2467

Open pipex opened 2 years ago

pipex commented 2 years ago

Expected Behavior

Using balena os download should be consistent across ESR releases

Actual Behavior

The behavior of the balena os download command is inconsistent now with the introduction of unified OS releases

The command feedback is not helpful either as when downloading an older version the CLI will show a hint about adding adding the suffix

** Hint: some OS releases require specifying the full OS version including
** the '.prod' or '.dev' suffix, e.g. '--version 2021.10.2.prod'

while on the newer version there is no hint, only

BalenaRequestError: Request error: "Server error"

This doesn't seem to affect non-ESR releases

$ balena os download raspberrypi4-64 --version 2.88.4+rev0 -o pi.img
Getting device operating system for raspberrypi4-64
Downloading balenaOS version 2.88.4+rev0.prod [                        ] 1% eta 3m02s

$ balena os download raspberrypi4-64 --version 2.88.5+rev1.prod -o pi.img
Getting device operating system for raspberrypi4-64
Downloading balenaOS version 2.88.5+rev1 [=                       ] 5% eta 1m00s

x Each of the above command lines executes different code behind the scenes, so quoting the full command line is very helpful.

Running the CLI in debug mode (--debug flag or DEBUG=1 environment variable) may reveal additional information. The --logs option reveals additional information for the commands:

balena build . --logs
balena deploy myFleet --build --logs

Steps to Reproduce the Problem

This is the most important and helpful part of a bug report. If we cannot reproduce the problem, it is difficult to tell what the fix should be, or whether code changes have fixed it.

  1. balena os download raspberrypi4-64 --version 2021.10.2 (pre unification) fails
  2. balena os download raspberrypi4-64 --version 2021.10.2.prod (pre unification) succeeds
  3. balena os download raspberrypi4-64 --version 2022.1.1 (post unification) succeeds
  4. balena os download raspberrypi4-64 --version 2022.1.1.prod (post unification) fails

Specifications

jellyfish-bot commented 2 years ago

[pipex] This issue has attached support thread https://jel.ly.fish/332c2839-3e31-43cb-9a0f-73c11cac5c7a