thanks for this report. Are you able to do a balena login and a balena whoami to check that the balena cli is connected to your openBalena instance?
Can you also please share the command that you use to invoke the preloading?
> balena preload raspberrypi3-2.113.4+rev1-v14.9.1.img --fleet maestro --add-certificate ../balena-ca.crt --splash-image /path/to/logo.jpg --dont-check-arch
Building Docker preloader image. [========================] 100%
| Checking that the image is a writable file
| Finding a free tcp port
| Checking if the image is an edison zip archive
| Creating preloader container
- Starting preloader container
\ Fetching application admin/maestro
\ Reading image information
? Select a release current
\ Fetching application 1
/ Estimating required additional space
/ Resizing partitions and waiting for dockerd to start
Pulling 4 images [========================] 100%
/ Cleaning up temporary files
and reproduced the second problem: the device boots, but only the supervisor runs and its logs include the following:
info] Reporting initial state, supervisor version and API info
[info] Attempting to load any preloaded applications
[error] LogBackend: server responded with status code: 401
[debug] Cannot migrate from v2 apps.json without Internet connectivity. Please use balenaCLI v13.5.1+ for offline preload support.
[event] Event: Loading preloaded apps failed {"error":{"message":"Cannot migrate from v2 apps.json without Internet connectivity. Please use balenaCLI v13.5.1+ for offline preload support.","stack":"Error: Cannot migrate from v2 apps.json without Internet connectivity. Please use balenaCLI v13.5.1+ for offline preload support.\n at /usr/src/app/dist/app.js:22:53255\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async /usr/src/app/dist/app.js:22:52804\n at async Promise.all (index 0)\n at async fromV2TargetApps (/usr/src/app/dist/app.js:22:52694)\n at async exports.fromV2AppsJson (/usr/src/app/dist/app.js:10:15063)\n at async exports.loadTargetFromFile (/usr/src/app/dist/app.js:10:16586)\n at async Object.exports.loadInitialState (/usr/src/app/dist/app.js:10:1290)\n at async Promise.all (index 0)\n at async Supervisor.init (/usr/src/app/dist/app.js:22:108604)"}}
[event] Event: Device bootstrap success {}
[info] Reporting initial configuration
[error] Error reporting initial configuration, will retry HTTPError: Response code 404 (Not Found)
[error] at Request.<anonymous> (/usr/src/app/dist/87.app.js:1:165558)
[error] at Object.onceWrapper (node:events:628:26)
[error] at Request.emit (node:events:525:35)
[error] at Request._onResponseBase (/usr/src/app/dist/87.app.js:1:153943)
[error] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[error] at async Request._onResponse (/usr/src/app/dist/87.app.js:1:154509)
[info] VPN connection is active.
However, the device is not actually offline: I configured it with ethernet, it registered with the server, and I am able to remotely tunnel in and ping google.com. So, preloading with an older CLI appears incompatible with newer open-balena, 3.8.2 in this case.
Focusing on the former issue, it appears that the new device record is being created just to learn the target state (as discussed in Issues Using Balena Preload), and would be deleted if the device state succeeded. A request to the v2 version of the endpoint succeeds:
While open-balena-api does have v3 get-state code, a full pull/rebuild of the latest open-balena gets me balena/open-balena-api:v0.192.4, whose src/ only includes routes/state-get-v2.ts.
UPDATE:
Found that the container was being launched by a second, older installation with open-balena 3.6.0. Upgrading that to 3.8.2 did bring support for the v3 state endpoint and allowed the preload to complete. The latest open-balena version might have been earlier when this thread was started.