balena push to local exits with 0

Hi there,

I have been successfully building around 10 balena services, both locally and to the fleet (from CI). This is using Raspberry Pi 5 and debian bookworm build/run images.

Now I’m trying to debug something, so I’m doing a RUN git clone ... as part of the local build. However, the `balena push .local just exits with return value 0, but hasn’t actually finished the git clone and subsequent build.

Is this expected? Or how could I debug what is going wrong here? If anything fails I would expect the balena push ... process to exit with an error, right?

Thanks!

Edit: “sometimes” it just works, so if I try a few times, sometimes I get further.

Hello @julianoes first of all welcome to the balena community!

Could you please share more details of what are you trying so we can reproduce?

Do you think you can create a dummy Dockerfile template?

Thanks!

Thanks for your response. I can’t really share all of the proprietary the builds that I’m running I’m afraid. What lead to the “normal exit” seemed to be the git clone but it’s hard to say for sure because after a while it would start working again.

My question would be if there is any sort of event that would cause an exit with result 0? And if not, how I could debug it further, so that I can provide more information here.

If it does happen again, I will try to extract a public/open source part to reproduce it but I assume the problem will go away as soon as I reduce the setup.

Hey @julianoes , just to clarify the build is exiting early when doing a local mode push? So your command is something like balena push {hostname}.local, correct?

Does this step ever exit early when doing a cloud push, like balena push {fleet}?

Do you have multiple local mode devices for local push and they all exit at the same place, or is it just one device?

I don’t have any current theories as to why this might happen. There are a number of components at play because the balena CLI is communicating with the Supervisor on the device over the local network. I would expect most failures to return a non-zero exit code though. We might need to see supervisor logs from the device in question as well.

What might help us troubleshoot is a log of the output with --debug in the command. You can remove any proprietary information from the logs like git repo names of course.

Also, your suggestion of providing an open/public example to reproduce with if it happens again would be great!

1 Like

Correct. Local build.

Not that I’m aware of.

Good, that’s what I would expect :slightly_smiling_face:.

Yes, that’s what I’m using. No output whatsoever. It just exits and whatever was printed last will be there.

I have seen this on and off. It just happened again last night and this time the Pi would shut down (LED goes red). When I turn it back on, the fans would spin a bunch and it would happen again when trying to build again.

This morning, everything is working again, so I suspect, it might to be related to the RPi5’s CPU load, temperature, or maybe power supply. I need to look into that in more detail. That being said, I would still expect the balena command to fail with some sort of error (e.g. connection lost) when this happens.

I’ll try to reproduce this by stressing the system a bit. I have the proper fan installed, plenty of airflow, 5v 3A provided on the header, and only one ethernet adapter connected to USB, so it really ought to be fine.

1 Like

Thanks for the additional context! I’ll ask some of the CLI experts internally if they can see any cases where the exit code wouldn’t be captured correctly.

Does the behaviour change if you use the --nolive flag?

2 Likes