Help! Containerized Applications Losing Network Access in Yocto Project (Balena Engine)

We’re facing a strange issue with our containerized applications running on Balena Engine inside a Yocto Project system. We have various applications within these containers, and they all initially connect to a local IP address via WiFi. However, the connection drops after some time.

Here’s the twist: applications installed outside the containers (directly on the Yocto Project system) can be access from an IP address without any problems. It seems something specifically disrupts the network connection within the containers.

We’ve narrowed down the issue to be network-related, but we’re unsure what’s causing the inconsistency. We’ve checked the applications and containers themselves, and they seem to be functioning properly.

We’re hoping the community can help us troubleshoot this. Any insights into what might be causing this behavior or commands we can use to diagnose the network configuration within the containers would be greatly appreciated!

Thanks in advance!

1 Like

Hello @gs01han first of all, welcome to the balena community.

Could you please share more details and logs?

On the other hand, why would you like to use balenaEngine on Yocto?

Thanks

Thank you for reaching out, we are using balena engine on Yocto to host some application like table management system and camera solution.
we could not found any logs, there is no issue with balena itself it shows the service is working, application inside balena is fine, but something temporaly block the communication is there some command you would recommend to check in detail what could be the issue.?

Hi,

Could you provide more details about how balenaEngine is integrated into the Yocto distribution? How are the containers resolving DNS requests for example? How is time management working?

Also, more details about the application composition, in particular container networking configuration.

Finally, did you try to run your applications over balenaOS? In all likelihood the problems you are experiencing have already been ironed out in balenaOS so you could use that implementation as reference to find the problem.

using balenaOS on top of yocto would too much since there is some overlap, we have using balena engine to containerise applications such as table management system, security camera system and we have a local IP that connect with the applications inside the container.
Containers share the host’s network namespace. They inherit the host’s DNS configuration and use the same DNS servers.
Yocto Project offers mechanisms for system time synchronization using NTP to ensure accurate time across the system.
No I did not run the application over balena OS,
Integration Approach:

  • Yocto Recipe: A recipe likely exists in the meta-ared-distro/recipes-containers directory. This recipe builds and installs BalenaEngine on the target system. It might involve:
    • Downloading pre-built binaries or source code.
    • Configuring BalenaEngine using environment variables or configuration files.
    • Packaging BalenaEngine binaries into the final Yocto image.
  • Systemd Service: A systemd service file manages BalenaEngine. This file likely:
    • Defines dependencies (e.g., network service).
    • Starts BalenaEngine using a command like /usr/bin/balena-engine.
    • Sets restart behavior (e.g., restart on failure).

Hi, balenaOS is a Yocto based distribution so not sure what you mean by overlap.

What I am trying to say is that the problems you are facing is the reason why balenaOS exists.

What I would recommend is to make sure your application works with balenaOS. This is as easy as downloading an image from the dashboard for your device type and deploying your containerized application on it. We can then help you debug any problem.

Once the application runs in balenaOS you can use it as reference to address the problem with your own Yocto distribution.

1 Like

We finally finished to do the research on the balenaOS, there is not way to integrate a full balenaOS on our yocto system we already have, from what we read we need to transfer all the services and applications we already build on our yocto system to a balenaOS and that is not feasible for us at this time. Is there any other option that can help us have balena engine work on our yocto system without having to migrate all our system to balenaOS?

Balena engine is a Moby fork - nothing is stopping you from using it in your own distribution.