sdetweil / MagicMirror_scripts

Magic Mirror installation and setup scripts
368 stars 64 forks source link

Update script stuck after failed module #91

Closed gonzonia closed 1 month ago

gonzonia commented 4 months ago

I was running the update and it failed on MMM-Pir (https://github.com/bugsounet/MMM-Pir/issues/81)

However, once it failed I got a message "Do you want to continue?" but it flooded the terminal like it was stuck in a loop. Answering Y or n didn't help. I had to Ctrl-C to stop it.

Screenshot 2024-07-01 at 9 02 56 AM
sdetweil commented 4 months ago

way cool! not

I saw the post about rebuild

do this

cd ~/MagicMirror 
npm install @electron/rebuild 
cd modules/MMM-Pir
../../node_modules/.bin/electron-rebuild

please advise

gonzonia commented 4 months ago

✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild node-gyp failed to rebuild '/home/pi/MagicMirror/modules/MMM-Pir/node_modules/epoll'

Error: node-gyp failed to rebuild '/home/pi/MagicMirror/modules/MMM-Pir/node_modules/epoll' at ChildProcess. (/home/pi/MagicMirror/node_modules/@electron/rebuild/lib/module-type/node-gyp/node-gyp.js:118:24) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:294:12)

sdetweil commented 4 months ago

yeh darn good old poll again

sdetweil commented 4 months ago

ok try this

in the MMM-Pir folder rm package-lock.json rm -rf node_modules npm install and maybe the electron-rebuild command again

gonzonia commented 4 months ago

That seemed to work without error (just lots of deprecated warnings). Should I still run the electron-rebuild

sdetweil commented 4 months ago

no, electron rebuild not needed

Perilax-De commented 4 months ago

@sdetweil I still have the same issue. During the update to the new MM Version with your script, I stuck in a loop with the message "Do you want to continue?". This came during the routine for MMM-Pir. I updated MMM-Pir manually before I start the script. After I stopped the loop with Ctrl-C and reboot my mirror the MMM-Pir is not working anymore. Also a rebuild didn´t help. Any idea ?

sdetweil commented 4 months ago

I do not.

can you give me the info from MagicMirror startup which describes your system.

I know the pir author has been facing charges.

Perilax-De commented 4 months ago

You mean the pm2 startup log ? Or the log of your script ?

sdetweil commented 4 months ago

the MagicMirror startup,

dumps out a bunch of misc info, os ,version ,electron version..etc etc

Perilax-De commented 4 months ago

Raspberry Pi 4 Model B Rev 1.1 Operating System: Raspbian GNU/Linux 11 (bullseye) Kernel: Linux 6.1.21-v8+ Architecture: arm64 Installed Node version: v20.9.0 Installed npm version: V10.1.0 MagicMirror version 2.28.0 Electron version 31.1.0 MMM-Pir v1.5.3

MMM-PIR is displayed as installed, but does not work.

Here the log of the update:

