Read the statement by Michael Teeuw here.
MagicMirrorOS build intermittently not starting mm container (Version 2.30)
-
Hi,
I’ve recently built a mm using MagicMirrorOS (which uses the docker install) to use as a family calendar on the wall. Have in configured for the information I want
However, I am finding if power cycle it, sometimes the calendar does not load up and just have a blank screen.
If execute:
scottwalsh@calendar:/opt/mm/run $ docker compose up -d --force-recreate
Then, it loads.
Have some Linux background from many years ago, but docker is new to me - so not sure where to look to work out how to resolve.
From looking at the logs (some extracts below), looks like the mm container isn’t connecting to Xserver.
Any suggestions where to look for useful logs to work out the issue?
Thanks, Scott
scottwalsh@calendar:/opt/mm/run $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 00d6a9d4ab86 karsten13/mmpm:latest "/home/node/entrypoi…" 3 hours ago Up 2 hours 0.0.0.0:6789->6789/tcp, :::6789->6789/tcp, 0.0.0.0:7890-7891->7890-7891/tcp, :::7890-7891->7890-7891/tcp, 0.0.0.0:8907->8907/tcp, :::8907->8907/tcp mmpm 62d9fe5220c6 karsten13/labwc:latest "/entrypoint.sh" 3 hours ago Up 2 hours labwc f43c6ecab44b karsten13/magicmirror:latest "/usr/bin/tini -- ./…" 2 days ago Up 23 seconds mm 9643b13d7183 containrrr/watchtower:latest "/watchtower --inter…" 2 days ago Up 2 hours (healthy) 8080/tcp watchtower scottwalsh@calendar:/opt/mm/run $ scottwalsh@calendar:/opt/mm/run $ docker logs mm [entrypoint 06:55:28.611] [INFO] ***WARNING*** could write to /etc/localtime [entrypoint 06:55:28.626] [INFO] copy default modules [entrypoint 06:55:28.824] [INFO] copy css files > magicmirror@2.30.0 start > npm run start:x11 > magicmirror@2.30.0 start:x11 > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [2025-02-14 06:55:44.929] [LOG] Starting MagicMirror: v2.30.0 [2025-02-14 06:55:45.661] [LOG] Loading config ... [2025-02-14 06:55:45.672] [LOG] config template file not exists, no envsubst [2025-02-14 06:55:47.716] [INFO] Checking config file /opt/magic_mirror/config/config.js ... [2025-02-14 06:55:47.925] [INFO] Your configuration file doesn't contain syntax errors :) [2025-02-14 06:55:47.928] [INFO] Checking modules structure configuration ... [2025-02-14 06:55:48.246] [INFO] Your modules structure configuration doesn't contain errors :) [2025-02-14 06:55:48.253] [LOG] Loading module helpers ... [2025-02-14 06:55:48.271] [LOG] Initializing new module helper ... [2025-02-14 06:55:48.274] [LOG] Module helper loaded: MMM-mmpm [2025-02-14 06:55:48.276] [LOG] No helper found for module: alert. [2025-02-14 06:55:48.293] [LOG] Initializing new module helper ... [2025-02-14 06:55:48.294] [LOG] Module helper loaded: updatenotification [2025-02-14 06:55:49.209] [LOG] Initializing new module helper ... [2025-02-14 06:55:49.210] [LOG] Module helper loaded: calendar [2025-02-14 06:55:49.230] [LOG] No helper found for module: MMM-CalendarExt3. [2025-02-14 06:55:49.232] [LOG] No helper found for module: clock. [2025-02-14 06:55:49.234] [LOG] No helper found for module: weather. [2025-02-14 06:55:49.235] [LOG] All module helpers loaded. [2025-02-14 06:55:49.262] [LOG] Starting server on port 8080 ... [2025-02-14 06:55:49.271] [WARN] You're using a full whitelist configuration to allow for all IPs [2025-02-14 06:55:50.319] [LOG] Server started ... [2025-02-14 06:55:50.322] [LOG] Connecting socket for: MMM-mmpm [2025-02-14 06:55:50.325] [LOG] Starting module helper: MMM-mmpm [2025-02-14 06:55:50.326] [LOG] Connecting socket for: updatenotification [2025-02-14 06:55:50.328] [LOG] Starting module helper: updatenotification [2025-02-14 06:55:50.329] [LOG] Connecting socket for: calendar [2025-02-14 06:55:50.331] [LOG] Starting node helper for: calendar [2025-02-14 06:55:50.333] [LOG] Sockets connected & modules started ... [58:0214/065550.892616:ERROR:ozone_platform_x11.cc(245)] Missing X server or $DISPLAY [58:0214/065550.893706:ERROR:env.cc(258)] The platform failed to initialize. Exiting. /opt/magic_mirror/node_modules/electron/dist/electron exited with signal SIGSEGV [entrypoint 06:56:00.774] [INFO] ***WARNING*** could write to /etc/localtime [entrypoint 06:56:00.791] [INFO] copy default modules [entrypoint 06:56:00.981] [INFO] copy css files > magicmirror@2.30.0 start > npm run start:x11 > magicmirror@2.30.0 start:x11 > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js [2025-02-14 06:56:16.871] [LOG] Starting MagicMirror: v2.30.0 [2025-02-14 06:56:18.897] [LOG] Loading config ... [2025-02-14 06:56:18.918] [LOG] config template file not exists, no envsubst [2025-02-14 06:56:20.944] [INFO] Checking config file /opt/magic_mirror/config/config.js ... [2025-02-14 06:56:21.141] [INFO] Your configuration file doesn't contain syntax errors :) [2025-02-14 06:56:21.143] [INFO] Checking modules structure configuration ... [2025-02-14 06:56:21.433] [INFO] Your modules structure configuration doesn't contain errors :) [2025-02-14 06:56:21.441] [LOG] Loading module helpers ... [2025-02-14 06:56:21.459] [LOG] Initializing new module helper ... [2025-02-14 06:56:21.461] [LOG] Module helper loaded: MMM-mmpm [2025-02-14 06:56:21.463] [LOG] No helper found for module: alert. [2025-02-14 06:56:21.478] [LOG] Initializing new module helper ... [2025-02-14 06:56:21.479] [LOG] Module helper loaded: updatenotification [2025-02-14 06:56:21.959] [LOG] Initializing new module helper ... [2025-02-14 06:56:21.960] [LOG] Module helper loaded: calendar [2025-02-14 06:56:21.971] [LOG] No helper found for module: MMM-CalendarExt3. [2025-02-14 06:56:21.973] [LOG] No helper found for module: clock. [2025-02-14 06:56:21.974] [LOG] No helper found for module: weather. [2025-02-14 06:56:21.975] [LOG] All module helpers loaded. [2025-02-14 06:56:21.996] [LOG] Starting server on port 8080 ... [2025-02-14 06:56:22.003] [WARN] You're using a full whitelist configuration to allow for all IPs [2025-02-14 06:56:23.024] [LOG] Server started ... [2025-02-14 06:56:23.026] [LOG] Connecting socket for: MMM-mmpm scottwalsh@calendar:/opt/mm/run $ docker logs labwc 00:00:00.000 [INFO] [seatd/seat.c:48] Created VT-bound seat seat0 00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started 00:00:03.286 [INFO] [seatd/server.c:145] New client connected (pid: 13, uid: 1000, gid: 1000) 00:00:03.286 [INFO] [seatd/seat.c:239] Added client 1 to seat0 00:00:03.286 [INFO] [seatd/seat.c:563] Opened client 1 on seat0 00:00:00.000 [INFO] [seatd/seatd.c:167] Removing leftover socket at /run/seatd.sock 00:00:00.000 [INFO] [seatd/seat.c:48] Created VT-bound seat seat0 00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started 00:00:02.811 [INFO] [seatd/server.c:145] New client connected (pid: 13, uid: 1000, gid: 1000) 00:00:02.812 [INFO] [seatd/seat.c:239] Added client 1 to seat0 00:00:02.812 [INFO] [seatd/seat.c:563] Opened client 1 on seat0 scottwalsh@calendar:/opt/mm/run $
-
As an update, based on the pointers from @KARSTEN13 and @SDETWEIL, have a workaround.
Had three issues going on.
1:
I found that on a graceful reboot (shutdown -r now) that it would generally start fine, but not on an ungraceful reboot (power cycle the machine).Looks like when it was ungraceful reboot, the labwc container would show with uptime of (for example) five hours when ‘docker ps’, even though the machine was rebooted 20min ago after ‘docker compose up’ was executed by install.sh. Whereas the magicmirror container would have recently started.
I assume kind of lock file confusing things?
Workaround was to change the first ‘docker compose up’ install.sh to ‘docker compose up -d --force-recreate’
2:
I’d also included a pause and --force-recreate at the end of the install.sh and noted it was never executing as per @KARSTEN13’s suggestion.
Looked like the install.sh script was hanging at docker compose pull.
Commented that out.3:
Lastly, the initial ‘docker compose up -d --force-recreate’ in install.sh would still fail often with the mm container restarting with logs as per the original post.With a 7 min pause and then second ‘docker compose up -d --force-recreate’ it seems to start the second time well (3min wasn’t enough, 5min was better, 7min seems to work).
Workaround is a bit on the slow side, at some point will see if can refactor it a bit so that a pull for updates occurs.
Extract of resulting install.sh below.
_info "--> Pulling docker images and starting magicmirror" # need sudo for docker here if docker was installed with this script # use up so mm can start if there are already local images _info "--> Pre Start Pause for 2min" sleep 120 _info "--> Start and recreate" $_sudo docker compose up -d --force-recreate #_info "--> Pull Pause for 1 min" #sleep 60 # pull new images #_info "--> Image Pull" #$_sudo docker compose pull #_info "--> Restart Pause for 1 min" #sleep 60 # restart (only if new images pulled) #_info "--> Restart stopped" #$_sudo docker compose up -d _info "--> Final Pause for 7 min" sleep 720 _info "--> Final start and recreate" $_sudo docker compose up -d --force-recreate if [[ "$_sudo" == "sudo" ]]; then _info "--> Reboot needed, starting in 120 sec. (use ctrl-c to skip)" sleep 120 sudo reboot now fi # cleanup $_sudo docker image prune -f
-
@scottwalsh that is not MagicMirrorOS
that is karstens docker container -
@scottwalsh what host is the docker host? pi, unix, nas?
mine is running on synology nas
-
@scottwalsh said in MagicMirrorOS build intermittently not starting mm container (Version 2.30):
However, I am finding if power cycle it, sometimes the calendar does not load up and just have a blank screen.
I don’t know if this is related to the docker setup but I think not. I have encountered similar problems depending on slow hardware and/or heavy load on start due to many modules starting in parallel or starting after fresh boot.
So you could try to change the start order of the modules (order in config.js), e.g. put the calendar as first.
@sdetweil said in MagicMirrorOS build intermittently not starting mm container (Version 2.30):
@scottwalsh that is not MagicMirrorOS
that is karstens docker containermmos uses my docker setup
-
-
from the beginning
-
@karsten13 hm…
-
well, I did not promote it because the image base was to old (beside other problems) but in 2024 I decided to do a complete refactor so now the image build (iso, not docker) is done by me with gitlab based on the current raspian bookworm os lite.
-
@scottwalsh please dont double post
-
@sdetweil
The host is a pi zero 2w - so is on the low spec side.