balena-os / balenaos-in-container

Run balenaOS as a docker container
https://www.balena.io/os/
Apache License 2.0
49 stars 14 forks source link

Device not shown in BalenaCloud #34

Open zomarg opened 4 years ago

zomarg commented 4 years ago

System: OS: Windows 10 Docker Desktop / Docker Engine Version - 19.03.12

Balena Images Tests: resinos:2.50.1_rev1.dev-intel-nuc resinos:2.46.0_rev1.dev-intel-nuc

How to reproduce:

  1. Download the config file from BalenaCloud
  2. Run command .\balenaos-in-container.ps1 -image resin/resinos:2.46.0_rev1.dev-intel-nuc -id testBalena -c "$PWD\**.config.json" -detach -clean_volumes

Result: of docker logs:

Failed to find module 'autofs4'
Configuration file /etc/systemd/system.conf.d/watchdog.conf is marked executable. Please remove executable permission bits. Proceeding anyway.
Failed to create symlink /sys/fs/cgroup/net_cls: File exists
Failed to create symlink /sys/fs/cgroup/net_prio: File exists
Failed to create symlink /sys/fs/cgroup/cpuacct: File exists
Failed to create symlink /sys/fs/cgroup/cpu: File exists

Welcome to balenaOS 2.46.0+rev1!

/lib/systemd/system/chronyd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/chrony/chronyd.pid → /run/chrony/chronyd.pid; please update the unit file accordingly.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on Journal Audit Socket.
[  OK  ] Listening on Syslog Socket.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Listening on Journal Socket.
         Starting Setup Virtual Console...
         Starting Create list of re…odes for the current kernel...
         Starting Remount Root and Kernel File Systems...
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on udev Kernel Socket.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-resin\x2dinfo.slice.
         Mounting Kernel Debug File System...
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[  OK  ] Reached target Slices.
         Starting Apply Kernel Variables...
         Starting OS configuration device key service...
         Starting Rollback clear bo…boot crumb is still present...
         Mounting FUSE Control File System...
         Starting udev Coldplug all Devices...
[  OK  ] Reached target Swap.
         Mounting Temporary Directory (/tmp)...
[  OK  ] Created slice system-getty.slice.
         Starting Journal Service...
         Mounting Huge Pages File System...
[UNSUPP] Starting of mnt-sysroot-inactive partition not supported.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Started Setup Virtual Console.
[  OK  ] Started Create list of req… nodes for the current kernel.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Started Apply Kernel Variables.
os-config-devicekey.service: Main process exited, code=exited, status=1/FAILURE
os-config-devicekey.service: Failed with result 'exit-code'.
[FAILED] Failed to start OS configuration device key service.
See 'systemctl status os-config-devicekey.service' for details.
[DEPEND] Dependency failed for Prepare OpenVPN.
[DEPEND] Dependency failed for OpenVPN.
openvpn.service: Job openvpn.service/start failed with result 'dependency'.
prepare-openvpn.service: Job prepare-openvpn.service/start failed with result 'dependency'.
[DEPEND] Dependency failed for Balena supervisor.
resin-supervisor.service: Job resin-supervisor.service/start failed with result 'dependency'.
[  OK  ] Started Rollback clear boo…ltboot crumb is still present.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Mounted Temporary Directory (/tmp).
[  OK  ] Mounted Huge Pages File System.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Containers.
         Mounting /var/volatile...
         Mounting resin-data bind mount...
[  OK  ] Started Journal Service.
[  OK  ] Mounted /var/volatile.
[  OK  ] Mounted resin-data bind mount.
         Starting Bind mount volatile /var/spool...
         Starting Bind mount volatile /var/cache...
         Starting Bind mount volatile /srv...
         Starting Bind mount volatile /var/lib...
[  OK  ] Started Bind mount volatile /var/spool.
[  OK  ] Started Bind mount volatile /var/cache.
[  OK  ] Started udev Coldplug all Devices.
         Starting udev Wait for Complete Device Initialization...
[  OK  ] Started Bind mount volatile /srv.
[  OK  ] Started Bind mount volatile /var/lib.
         Mounting Docker data mountpoint...
[  OK  ] Mounted Docker data mountpoint.
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Bind mount for /home/root/.docker...
         Starting Bind mount for /etc/NetworkManager/conf.d...
         Starting Bind mount for /etc/hostname...
         Starting Bind mount for /etc/openvpn...
         Starting Bind mount for /var/lib/systemd...
         Starting Bind mount for /var/lib/chrony...
         Starting Bind mount for /etc/udev/rules.d...
         Starting Bind mount for /home/root/.rnd...
         Starting Bind mount for /etc/ssh/hostkeys...
         Starting Update UTMP about System Boot/Shutdown...
         Starting Bind mount for /etc/docker...
         Starting Bind mount for /var/lib/NetworkManager...
         Starting Bind mount for /e…kManager/system-connections...
         Starting Bind mount for /home/root/.ssh...
         Starting Bind mount for /etc/resin-supervisor...
         Starting Bind mount for /var/lib/bluetooth...
