balena-os / balena-engine

Moby-based Container Engine for Embedded, IoT, and Edge uses
https://www.balena.io
Apache License 2.0
695 stars 66 forks source link

Balena Engine fails to start when changing the network interface name #304

Open nitishagar opened 2 years ago

nitishagar commented 2 years ago

BUG REPORT INFORMATION

Description

Issue with the balena engine not starting when an img contains a udev rule to change a network interface name. Resulting in containers failing to connect to the network.

Steps to reproduce the issue:

  1. Device is flashed via preloaded unwrapped image. img contains a udev rule to change a network interface name
  2. Device boots in balena with default name
  3. Network-Manager container attempts to grab MAC address from defined network interface but since it has not been renmaed yet.. Device reboots
  4. On reboot, the UDEV rule has taken, Network-Manager container grabs MAC address and changes device name to MAC address. Set environment variable for serial_number. Device reboots again
  5. On second reboot, the containers do not seem to start properly and the issue outline above occurs. It seems the BalenaEngine does not restart properly. Going into HostOS and running "reboot" fixes the problem but obviously we do not want to manually do this every time.

Describe the results you received:

Cannot connect to the balenaEngine daemon at unix:///var/run/balena-engine.sock. Is the balenaEngine daemon running?

Describe the results you expected: All container services coming up and connecting as expected.

Additional information you deem important (e.g. issue happens only occasionally):

Device type: Generic x86_64 OS version: balenaOS 2.98.33 Supervisor version: 14.0.13

jellyfish-bot commented 2 years ago

[nitish] This has attached https://jel.ly.fish/41fb2425-19a8-4747-96f1-8c663a78a33c