balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
452 stars 137 forks source link

balena preload fails to build image #2568

Open jellybob opened 1 year ago

jellybob commented 1 year ago

It appears the preload Docker image is not available on Docker hub, at least if I'm reading the source of the balena-preload module correctly. Configuration in the module references the image balena/balena-preload, but the image returns a 404 when looking on Docker Hub.

Expected Behavior

Running balena preload should result in building an image pre-provisioned with our Docker images.

Actual Behavior

% DEBUG=true balena preload image.img --fleet $BALENA_FLEET_SLUG 
--------------------------------------------------------------------------------
[Warn] Node.js version "14.20.1" does not satisfy requirement ">=12.8.0 <13.0.0"
[Warn] This may cause unexpected behavior.
--------------------------------------------------------------------------------
[debug] original argv0="node" argv=[/opt/homebrew/Cellar/node@14/14.20.1/bin/node,/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/bin/balena,preload,image.img,--fleet,***REDACTED***] length=6
[debug] new argv=[/opt/homebrew/Cellar/node@14/14.20.1/bin/node,/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/bin/balena,preload,image.img,--fleet,***REDACTED***] length=6
[debug] Deprecation check: 1.17437 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
Building Docker preloader image. [                        ] 0%
| Cleaning up temporary files
(HTTP code 502) unexpected - Bad response from Docker engine

Error: (HTTP code 502) unexpected - Bad response from Docker engine

    at /opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:315:17
    at IncomingMessage.<anonymous> (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:342:9)
    at IncomingMessage.emit (events.js:412:35)
    at IncomingMessage.emit (domain.js:475:12)
    at endReadableNT (internal/streams/readable.js:1333:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
From previous event:
    at Preloader.prepare (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/balena-preload/build/preload.js:660:25)
    at PreloadCmd.prepareAndPreload (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/commands/preload.js:292:25)
    at /opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/commands/preload.js:129:30
    at new Promise (<anonymous>)
    at PreloadCmd.run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/commands/preload.js:127:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async PreloadCmd._run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/@oclif/config/lib/config.js:175:24)
    at async CustomMain.run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/@oclif/command/lib/main.js:27:9)
    at async CustomMain._run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/node_modules/@oclif/command/lib/command.js:43:20)
    at async /opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/app.js:76:13
    at async Promise.all (index 2)
    at async oclifRun (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/app.js:94:5)
    at async Object.run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/build/app.js:107:9)
    at async run (/opt/homebrew/Cellar/balena-cli/14.4.1/libexec/lib/node_modules/balena-cli/bin/balena:20:2)

For further help or support, visit:
https://www.balena.io/docs/reference/balena-cli/#support-faq-and-troubleshooting

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 preload image.img --fleet $FLEET

Specifications

Additional References

If applicable, please add additional links to GitHub projects, forums.balena.io threads, gist.github.com, Google Drive attachments, etc.

aethernet commented 1 year ago

Hello @jellybob,

The balena/balena-preload is not on docker hub and shouldn't be. It's actually built on your machine by the local engine.

The issue you're experiencing is a communication problem between balena-cli and your local docker engine.

Can you confirm you have the same issue with the latest CLI version (just released) ?

jellybob commented 1 year ago

Thanks, that makes sense. Still seeing the same behaviour on balena-cli 14.5.15.