`Upgrade started - Di Jul 9 22:30:40 CEST 2024 system is Linux smartmirror 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux user requested to apply changes doing test run = false the os is Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye Node currently installed. Checking version number. Minimum Node version: v20.9.0 Installed Node version: v20.8.0 installing correct version of node and npm, please wait installing : node-v20.9.0 mkdir : /usr/local/n/versions/node/20.9.0 fetch : https://nodejs.org/dist/v20.9.0/node-v20.9.0-linux-armv7l.tar.xz copying : node/20.9.0 installed : v20.9.0 (with npm 10.1.0) Check current Node installation ... Node currently installed. Checking version number. Minimum Node version: v20.9.0 Installed Node version: v20.9.0 No Node.js upgrade necessary. Check current NPM installation ... NPM currently installed. Checking version number. Minimum npm version: V10.1.0 Installed npm version: V10.1.0 No npm upgrade necessary.

saving custom.css remote name = origin upgrading from version 2.27.0 to 2.28.0 fetching latest revisions git fetch rc=0 current branch = master On branch master Untracked files: (use "git add ..." to include in what will be committed) core installers/pm2_MagicMirror.json run-start.sh

nothing added to commit but untracked files present (use "git add" to track) no files different from github version test merge result rc='' , if empty, no conflicts executing merge, apply specified merge result rc= 0 Updating 5ea8a346..53fc814f Fast-forward .github/workflows/automated-tests.yaml
3 +- .github/workflows/electronRebuild.yaml
8 + CHANGELOG.md
45 +- config/config.js.sample
14 +- fonts/package-lock.json
16 +- fonts/package.json
10 +- js/app.js
15 +- js/check_config.js
66 + js/loader.js
3 +- js/main.js
11 +- js/utils.js
11 + modules/default/calendar/calendar.js
15 +- modules/default/compliments/compliments.js
7 +- .../default/updatenotification/update_helper.js
11 +- modules/default/weather/providers/openmeteo.js
18 +- modules/default/weather/providers/weathergov.js
2 +- package-lock.json
3164 +++++++++++++------- package.json
105 +- .../compliments_specialDayUnique_false.js
22 + .../compliments_specialDayUnique_true.js
22 + tests/e2e/modules/compliments_spec.js
24 + vendor/package-lock.json
8 +- vendor/package.json
8 +- 23 files changed, 2342 insertions(+), 1266 deletions(-)
create mode 100644 tests/configs/modules/compliments/compliments_specialDayUnique_false.js
create mode 100644 tests/configs/modules/compliments/compliments_specialDayUnique_true.js processor architecture is aarch64 updating MagicMirror runtime, please wait (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (Use node --trace-warnings ... to show where the warning was created) (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit (node:4392) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit

magicmirror@2.28.0 postinstall npm run install-vendor && npm run install-fonts && echo "MagicMirror² installation finished successfully! "

magicmirror@2.28.0 install-vendor echo "Installing vendor files ... " && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

Installing vendor files ...

changed 1 package in 10s

magicmirror@2.28.0 install-fonts echo "Installing fonts ... " && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

Installing fonts ...

changed 2 packages in 12s MagicMirror² installation finished successfully!

magicmirror@2.28.0 prepare [ -f node_modules/.bin/husky ] && husky || echo no husky installed.

no husky installed.

added 469 packages in 2m

112 packages are looking for funding run npm fund for details npm install completed - Di Jul 9 22:33:55 CEST 2024 on base fixing sandbox permissions

Checking for modules with removed libraries downloading dumpactivemodules script

updating dependencies for active modules with package.json files

processing for module MMM-Todoist please wait

----------------------------------

npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 50 packages, and audited 51 packages in 13s

3 packages are looking for funding run npm fund for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing a different dependency.

Run npm audit for details.

processing complete for module MMM-Todoist

processing for module MMM-Remote-Control please wait

----------------------------------

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 50 packages, and audited 51 packages in 12s

12 packages are looking for funding run npm fund for details

found 0 vulnerabilities

processing complete for module MMM-Remote-Control

processing for module MMM-Pir please wait

----------------------------------

MMM-Pir@1.5.3 update installer/update.sh

Welcome to MMM-Pir v1.5.3 Updater

Updating... HEAD ist jetzt bei 1f90ef8 Update README.md Bereits aktuell. Done

Ready for Installing...

MMM-Pir@1.5.3 preinstall installer/preinstall.sh -d 'unclutter cec-utils ddcutil python3 python-is-python3 python3-gpiozero'

Welcome to MMM-Pir v1.5.3

No root checking... Checking MMM-Pir: pi/pi Checking MagicMirror: pi/pi

Checking OS... OS Detected: linux-gnueabihf (raspbian 11 aarch64)

Checking all dependencies... All Dependencies needed are installed !

Installing @sdetweil sandbox fix... fixing sandbox permissions

MMM-Pir@1.5.3 postinstall installer/postinstall.sh -m -r

Minify Main code... Found: 7 files to minify

Process File: ../MMM-Pir.js Process File: ../node_helper.js Process File: ../components/screenTouch.js Process File: ../components/screenLib.js Process File: ../components/screenDisplayer.js Process File: ../components/progressbar.js Process File: ../components/pirLib.js Done

Try to Disable screen saver... Found: screen saver in gsettings gsettings screen saver already disabled Found: screen saver in lightdm screensaver via lightdm already disabled Found: screen saver in lxsession lxsession screen saver already disabled Done

Rebuild MagicMirror... Done

MMM-Pir is now installed !

added 419 packages in 1m

125 packages are looking for funding run npm fund for details

sdetweil commented 4 months ago

@bugsounet can you look at this.

I check for rebuild or upgrade abd run those instead of npm install for modules during upgrade

bugsounet commented 4 months ago

@sdetweil natural command for this is npm run rebuild (Available only with @bugsounet modules)

sdetweil commented 4 months ago

I look in the package.json scripts for rebuild and if present execute it

bugsounet commented 4 months ago

It's not enaugh :)

It's need up to date dependencies (node Abi, nan, electron rebuild,... And cleaned node_modules, and up to date package-lock)

That why i done my own script Take a look to installer folder

sdetweil commented 4 months ago

I cant look all over for different things I can npm install again which does pre/post installs too

bugsounet commented 4 months ago

check this

if "-r" option -> do npm run rebuild

Note: i will deprecate onoff library in next release cycle (24-08-01), so electron rebuild will be not needed

bugsounet commented 4 months ago

in other hand:

You can add this rule for MMM-GoogleAssistant and EXTs

sdetweil commented 3 months ago

@gonzonia i have fixed upgrade as described above.. please give it another try

use force instead of apply, as you already have the latest MM version

Perilax-De commented 3 months ago

I give it a try, but MMM-Pir is still not working anymore.

Here the new log: `pi@smartmirror:~ $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/upgrade-script.sh)" apply update log will be in /home/pi/MagicMirror/installers/upgrade.log doing test run = false Node currently installed. Checking version number. Minimum Node version: v20.9.0 Installed Node version: v20.8.0 installing correct version of node and npm, please wait Check current Node installation ... Node currently installed. Checking version number. Minimum Node version: v20.9.0 Installed Node version: v20.9.0 No Node.js upgrade necessary. Check current NPM installation ... NPM currently installed. Checking version number. Minimum npm version: V10.1.0 Installed npm version: V10.1.0 No npm upgrade necessary.

saving custom.css upgrading from version 2.27.0 to 2.28.0 fetching latest revisions updating MagicMirror runtime, please wait

magicmirror@2.28.0 postinstall npm run install-vendor && npm run install-fonts && echo "MagicMirror² installation finished successfully! "

magicmirror@2.28.0 install-vendor echo "Installing vendor files ... " && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

Installing vendor files ...

changed 1 package in 49s

magicmirror@2.28.0 install-fonts echo "Installing fonts ... " && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier

Installing fonts ...

changed 2 packages in 3s MagicMirror² installation finished successfully!

magicmirror@2.28.0 prepare [ -f node_modules/.bin/husky ] && husky || echo no husky installed.

no husky installed.

added 469 packages in 2m

112 packages are looking for funding run npm fund for details

Checking for modules with removed libraries

updating dependencies for active modules with package.json files

    processing for module MMM-Todoist please wait

    ----------------------------------

npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 50 packages, and audited 51 packages in 6s

3 packages are looking for funding run npm fund for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing a different dependency.

Run npm audit for details.

    processing complete for module MMM-Todoist

    processing for module MMM-Remote-Control please wait

    ----------------------------------

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 50 packages, and audited 51 packages in 6s

12 packages are looking for funding run npm fund for details

found 0 vulnerabilities

    processing complete for module MMM-Remote-Control

    processing for module MMM-Pir please wait

    ----------------------------------

Hinweis: Es wird davon abgeraten zu Pullen, ohne anzugeben, wie mit abweichenden Hinweis: Branches umgegangen werden soll. Sie können diese Nachricht unterdrücken, Hinweis: indem Sie einen der folgenden Befehle ausführen, bevor der nächste Pull Hinweis: ausgeführt wird: Hinweis: Hinweis: git config pull.rebase false # Merge (Standard-Strategie) Hinweis: git config pull.rebase true # Rebase Hinweis: git config pull.ff only # ausschließlich Vorspulen Hinweis: Hinweis: Sie können statt "git config" auch "git config --global" nutzen, um Hinweis: einen Standard für alle Repositories festzulegen. Sie können auch die Hinweis: Option --rebase, --no-rebase oder --ff-only auf der Kommandozeile nutzen, Hinweis: um das konfigurierte Standardverhalten pro Aufruf zu überschreiben. ✔ Rebuild Complete Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] Do you want to continue ? [Y/n] `

sdetweil commented 3 months ago

ok mmm-pir says there is a conflict between local files and repo on github

do this

cd ~/MagicMirror/modules/MMM-Pir
git reset hard head
git pull
npm install 

then restart MagicMirror

Perilax-De commented 3 months ago

Output:

pi@smartmirror:~/MagicMirror/modules/MMM-Pir $ git reset hard head fatal: mehrdeutiges Argument 'hard': unbekannter Commit oder Pfad existiert nicht
im Arbeitsverzeichnis Benutzen Sie '--', um Pfade und Commits zu trennen, ähnlich wie: 'git [...] -- [...]'

Perilax-De commented 3 months ago

Is it important to execute the command:

git config pull.rebase false

in the MMM-Pir directory before starting the update script?

sdetweil commented 3 months ago

no do this

cd ~/MagicMirror/modules/MMM-Pir git reset --hard head git pull npm install

Perilax-De commented 3 months ago

pi@smartmirror:~/MagicMirror/modules/MMM-Pir $ git reset --hard head fatal: mehrdeutiges Argument 'head': unbekannter Commit oder Pfad existiert nicht im Arbeitsverzeichnis Benutzen Sie '--', um Pfade und Commits zu trennen, ähnlich wie: 'git [...] -- [...]'

and if I try: git reset --hard --head

error: Unbekannte Option: `head' Verwendung: git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [] oder: git reset [-q] [] [--] ... oder: git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [] oder: git reset --patch [] [--] [...]

-q, --quiet           weniger Ausgaben, nur Fehler melden
--mixed               HEAD und Index umsetzen
--soft                nur HEAD umsetzen
--hard                HEAD, Index und Arbeitsverzeichnis umsetzen
--merge               HEAD, Index und Arbeitsverzeichnis umsetzen
--keep                HEAD umsetzen, aber lokale Änderungen behalten
--recurse-submodules[=<reset>]
                      control recursive updating of submodules
-p, --patch           Blöcke interaktiv auswählen
-N, --intent-to-add   nur speichern, dass gelöschte Pfade später hinzugefügt werden sollen
--pathspec-from-file <Datei>
                      Pfadspezifikation aus einer Datei lesen
--pathspec-file-nul   Mit der Option --pathspec-from-file sind Pfade durch NUL-Zeichen getrennt
sdetweil commented 3 months ago

dang this thing is SO picky

git reset --hard HEAD

Perilax-De commented 3 months ago

pi@smartmirror:~/MagicMirror/modules/MMM-Pir $ git reset --hard HEAD HEAD ist jetzt bei 1f90ef8 Update README.md

After git pull, npm install and reboot the problem still exists.

sdetweil commented 3 months ago

ok, which problem? the PIR module doesn't work?

did you look at the different operation modes.. the OS requires changes to the settings

Perilax-De commented 3 months ago

Yes the MMM-Pir module is not running after the update. I get no output of the module on my mirror and the screen didn't switch of. Before I'm running the update script the module is running fine.

I‘m running Raspbian 11 Bullseye. In MMM-Pir I‘m using mode: 1 - use vgencmd (For raspbian 10/11) with the entry dtoverlay=vc4-fkms-v3d in /boot/config.txt

sdetweil commented 3 months ago

I don't know.. you'd have to talk to the MMM-Pir author..

Perilax-De commented 3 months ago

Ok. Thanks for your time.

sdetweil commented 1 month ago

I am going to close this as its really a module problem