[  OK  ] Started Bind mount for /home/root/.docker.
[  OK  ] Started Bind mount for /etc/NetworkManager/conf.d.
[  OK  ] Started Bind mount for /etc/hostname.
[  OK  ] Started Bind mount for /etc/openvpn.
[  OK  ] Started Bind mount for /var/lib/systemd.
[  OK  ] Started Bind mount for /var/lib/chrony.
[  OK  ] Started Bind mount for /etc/udev/rules.d.
[  OK  ] Started Bind mount for /home/root/.rnd.
[  OK  ] Started Bind mount for /etc/ssh/hostkeys.
[  OK  ] Started Bind mount for /etc/docker.
[  OK  ] Started Bind mount for /var/lib/NetworkManager.
[  OK  ] Started Bind mount for /et…orkManager/system-connections.
[  OK  ] Started Bind mount for /home/root/.ssh.
[  OK  ] Started Bind mount for /etc/resin-supervisor.
[  OK  ] Started Bind mount for /var/lib/bluetooth.
         Starting udev Kernel Device Manager...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started udev Wait for Complete Device Initialization.
[  OK  ] Started Hardware RNG Entropy Gatherer Daemon.
         Starting Initialize system clock from build timestamp...
[  OK  ] Reached target System Initialization.
         Starting Docker Socket for the API.
[  OK  ] Started Config.json path watch.
         Starting sshd.socket.
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Started Balena supervisor updater timer.
[  OK  ] Reached target Timers.
         Starting Docker Socket for the API.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[  OK  ] Reached target Paths.
[  OK  ] Listening on Docker Socket for the API.
[  OK  ] Listening on sshd.socket.
[  OK  ] Listening on Docker Socket for the API.
[  OK  ] Started Initialize system clock from build timestamp.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting OpenSSH Key Generation...
[  OK  ] Started System Logging Service.
         Starting NetworkManager co… fragments from config.json...
[  OK  ] Started Kernel Logging Service.
         Starting Balena device UUID...
[  OK  ] Started D-Bus System Message Bus.
         Starting udev rules configuration from config.json...
         Starting OS SSH keys...
[  OK  ] Started NTP client/server.
[  OK  ] Reached target System Time Synchronized.
         Starting Resin persistent logs...
         Starting Resin network configure service...
         Starting Modem Manager...
[  OK  ] Started OpenSSH Key Generation.
[FAILED] Failed to start Resin network configure service.
See 'systemctl status resin-net-config.service' for details.
[FAILED] Failed to start NetworkMan…on fragments from config.json.
See 'systemctl status os-networkmanager.service' for details.
[  OK  ] Started Resin persistent logs.
         Starting Network Manager...
[  OK  ] Started Modem Manager.
[FAILED] Failed to start OS SSH keys.
See 'systemctl status os-sshkeys.service' for details.
[  OK  ] Started udev rules configuration from config.json.
[FAILED] Failed to start Balena device UUID.
See 'systemctl status balena-device-uuid.service' for details.
[DEPEND] Dependency failed for Resin Hostname Configuration.
[DEPEND] Dependency failed for Avahi mDNS/DNS-SD Stack.
[  OK  ] Started Network Manager.
[  OK  ] Reached target Network.
         Starting DNS forwarder and DHCP server...
         Starting Resin init service...
[  OK  ] Started OS configuration update service.
         Starting Hostname Service...
[  OK  ] Started DNS forwarder and DHCP server.
         Starting Balena Application Container Engine...
         Starting Resin proxy configuration service...
[FAILED] Failed to start Resin proxy configuration service.
See 'systemctl status resin-proxy-config.service' for details.
[DEPEND] Dependency failed for reds… transparent proxy redirector.
[FAILED] Failed to start Resin init service.
See 'systemctl status resin-init.service' for details.
[  OK  ] Started Hostname Service.
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Network Manager Script Dispatcher Service.
[  OK  ] Started Balena Application Container Engine.
[  OK  ] Created slice libcontainer…12_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…12_systemd_test_default.slice.
[  OK  ] Started libcontainer conta…60f581d2958caed95ab17b0871252.
[  OK  ] Created slice libcontainer…46_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…46_systemd_test_default.slice.
[  OK  ] Created slice libcontainer…52_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…52_systemd_test_default.slice.
[  OK  ] Created slice libcontainer…59_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…59_systemd_test_default.slice.
[  OK  ] Created slice libcontainer…72_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…72_systemd_test_default.slice.
[  OK  ] Created slice libcontainer…79_systemd_test_default.slice.
[  OK  ] Removed slice libcontainer…79_systemd_test_default.slice.
[  OK  ] Stopped OS configuration update service.
         Starting OS configuration device key service...
[FAILED] Failed to start OS configuration device key service.
See 'systemctl status os-config-devicekey.service' for details.
[  OK  ] Started OS configuration update service.
[  OK  ] Stopped OS configuration update service.
         Starting OS configuration device key service...
[FAILED] Failed to start OS configuration device key service.
See 'systemctl status os-config-devicekey.service' for details.
[  OK  ] Started OS configuration update service.
[ ***  ] A start job is running for /dev/ttyS0 (31s / 1min 30s)

Expected: Device should be shown on BalenaCloud

onmomo commented 3 years ago

You could try to ssh into the container and run systemctl status os-config-devicekey.service to get more information why it failed to load. docker exec -it containerID sh and check if /mnt/boot/config.json is there or try docker exec -it containerID systemctl status os-config-devicekey.service