Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reporting initial configuration when provisioning device #150

Open
saltedpotatos opened this issue Jun 22, 2022 · 5 comments
Open

Comments

@saltedpotatos
Copy link

Trying to create a second fleet and register a device, but it fails to fully register? With balena CLI, the status is N/a, which I have not encountered before. In the openbalena logs, this device is the only one behind a V3, rather than V2 for everyhting else, but I am not sure if that is part of provisioning or not.

At this point, I've downloaded, flashed, configured, removed devices, etc, but have yet to get a working provision for the new fleet.

Device: Raspberry Pi 4
OpenBalena: 3.6.0
BalenaOS: raspberrypi4-64-2.98.33-v13.1.11

Device Logs:

journalctl -u balena-supervisor
[...]
c70c1a8 balena-supervisor[3497]: [success] Initialised splash image backend
c70c1a8 balena-supervisor[3497]: [info]    Reporting initial state, supervisor version and API info
c70c1a8 balena-supervisor[3497]: [info]    Attempting to load any preloaded applications
c70c1a8 balena-supervisor[3497]: [info]    Starting API server
c70c1a8 balena-supervisor[3497]: [info]    Supervisor API successfully started on port 48484
c70c1a8 balena-supervisor[3497]: [debug]   Ensuring device is provisioned
c70c1a8 balena-supervisor[3497]: [error]   LogBackend: server responded with status code: 401
c70c1a8 balena-supervisor[3497]: [event]   Event: Device bootstrap {}
c70c1a8 balena-supervisor[3497]: [info]    New device detected. Provisioning...
c70c1a8 balena-supervisor[3497]: [event]   Event: Device bootstrap success {}
c70c1a8 balena-supervisor[3497]: [info]    Reporting initial configuration
c70c1a8 balena-supervisor[3497]: [error]   Error from the API: 404
c70c1a8 balena-supervisor[3497]: [error]   Error reporting initial configuration, will retry Error: Error from the API: 404
c70c1a8 balena-supervisor[3497]: [error]         at /usr/src/app/dist/app.js:22:297965
c70c1a8 balena-supervisor[3497]: [error]       at processTicksAndRejections (internal/process/task_queues.js:97:5)
c70c1a8 balena-supervisor[3497]: [info]    VPN connection is active.
c70c1a8 balena-supervisor[3497]: [info]    VPN connection is active.
c70c1a8 balena-supervisor[3497]: [info]    VPN connection is active.
c70c1a8 balena-supervisor[3497]: [info]    VPN connection is active.
c70c1a8 balena-supervisor[3497]: [info]    Internet Connectivity: OK

OpenBalena API Logs

docker exec -it openbalena_api_1 journalctl -fab
[...]
GET /device/v3/c70c1a8a9de5e80ac51449173ec641db/state 404 1.368ms

Balena devices:

38 c70c1a8 fancy-pie          raspberrypi4-64    admin/oxiderouter N/a    true      13.1.11            balenaOS 2.98.33
@bartversluijs
Copy link
Contributor

Hi,

This errors comes from the fact that the latest OS's use the V3 endpoint to report their status. The latest release of open-balena, however, doesn't support this endpoint. The latest release of the open-balena-api does.

I've created a PR #149, which fixes this issue. I'm awaiting approval. This will add support for the V3 endpoint and thus support the latest and greatest BalenaOS.

For now, I'd suggest using an older BalenaOS version, which can be downloaded using the 'balena os download' command, like v2.88.

@saltedpotatos
Copy link
Author

Thanks, @bartversluijs !

Is there somewhere I could have found that information that I missed? I know I've seen similar problems across github / the forums with open-balena being out of date compared to a new CLI version or OS version, but I'm not sure how you would know that from the docs, unless I missed it.

Additionally, it looks like balena os download is not supported by open-balena,

Note: Currently this command only works with balenaCloud, not openBalena.
  If using openBalena, please download the OS from: https://www.balena.io/os/

Nor do I see any image archives for older versions

@bartversluijs
Copy link
Contributor

There's no way at the moment you could've known that the latest BalenaOS doesn't work with openbalena. The only way to know is try it. We're using openbalena for quite some time now and our solution is trying BalenaOS releases, and when it doesn't work, stick with the latest BalenaOS version that worked.

Or, when I have the time, I'll test the latest openbalena dependencies (API, VPN, DB, Registry, S3) and create a PR, like #149.

Regarding the 'balena os download' command, it is not support for openbalena indeed. You've to point the CLI to balenaCloud instead of your openbalena instance. The OS downloads are public. Afaik, there isn't a website to download older BalenaOS releases at the moment.

@richbayliss
Copy link
Contributor

@saltedpotatos as @bartversluijs points out - you couldn't have known since Balena are only advertising the minimum OS version required.

As feedback; it would be nice if the 404 wasn't as cryptic in the Supervisor logs OR if it could revert to a v2 state endpoint-only mode of operation 👍🏻

@bartversluijs
Copy link
Contributor

Version 3.7.0 is released, so this will fix your problem when using BalenaOS 2.98.33!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants