Balena Raspberry Pi OS Dev is actually a Prod versions

I downloaded the current Raspberry Pi Balena OS: balena-cloud-raspberrypi4-64-2.85.2+rev3-dev-v12.10.10.img

I went to start developing on it, and it’s a Production version so I can’t SSH in:

Scanning for local balenaOS devices... Reporting scan results
- 
  host:      lb.local
  address:   192.168.0.67
  osVariant: production

Hi, did you try a local ssh to the device? It might be that the CLI is just not properly recognizing the variant due to some recent OS changes in the way this is reported.

I did. Balena ssh and got key errors.

HI again, and do you have an os.sshKeys entry configured in config.json? Before a development image would allow passwordless logins even if keys were configured, but now if keys are present it will use them instead.

Actually, could you please log in through the dashboard and paste the config.json file of the device?

root@test:/# cat ./mnt/boot/config.json
{"apiEndpoint":"https://api.balena-cloud.com","appUpdatePollInterval":900000,"applicationId":1854775,"deltaEndpoint":"https://delta.balena-cloud.com","developmentMode":false,"deviceApiKey":"0d31f472c828ffec45fb8b22e2cb22eb","deviceApiKeys":{"api.balena-cloud.com":"0d31f472c828ffec45fb8b22e2cb22eb"},"deviceType":"raspberrypi4-64","files":{"network/network.config":"[service_home_ethernet]\nType=ethernet\nNameservers=8.8.8.8,8.8.4.4"},"listenPort":48484,"mixpanelToken":"9ef939ea64cb6cd8bbc96af72345d70d","registryEndpoint":"registry2.balena-cloud.com","userId":210292,"vpnEndpoint":"vpn.balena-cloud.com","vpnPort":443,"uuid":"69e8f7f891b816090946245f133b12d3","hostname":"test","registered_at":1635260902035,"deviceId":5131196,"persistentLogging":true}

Hi again, thanks for the config.json. It does indeed seem to be a production image, which is now controlled by the developmentMode variable in config.json. Please try switching this from false to true.
Where did you download this image from? The API is supposed to configure this correctly when a request for an image is made from either the dashboard or the CLI, so something went wrong.

Also, did you make any pre-installation modification of the image using the CLI, like preloading?

Can I manually edit the config.json through the console? Or do you mean directly on the card?

The image was downloaded from: balenaOS - Run Docker containers on embedded IoT devices

Then a preload:

balena preload ~/Downloads/balena-images/balena.img -f lb-dev --commit latest

And a configure:

balena os configure ~/Downloads/balena-images/balena.img --config-app-update-poll-interval 360 --config-network=ethernet -f lb-dev

You can manually (and carefully) modify the config.json file as described in BalenaOS Masterclass - Balena Documentation.

We are looking into why the unmanaged development images do not correctly configure the config.json for development mode.

And thanks for reporting this!

1 Like

I just tried another one, Raspberry Pi 4 BalenaOS 2.85.2+rev3. This time even without preloading or config I couldn’t ssh into the device. I looked at the config file and it is as follows:

{
  "deviceType": "raspberrypi4-64",
  "localMode": true,
  "persistentLogging": false,
  "uuid": "4575997667a8b05b91c902b7ba37e0af"
}

I had to manually add the string to get it to work:

"developmentMode": true

This may or may not be related (my apologies if it is not), but I just used the BalenaCloud dashboard to update my development RPi 4 to the newest OS (balenaOS 2.87.16+rev1), and it somehow switched to a Production image. It was previously a Development image that I had in Local mode for a very long time, so I was very surprised when I couldn’t switch back to Local mode after the update.

I don’t think I have any data or logs that would help troubleshoot this, but there were some weird things that happened during the update: it stalled at 50%, then appeared to fail (status went away and showed the old version). I switched it out of Local mode at this point, and then a few minutes later the device rebooted and the status was “Update successful, device rebooting”. After the reboot, the device was displayed as a Production build and my request to enable Local mode failed.

Hello Tommy,

Have you tried manually changing the config.json as suggested above?

@jmakivic unfortunately as I was actively developing on that device, I had to quickly re-flash it back to a development image. If it happens again I will post here.

Hi, just an update on this matter.

We have now made the required changes to correctly configure unmanaged images with the desired development/production mode. So fetching unmanaged images from the CLI or the downloads page now works.
Also, a migration was added to balenaOS v2.88.13 so that a device that is configured as development mode keeps the configuration when updating to a newer unified OS release.

1 Like