config generate - error: Cannot read property '__id' of undefined

I am using Open Balena 3.1.0 and CLI 12.26.1.

I am trying to execute the following command

balena config generate --version 2.53.9+rev1 --network ethernet --appUpdatePollInterval 360 --app orange-pi-zero --output config.json --debug

But I get the following error:

[debug] new argv=[/usr/local/lib/balena-cli/bin/node,/usr/local/lib/balena-cli/bin/run,config:generate,–version,2.53.9+rev1,–network,ethernet,–appUpdatePollInterval,360,–app,orange-pi-zero,–output,config.json] length=13
Cannot read property ‘__id’ of undefined

TypeError: Cannot read property ‘__id’ of undefined
at generateDeviceConfig (/usr/local/lib/balena-cli/build/utils/config.js:35:64)
at ConfigGenerateCmd.run (/usr/local/lib/balena-cli/build/commands/config/generate.js:68:28)

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/

I can confirm I am logged in to the Open Balena server by doing balena whoami, The app exists, but at the moment doesn’t have anything deployed to it.

Thank you for reporting this issue @Maggie. After some investigation, it looks like a new feature / data model introduced in openBalena v3 – application UUIDs – caught the CLI off guard. The CLI is checking for the existence of an 'uuid' field in a database object to decide whether the object represents a Device or an Application. In the past, only Device objects had a uuid field, but since openBalena v3, Application objects also have a UUID field. I have opened the following issue, and I hope to have it fixed before the end of the day: https://github.com/balena-io/balena-cli/issues/2087

@Maggie, this issue was fixed in CLI version 12.26.2. Thanks again for reporting it! :+1: