balena-cli: balena os download hangs on 83%, errors out with unexpected end of file at Zlib.zlibOnError
I am running balenaCLI v12.37.0 (Installed globally through NPM) inside a container with fincm3-alpine-node as the base image. On our testing runs, we see the balena os download command flaking out about 8 out of 10 times.
Expected Behavior
The image requested should download without errors.
Actual Behavior
On running the command inside the container, balena os download raspberrypi3 -o /tmp/raspberrypi3.img --version v2.58.3+rev1.prod the download proceeds normally and gets stuck strangely at 83% (Every time). The ETA time does keep increasing after eventually failing with the error mentioned below.
bash-5.0# balena os download raspberrypi3 -o /tmp/raspberrypi3.img --version v2.58.3+rev1.prod
Getting device operating system for raspberrypi3
Downloading Device OS 2.58.3+rev1.prod [========================] 100% eta 5s
Error: unexpected end of file
at Zlib.zlibOnError [as onerror] (zlib.js:180:17)
We did some troubleshooting of our own. Tried different connections, cli versions (previously v12.32), and base images (previously it was debian) balena os download works perfectly on x86 (my system, popOS 18.04) but not sure why it is having troubles inside a container. Anything you suggest, I be most happy to try out. We have tried using --debug flag as well but no change in output.
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.
- Dockerfile.template and docker-compose.yml here for the container
- Deployed on a provisioned balenaFin v1.1.1 with balena push <app_name>
- Run the command on the container,
balena os download raspberrypi3 -o /tmp/raspberrypi3.img --version v2.58.3+rev1.prod
Specifications
- balena CLI version: balena-cli version “12.37.0”, Node.js version “12.19.1”
- **Cloud backend: balenaCloud
- Operating system version: Alpine: latest
- 32/64 bit OS and processor: armv7hf (balenaFin)
- Install method: npm
- If npm install, Node.js and npm version: Node v12.19.1 and NPM v6.14.8
Please do comment if other folks face this problem or are able to reproduce this issue for the team to start working on diagnosing this issue. Thanks!
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (14 by maintainers)
Commits related to this issue
- Update balena sdk Fixes [EOF zlib issue](https://github.com/balena-io/balena-cli/issues/2152 ) per [@klutchell 's balena-request fix](https://github.com/balena-io-modules/balena-request/pull/156). ... — committed to balena-io-modules/balena-image-manager by zwhitchcox 3 years ago
- Update balena sdk Fixes [EOF zlib issue](https://github.com/balena-io/balena-cli/issues/2152 ) per [@klutchell 's balena-request fix](https://github.com/balena-io-modules/balena-request/pull/156). S... — committed to balena-io-modules/balena-image-manager by zwhitchcox 3 years ago
I can reproduce this with
balena-image-managerbut not withbalena-sdkdirectly, so at least I’ve narrowed it down some more.I’m running into this with a fresh install of CLI
v12.44.23on Raspberry Pi OS (no container). Will see if I can find a root cause.