Read the statement by Michael Teeuw here.
Huge number of errors in log fills up HD
-
My board had been working great since last November, until a few weeks ago when it started shutting off randomly and would not stay on.
I checked the logs this morning and there were about 15GB in the MagicMirror-error.log, which had completely filled up the HD. I deleted the log, then installed rotatelog, and figured everything is good.However, a couple hours later I have the same problem: I am seeing a huge amount of log entries happen very fast in the .pm2/logs folder. Note that this is happening even though Magic Mirror is NOT visible on the screen - it’s just the standard Raspberry PI home screen. I’m not sure if MM is still running somewhere. I am running Magic Mirror 2.30.0
Running the command “ps axg” shows a bunch of running processes including several in the MagicMirror folders.
Here’s a sample of the ‘out’ log file while MM was running:
[2025-02-06 18:20:37.636] [34m[INFO] [39m [34mSystem information:[39m
[34m### SYSTEM: manufacturer: ; model: ; virtual: false[39m
[34m### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.62+rpt-rpi-2712[39m
[34m### VERSIONS: electron: undefined; used node: 22.11.0; installed node: 22.11.0; npm: 10.9.0; pm2: 5.4.3[39m
[34m### OTHER: timeZone: America/Chicago; ELECTRON_ENABLE_GPU: undefined[39m
[2025-02-06 18:20:40.042] [LOG] Starting MagicMirror: v2.30.0
[2025-02-06 18:20:40.776] [34m[INFO] [39m [34mSystem information:[39m
[34m### SYSTEM: manufacturer: ; model: ; virtual: false[39m
[34m### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.62+rpt-rpi-2712[39m
[34m### VERSIONS: electron: undefined; used node: 22.11.0; installed node: 22.11.0; npm: 10.9.0; pm2: 5.4.3[39m
[34m### OTHER: timeZone: America/Chicago; ELECTRON_ENABLE_GPU: undefined[39m
[2025-02-06 18:20:43.152] [LOG] Starting MagicMirror: v2.30.0
[2025-02-06 18:20:43.843] [34m[INFO] [39m [34mSystem information:[39m
[34m### SYSTEM: manufacturer: ; model: ; virtual: false[39m
[34m### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.62+rpt-rpi-2712[39m
[34m### VERSIONS: electron: undefined; used node: 22.11.0; installed node: 22.11.0; npm: 10.9.0; pm2: 5.4.3[39m
[34m### OTHER: timeZone: America/Chicago; ELECTRON_ENABLE_GPU: undefined[39m
[2025-02-06 18:20:46.271] [LOG] Starting MagicMirror: v2.30.0
[2025-02-06 18:20:46.983] [34m[INFO] [39m [34mSystem information:[39m
[34m### SYSTEM: manufacturer: ; model: ; virtual: false[39m
[34m### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: arm64; kernel: 6.6.62+rpt-rpi-2712[39m
[34m### VERYou can see how quickly they pile up, every 3 seconds. I’m guessing these will go away when MM starts succesfully.
And here’s the recurring error in the error log - this whole thing also repeats every 3 seconds:
[2025-08-16 18:39:26.567] [31m[ERROR][39m [31mTypeError: Cannot read properties of undefined (reading ‘disableHardwareAcceleration’)[39m
[31m at Object. (/home/cpcode/MagicMirror/js/electron.js:18:6)[39m
[31m at Module._compile (node:internal/modules/cjs/loader:1546:14)[39m
[31m at Object…js (node:internal/modules/cjs/loader:1689:10)[39m
[31m at Module.load (node:internal/modules/cjs/loader:1318:32)[39m
[31m at Function._load (node:internal/modules/cjs/loader:1128:12)[39m
[31m at Object. (/home/cpcode/.config/nvm/versions/node/v22.11.0/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)[39m
[31m at Module._compile (node:internal/modules/cjs/loader:1546:14)[39m
[31m at Object…js (node:internal/modules/cjs/loader:1689:10)[39m
[31m at Module.load (node:internal/modules/cjs/loader:1318:32)[39m
[31m at Function._load (node:internal/modules/cjs/loader:1128:12)[39m
[31m at TracingChannel.traceSync (node:diagnostics_channel:315:14)[39m
[31m at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)[39m
[31m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)[39m
[31m at node:internal/main/run_main_module:36:49[39m
[2025-08-16 18:39:26.568] [31m[ERROR][39m [31mWhoops! There was an uncaught exception…[39m
[2025-08-16 18:39:26.569] [31m[ERROR][39m [31mTypeError: Cannot read properties of undefined (reading ‘disableHardwareAcceleration’)[39m
[31m at Object. (/home/cpcode/MagicMirror/js/electron.js:18:6)[39m
[31m at Module._compile (node:internal/modules/cjs/loader:1546:14)[39m
[31m at Object…js (node:internal/modules/cjs/loader:1689:10)[39m
[31m at Module.load (node:internal/modules/cjs/loader:1318:32)[39m
[31m at Function._load (node:internal/modules/cjs/loader:1128:12)[39m
[31m at Object. (/home/cpcode/.config/nvm/versions/node/v22.11.0/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)[39m
[31m at Module._compile (node:internal/modules/cjs/loader:1546:14)[39m
[31m at Object…js (node:internal/modules/cjs/loader:1689:10)[39m
[31m at Module.load (node:internal/modules/cjs/loader:1318:32)[39m
[31m at Function._load (node:internal/modules/cjs/loader:1128:12)[39m
[31m at TracingChannel.traceSync (node:diagnostics_channel:315:14)[39m
[31m at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)[39m
[31m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)[39m
[31m at node:internal/main/run_main_module:36:49[39m
[2025-08-16 18:39:26.569] [31m[ERROR][39m [31mMagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?[39m
[2025-08-16 18:39:26.569] [31m[ERROR][39m [31mIf you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues[39mThe ‘cannot read properties of undefined’ error seems to point to electron, but I have no idea what could have changed there.
What can I do to further debug or fix this issue? Thanks much. -
@cpcode so, this sounds like possibly 2 problems
-
power supply failing. another user reported similar weird unable to run MagicMirror
-
sd card failure. they do fail quite often
pm2 flush
will clear the logs
but i would investigate both these
if not done recently, backup your MagicMirror config
maybe use my backup script . make sure to get the backup off the MagicMirror disk. -
-
@sdetweil Thanks for the reply - some additional info:
- Magic Mirror works fine when I start it, after clearing the logs (getting more HD space). All modules seem to work properly. Things only start failing catastrophically when the logs fill up the disk completely.
- I tried pm2 flush but it only deleted the log in the /.pm2 folder, it didn’t delete anything in the /.pm2/logs subfolder. This is where all the big logs are. I’ve been deleting those log files manually for now, every few minutes.
- The power seems to work fine when only the PI OS is up and running, and before the HD fills up, but I’ll check on it.
I will look into the SD card, that could definitely be the cause. I will also backup my latest, thank you for the suggestion. Can you think of a way to debug the ‘DisableHardwareAcceleration’ issue somehow?
Thanks again. -
@cpcode said in Huge number of errors in log fills up HD:
Can you think of a way to debug the ‘DisableHardwareAcceleration’
this indicates that there may be disc corruption on the SD card.
weird behaviour usually brings out the worst…
-
@sdetweil Looking into the SD card now, this is my first time with this type of issue. Is there a way to check if the card is corrupted or not? There seem to be some Windows utilities, and maybe some in the PI itself, but I’m not having tons of luck yet.
If it’s corrupted, is the standard practice to start over with a new SD card (reinstall RPI OS, restore MM backups, …), or are there ways to try and fix the existing card before it goes in the garbage? Like maybe reformatting the same card? Seeing as SD cards fail often, I hope there’s a consensus on what is the best course of action.
Thanks again.
-
@cpcode once the SD card fails, there is no recovery… I have lost 10 over the last 7 or 8 years.
far as I know there is no technique to discover the problem. there no write failed error produced , so the software ‘thinks’ all is good, when its not…
so you get random stuff all over the place…
and it only gets worse
-
@sdetweil Well that makes things easier, I’ll buy one or two more cards and start over. Really grateful for your help, this could have taken me way longer.
While I was troubleshooting I saw other threads about backups - I am comfortable backing up Magic Mirror, especially with your script, but is there a solid way to image an entire SD card (RPI and all) so in the future I could just push the image to a new SD? I saw the ‘dd’ command mentioned, but I don’t have another Unix system, just Windows.
-
@cpcode dd/image gets you the same thing
there are image creation tools for windows
-
@cpcode
Once your have your setup completed, to what you want. You can use Win32Diskimager to make a .img file that you can reinstall with balenaetcher or RaspberryPiImager. I went to USB devices or NVMe drives.
I use Sam’s backup mainly to save my config.js and custom.css files so I never loose the main settings to the Current MM I have running. The list of modules helps too.
I also keep a module folder backup BACKUP is so critical if you are using sd cards.