Read the statement by Michael Teeuw here.
mmpm connection to MagicMirror failed
-
Hi all,
I just started using MagicMirror and wanted to use the package manager mpmm with it.
- MagicMirror has been installed via the MagicMirrorOS on a RaspberryPi
- I can see the MagicMirror output on the screen connected to the Pi and via the URL (192.168.2.76:8080)
- I installed mpmm via
sudo apt install libffi-dev nginx-full -y python3 -m pip install --upgrade --no-cache-dir mmpm mmpm --guided-setup echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
- I can access the mpmm GUI but it is showing “Unable to retrieve active modules”
- my mmpm settings are:
MMPM_IS_DOCKER_IMAGE: false MMPM_MAGICMIRROR_DOCKER_COMPOSE_FILE: /home/pi/magicmirror/run/docker-compose.yml MMPM_MAGICMIRROR_PM2_PROCESS_NAME: MMPM_MAGICMIRROR_ROOT: /home/pi/magicmirror MMPM_MAGICMIRROR_URI: http://192.168.2.76:8080
Alsp a
mmpm mm-ctl --status
shows that it failed to connect to MagicMirror. At least I am not aware that I use pm2.The mmpm log file shows a
Connection to namespace /mmpm was rejected
:[...] Back up of database complete 2021-10-28 00:23:57,221.221 INFO core - display_magicmirror_modules_status: attempting to connect to '/mmpm' namespace within MagicMirror websocket attempting to connect to '/mmpm' namespace within MagicMirror websocket 2021-10-28 00:23:57,273.273 INFO client - _handle_eio_connect: Engine.IO connection established Engine.IO connection established 2021-10-28 00:23:57,311.311 INFO client - _handle_error: Connection to namespace /mmpm was rejected Connection to namespace /mmpm was rejected 2021-10-28 00:23:58,315.315 INFO client - _handle_eio_disconnect: Engine.IO connection dropped Engine.IO connection dropped 2021-10-28 00:23:58,328.328 ERROR utils - error_msg: Failed to connect to MagicMirror, closing socket. Is MagicMirror running? Failed to connect to MagicMirror, closing socket. Is MagicMirror running? 2021-10-28 00:23:58,330.330 ERROR core - display_magicmirror_modules_status: One or more namespaces failed to connect One or more namespaces failed to connect 2021-10-28 00:23:58,332.332 INFO utils - socketio_client_disconnect: attempting to disconnect from MagicMirror websocket attempting to disconnect from MagicMirror websocket
What could be wrong? Is the MMPM_MAGICMIRROR_ROOT correct for the MagicMirrorOS installation?
Thanks for reading that far,
Kab -
you should check for errors when loading the GUI in the browser, CTRL+SHIFT+I opens then console.
-
Thanks @karsten13
MagicMirrorPackageManager
The debug console on the mmpm shows an error that it couldn’t find a favicon and several source map Errors (as Warnings) like :
Source-Map-Fehler: Error: request failed with status 404 Ressourcen-Adresse: http://192.168.2.76:7890/static/assets/monaco/vs/editor/editor.main.js Source-Map-Adresse: ../../../min-maps/vs/editor/editor.main.js.map
Its also the
assets/monaco/vs/loader.js
assets/monaco/vs/editor/editor.main.js
assets/monaco/vs/editor/editor.main.nls.js
assets/monaco/vs/base/worker/workerMain.js#editorWorkerService
assets/monaco/vs/base/worker/workerMain.js#json
assets/monaco/vs/editor/editor.main.nls.js
with the same Warnings. Plus it complains about the zoom property.
MagicMirror
On the MagicMirror site it shows
GEThttp://192.168.2.76:8080/modules/mmpm/mmpm.js [HTTP/1.1 404 Not Found 16ms] Die Ressource von "http://192.168.2.76:8080/modules/mmpm/mmpm.js" wurde wegen eines MIME-Typ-Konfliktes ("text/html") blockiert (X-Content-Type-Options: nosniff). 192.168.2.76:8080 Error on loading script: modules/mmpm/mmpm.js onerror http://192.168.2.76:8080/js/loader.js:194 (Async: EventHandlerNonNull) loadFile http://192.168.2.76:8080/js/loader.js:193 loadModule http://192.168.2.76:8080/js/loader.js:140 loadNextModule http://192.168.2.76:8080/js/loader.js:27 loadNextModule http://192.168.2.76:8080/js/loader.js:29 afterLoad http://192.168.2.76:8080/js/loader.js:130 bootstrapModule http://192.168.2.76:8080/js/loader.js:166 loadTranslations http://192.168.2.76:8080/js/module.js:316 bootstrapModule http://192.168.2.76:8080/js/loader.js:163 loadNextDependency http://192.168.2.76:8080/js/module.js:296 loadNextDependency http://192.168.2.76:8080/js/module.js:293 onload http://192.168.2.76:8080/js/loader.js:210 (Async: EventHandlerNonNull) loadFile http://192.168.2.76:8080/js/loader.js:208 loadFile http://192.168.2.76:8080/js/loader.js:268 loadNextDependency http://192.168.2.76:8080/js/module.js:291 loadDependencies http://192.168.2.76:8080/js/module.js:300 loadStyles http://192.168.2.76:8080/js/module.js:267 bootstrapModule http://192.168.2.76:8080/js/loader.js:161 loadNextDependency http://192.168.2.76:8080/js/module.js:296 loadNextDependency http://192.168.2.76:8080/js/module.js:293 loadFile http://192.168.2.76:8080/js/loader.js:245 loadNextDependency http://192.168.2.76:8080/js/module.js:291 loadDependencies http://192.168.2.76:8080/js/module.js:300 loadScripts http://192.168.2.76:8080/js/module.js:276 bootstrapModule http://192.168.2.76:8080/js/loader.js:159 afterLoad http://192.168.2.76:8080/js/loader.js:129 loadModule http://192.168.2.76:8080/js/loader.js:142 onload http://192.168.2.76:8080/js/loader.js:190 (Async: EventHandlerNonNull) loadFile http://192.168.2.76:8080/js/loader.js:188 loadModule http://192.168.2.76:8080/js/loader.js:140 loadNextModule http://192.168.2.76:8080/js/loader.js:27 loadNextModule http://192.168.2.76:8080/js/loader.js:29 afterLoad http://192.168.2.76:8080/js/loader.js:130 bootstrapModule http://192.168.2.76:8080/js/loader.js:166 loadTranslations http://192.168.2.76:8080/js/module.js:332 load http://192.168.2.76:8080/js/translator.js:117 onreadystatechange http://192.168.2.76:8080/js/translator.js:30 (Async: EventHandlerNonNull) loadJSON http://192.168.2.76:8080/js/translator.js:20 load http://192.168.2.76:8080/js/translator.js:114 loadTranslations http://192.168.2.76:8080/js/module.js:328 bootstrapModule http://192.168.2.76:8080/js/loader.js:163 loadNextDependency http://192.168.2.76:8080/js/module.js:296
and
Template render error: (templates/module.njk) [Line 64, Column 55] ReferenceError: version is not defined t lib.js:38 render environment.js:489 root nunjucks.min.js line 2 > Function:256 render environment.js:478 render environment.js:314 getTemplate environment.js:261 o environment.js:273 getSource web-loaders.js:50 onreadystatechange web-loaders.js:74 module.js:94:11 getDom module.js:94 x environment.js:20 call browser-asap.js:48 u browser-raw.js:52
Does anything of this makes sense to you?
Or can it be the installation procedure? I installed the Docker-based MagicMirrorOS. Do I need to install the mmpm also via the Docker route?
-
Does anything of this makes sense to you?
not really … never tested this setup.
Would try to run with 2 containers, setup here.
You have already all the files in
~/magicmirror/run/
folder, just save the content ofdocker-compose.yml
(only if you changed something) and thencp ~/magicmirror/run/rpi_mmpm.yml ~/magicmirror/run/docker-compose.yml
and restart the container. -
Hi @karsten13
I did the
cp ~/magicmirror/run/rpi_mmpm.yml ~/magicmirror/run/docker-compose.yml
and reboot but got a black screen for the MagicMirror. So I replaced docker-compose.yml by the original file and rebooted again but the screen is still black.
I don’t know much about docker containers. I trieddocker exec -it mm bash
and it opened as usual.
What else is changed after reboot with the other container? -
What else is changed after reboot with the other container?
nothing
You can look into these yaml files, it`s all text.
You can see which containers are running with
docker ps
and may something is in the logsdocker logs mm
.It takes some time pulling new images (this is done after a reboot).
-
Hi @karsten13
docker ps shows
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 04fcaa798d2e karsten13/magicmirror:latest "/usr/bin/tini -- ./…" 3 days ago Up 28 minutes mm
and the first error in the log is
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! magicmirror@2.17.1 start: `DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin /electron js/electron.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the magicmirror@2.17.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/node/.npm/_logs/2021-10-29T20_22_53_399Z-debug.log
However,
/home/node/.npm/_logs/2021-10-29T20_22_53_399Z-debug.log
does not exist. -
/home/node/.npm/_logs/2021-10-29T20_22_53_399Z-debug.log
the file is in the container, after executing
docker exec -it mm bash
you are in the container and then you should be able to see this file.But the whole thing is strange.
You could reset the setup by
- stop the container: navigate to
~/magicmirror/run
and rundocker-compose down
- test there is no container running with
docker ps
- navigate to home directory executing
cd
- rename magicmirror folder with
mv magicmirror magicmirror-old
- reboot your pi
While starting the now missing magicmirror folder will be recreated from scratch.
- stop the container: navigate to
-
Hi @karsten13
Thanks, that helped. I could go back to the previous setup.
mmpm still doesn’t work, though. I think I installed it wrong but need to dig deeper.
If I just ssh on the PI I can use mmpm but If I go into the mm container withdocker exec -it mm bash
it cannot find the mmpm command. Now I need to figure out how to remove my mpmm installation.