balena cli push error, Error:: Cannot read properties of null (reading '__id')

I’m attempting to push a new build but I’m getting an error from the balena cli. I’m able to deploy to some of my fleets, but two of them fail with the same error. It’s been a while since I pushed to these fleets and we switched from a single container build to a multi-container build. The error doesn’t provide much to go on. The command runs through the “Uploading source packages” phase, then fails.

I removed my real slug name but I can provide it offline if needed. I’m running on MacOS arm.

Any help would be appreciated,
-mike

balena -v
18.2.2
balena push my_slug
[Error]    Error:: Cannot read properties of null (reading '__id')
[Error]    Not deploying release.
Remote build failed
balena --debug push -c my_slug      
[debug] new argv=[/usr/local/lib/balena-cli/bin/node,/usr/local/lib/balena-cli/bin/run,push,-c,my_slug] length=5
[debug] Deprecation check: 0.01365 days since last npm registry query for next major version release date.
[debug] Will not query the registry again until at least 7 days have passed.
[Debug]   Using build source directory: . 
[Debug]   Pushing to cloud for fleet: my_slug
[debug] Event tracking error: Timeout awaiting 'response' for 0ms
| Packaging the project source...[Debug]   Tarring all non-ignored files...
[Debug]   docker-compose.yml file found at "/Users/mpilone/workspace/cd-project/destination/device-balena/target/balena"
| Packaging the project source...[Debug]   Tarring complete in 276 ms
[debug] Connecting to builder at https://builder.balena-cloud.com/v3/build?slug=my_slug&dockerfilePath=&emulated=false&nocache=true&headless=false&isdraft=false
\ Uploading source package to https://builder.balena-cloud.com[debug] received HTTP 200 OK
[debug] handling message: {"message":"\u001b[31m[Error]\u001b[39m    Error:: Cannot read properties of null (reading '__id')","isError":true}
[Error]    Error:: Cannot read properties of null (reading '__id')
[debug] handling message: {"message":"\u001b[31m[Error]\u001b[39m    Not deploying release.","isError":true}
[Error]    Not deploying release.
Remote build failed

RemoteBuildFailedError: Remote build failed
    at handleRemoteBuildStream (/usr/local/lib/balena-cli/build/utils/remote-build.js:83:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.startRemoteBuild (/usr/local/lib/balena-cli/build/utils/remote-build.js:64:13)
    at async PushCmd.pushToCloud (/usr/local/lib/balena-cli/build/commands/push/index.js:78:27)
    at async PushCmd.run (/usr/local/lib/balena-cli/build/commands/push/index.js:32:17)
    at async PushCmd._run (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/command.js:311:22)
    at async Config.runCommand (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/config/config.js:433:25)
    at async run (/usr/local/lib/balena-cli/node_modules/@oclif/core/lib/main.js:92:16)
    at async /usr/local/lib/balena-cli/build/app.js:80:13
    at async Promise.all (index 2)
    at async oclifRun (/usr/local/lib/balena-cli/build/app.js:98:5)
    at async Object.run (/usr/local/lib/balena-cli/build/app.js:111:9)
    at async run (/usr/local/lib/balena-cli/bin/run.js:18:2)

Hey @mpilone , would you be able to provide your compose file, or project source if it’s public?

Sometimes we’ve seen that error returned when there is an issue parsing the compose fields.

@klutchell Here’s the compose file. It’s a pretty barebones copy of the sample. I’m able to use this file to push to other fleets in my same org, but it continues to fail with the above error for one of my fleets.

For another fleet that it was failing on, I needed to get a build out so I created a new fleet, moved all the devices to the new fleet, and then I was able to push again. So it definitely seems to be fleet specific and creating a new fleet and moving devices can be used as a work around.

I also realized that these fleets were previously migrated from another organization but so were some of the other fleets that I can successfully deploy to so I don’t know if that’s related.

The ID of the fleet that is returning the error is 2114986.

Thanks,
-mike

docker-compose.yml

# Modified from https://docs.balena.io/learn/develop/dockerfile/#using-dockerfiles-with-balena
version: '2.4' # required for balena
networks: {}
volumes:
  resin-data: {}
services:
  cdedge:
    build: cdedge
    depends_on:
      - mediacodec
    privileged: true
    restart: always
    network_mode: host
    volumes:
      - 'resin-data:/data'
    labels:
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
      io.balena.features.supervisor-api: '1'
      io.balena.features.balena-api: '1'
  mediacodec:
    build: mediacodec
    privileged: true
    restart: always
    network_mode: host
    volumes:
      - 'resin-data:/data'
    labels:
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
      io.balena.features.supervisor-api: '1'
      io.balena.features.balena-api: '1'

balena.yml

type: sw.application
version: 2024.4.0

Sorry, I had to get the last fleet updated so I used my workaround of creating a new fleet and moving the devices. So I don’t have any fleet left showing this issue. There’s definitely a bug in there someplace, but for now all my fleets are working by recreating them and moving the devices.

Thanks,
-mike