I installed the BalenaCLI on my Mac and i’m able to login to the open balena instance installed on the VPS, create an app and “os configure” the Rpi4 dev img downloaded in ethernet mode enabled
I flashed the img and introduce it into the RAK7244.
I can ping the device from my LAN, SSH into it and ping 8.8.8.8 and all the DNS records from my domain
Can I force the registration from the device in SSH to find where the issue comes from ?
Could you confirm that the device is connecting to your server? You can do this by SSHing into the device and looking at the file /mnt/boot/config.json. The apiEndpoint configuration key should show the correct address to your server
A quick way to do this is with the command cat /mnt/boot/config.json | jq '.apiEndpoint'.
If that shows the correct address, could you take a look at the supervisor logs and share some of the output with us?
Here is the supervisor log output get by the command journalctl --follow --unit=resin-supervisor:
root@3ae97dc:~# journalctl --follow --unit=resin-supervisor -- Logs begin at Mon 2020-05-11 13:18:42 UTC. -- Jul 15 22:52:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:52:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:52:42 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:52:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:53:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:53:12 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:53:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:53:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:53:42 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:53:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:54:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:54:12 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:54:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:54:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:54:42 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:54:42 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}} Jul 15 22:55:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap {} Jul 15 22:55:12 3ae97dc resin-supervisor[2047]: [info] New device detected. Provisioning... Jul 15 22:55:12 3ae97dc resin-supervisor[2047]: [event] Event: Device bootstrap failed, retrying {"delay":30000,"error":{"message":"User ID must be a valid integer","stack":"Error: User ID must be a valid integer\n at /usr/src/app/dist/[app.js:2:2630094](http://app.js:2:2630094/)\n at [PassThroughHandlerContext.finallyHandler](http://passthroughhandlercontext.finallyhandler/) (/usr/src/app/dist/[app.js:2:1748917)](http://app.js:2:1748917)/)\n at [PassThroughHandlerContext.tryCatcher](http://passthroughhandlercontext.trycatcher/) (/usr/src/app/dist/[app.js:2:220284)](http://app.js:2:220284)/)\n at [Promise._settlePromiseFromHandler](http://promise._settlepromisefromhandler/) (/usr/src/app/dist/[app.js:2:1708447)](http://app.js:2:1708447)/)\n at [Promise._settlePromise](http://promise._settlepromise/) (/usr/src/app/dist/[app.js:2:1709730)](http://app.js:2:1709730)/)\n at [Promise._settlePromise0](http://promise._settlepromise0/) (/usr/src/app/dist/[app.js:2:1710770)](http://app.js:2:1710770)/)\n at [Promise._settlePromises](http://promise._settlepromises/) (/usr/src/app/dist/[app.js:2:1712478)](http://app.js:2:1712478)/)\n at _drainQueueStep (/usr/src/app/dist/[app.js:2:1715412)](http://app.js:2:1715412)/)\n at _drainQueue (/usr/src/app/dist/[app.js:2:1715308)](http://app.js:2:1715308)/)\n at [Async._drainQueues](http://async._drainqueues/) (/usr/src/app/dist/[app.js:2:1716625)](http://app.js:2:1716625)/)\n at [Immediate.Async.drainQueues](http://immediate.async.drainqueues/) [as _onImmediate] (/usr/src/app/dist/[app.js:2:1715217)](http://app.js:2:1715217)/)\n at processImmediate (internal/[timers.js:456:21)](http://timers.js:456:21)/)"}}
I’m currently checking these two topics because I found the “User ID must be a valid integer” sentence into :
Hi,
This looks like an incompatibility between the supervisor and open-balena versions.
There was a change in open-balena-api that removed the userId field from the config, but it was re-added later (in v0.72.4) to keep the compatibility.
And the supervisor does not require this field since v11.3.8.
balenaOS has this supervisor version since `v2.50.0.
Could you please confirm what open-balena-api and balenaOS versions you use (the content of /etc/os-release on the device has the necessary info about the balenaOS).
Hi there,
thank you for sharing the command output, it would be also useful for us if you could share with us the open-balena-api version you are running. You should be able to do this in two ways:
Take a look at what docker image is used on your deployment.
Open the cloned repo code and copy - paste the contents into ./VERSION and. /compose/versions files
Just to clarify, these are two files that should remain as they are.
Having said that if these files have not been altered, it should be enough to re-flash the device with a balenaOS version lower or equal than 2.49.0, since unfortunately currently openBalena is not compatible with versions of balenaOS higher than 2.49.0.
Pretty much everything works well with balenaos v2.48.0 (I didn’t find any link to download the v2.49.0).
The only thing which is not working is the command balena device UUID.
It returns this error (with --debug) :
[debug] new argv=[/usr/local/lib/balena-cli/bin/node,/usr/local/lib/balena-cli/bin/run,device,6750cbf] length=4
BalenaRequestError: Request error: Internal Server Error
BalenaRequestError: Request error: Internal Server Error
at /usr/local/lib/balena-cli/node_modules/balena-request/build/request.js:189:17
From previous event:
at /usr/local/lib/balena-cli/node_modules/balena-request/build/request.js:181:62
From previous event:
at Object.exports.send (/usr/local/lib/balena-cli/node_modules/balena-request/build/request.js:180:8)
at /usr/local/lib/balena-cli/node_modules/balena-pine/es2018/index.js:20:22
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
at process.topLevelDomainCallback (domain.js:126:23)
From previous event:
at BalenaPine._request (/usr/local/lib/balena-cli/node_modules/balena-pine/es2018/index.js:12:34)
at BalenaPine.request (/usr/local/lib/balena-cli/node_modules/pinejs-client-core/es2018/index.js:952:29)
at BalenaPine.get (/usr/local/lib/balena-cli/node_modules/pinejs-client-core/es2018/index.js:701:21)
at /usr/local/lib/balena-cli/node_modules/balena-sdk/build/models/device.js:355:26
From previous event:
at Object.get (/usr/local/lib/balena-cli/node_modules/balena-sdk/build/models/device.js:336:31)
at Object.get (/usr/local/lib/balena-cli/node_modules/balena-sdk/build/util/callbacks.js:19:27)
at DeviceCmd.run (/usr/local/lib/balena-cli/build/actions-oclif/device/index.js:13:55)
at DeviceCmd._run (/usr/local/lib/balena-cli/node_modules/@oclif/command/lib/command.js:44:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
Additional information may be available with the `--debug` flag.
For help, visit our support forums: https://forums.balena.io
For bug reports or feature requests, see: https://github.com/balena-io/balena-cli/issues/
Is it normal ?
Another question I if may ask, I’m trying to understand if I do everything correctly.
I have now an application which works when deployed to the device.
Deployed with the command balena deploy myapp --logs --source . --build
So now I want to deploy devices which start automaticaly the application after the device startup.
So I flashed the SD card with “balena os configure balena.img --app myapp” and the device is connected to the openbalena instance but it doesn’t get the application. So from the myapp folder I did again the command balena deploy myapp and the device get and ran the application.
Do I need to deploy the application manualy from openbalena ? Or I’m missing something ?
Thanks for your help!
I flashed again and now the application is well download and run at startup, cool ! I was too hurry
Regarding the devices, here is the return after the command balena devices :
ID UUID DEVICE NAME DEVICE TYPE APPLICATION NAME STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
6 6750cbf floral-meadow raspberrypi4-64 helium-gtw-diy Idle false 10.8.0 balenaOS 2.48.0+rev1 https://dashboard.openbalena.asappli.com/devices/6750cbf57f8f469d88c29fe05727f912/summary
7 4d990ed floral-wind raspberrypi4-64 helium-gtw-diy Idle true 10.8.0 balenaOS 2.48.0+rev1 https://dashboard.openbalena.asappli.com/devices/4d990ede1d6546f07c76b703ba14abcb/summary
UUID displayed is the short UUID or the full ?
When I run balena device 4d990ed :
BalenaRequestError: Request error: Internal Server Error
Additional information may be available with the `--debug` flag.
For help, visit our support forums: https://forums.balena.io
For bug reports or feature requests, see: https://github.com/balena-io/balena-cli/issues/
Here is the log from the openbalena_api_1 container get by the command docker exec -it openbalena_api_1 journalctl -u open-balena-api -fn100 when I did the command balena device 4d990ed :