Skip to content

[Bug] update notification noderestart restarts wrong runtime #4154

Closed

Description

@sdetweil

Environment

MagicMirror² version:
Node version:
npm version:
Platform:

Which start option are you using?

node --run start:x11

Are you using PM2?

No

Module

updatenotification

Have you tried disabling other modules?

  • Yes
  • No

Have you searched if someone else has already reported the issue on the forum or in the issues?

  • Yes

What did you do?

Configuration
set updatenotification to restart mm
<!-- Paste relevant code here -->
updateAutorestart: true

Steps to reproduce the issue:

cause a change in some installed 3rd party module

What did you expect to happen?

MM would restart

What actually happened?

mm failed to start, unable to find WAYLAND_DISPLAY env variable.. as I am using x11

Additional comments

updatenotification uses

Spawn("node --run start"  <--- this uses wayland now

but this instance needs

Spawn("node --run start:x11"
or 
Spawn("node --run start:windows"

one could find the previous start command in process list

ps -ef | grep node | grep start
sam      4138959 2915099  0 16:37 pts/1    00:00:00 node --run start:x11

Participation

  • I am willing to submit a pull request for this change.

Activity

  1. sdetweil commented on May 14, 2026

    @sdetweil
    CollaboratorAuthor

    put this in the node_helper.js (using npm run start:x11, or node --run start:x11)

    const { argv } = require('node:process');
    
            start: ()=>{
                    console.log("args=",argv);
            },
    
    
    

    got this

     args= [
      '/home/sam/MagicMirror/node_modules/electron/dist/electron',
      'js/electron.js'
    ]
    
  2. khassel commented on May 14, 2026

    @khassel
    Collaborator

    yes, this is exactly what is executed by node --run start:x11

  3. sdetweil commented on May 14, 2026

    @sdetweil
    CollaboratorAuthor

    yes, but I think that is not what we want to execute

  4. khassel commented on May 15, 2026

    @khassel
    Collaborator

    this is what node --run start:x11 executes under the hood, test it, for me this is the way we should go for the updatenotification problem ...

  5. added a commit that references this issue on May 17, 2026
    4425f52
  6. KristjanESPERANTO commented on May 17, 2026

    @KristjanESPERANTO
    Collaborator

    Should be fixed with #4156 🙂 @sdetweil, can you confirm?

  7. sdetweil commented on May 17, 2026

    @sdetweil
    CollaboratorAuthor

    Will try tomorrow, grandson baseball all day today

  8. sdetweil commented on May 18, 2026

    @sdetweil
    CollaboratorAuthor

    I pulled new dev, did npm install

    I added un to my config like this

     {
            module: "updatenotification",
            position: "top_center",
            order: "*",
            disabled: false,
            hiddenOnStartup: false,
            configDeepMerge: false,
            animateIn: "None",
            animateOut: "None",
            config: {
              updateAutorestart: true,
              updateInterval: 60000
            }
          },
    
    

    and updated my Sample Module to force a change
    https://github.com/sdetweil/SampleModule.git

    
    git remote -v
    origin	https://github.com/sdetweil/SampleModule.git (fetch)
    origin	https://github.com/sdetweil/SampleModule.git (push)
    
    only has master branch
    git branch
    * master
    
    git version 2.42.0
    
    

    and got this (same as #4137)

    [2026-05-18 10:21:07.579] [ERROR] [updatenotification] Failed to get git revisions for SampleModule: Error: Command failed: git rev-list --ancestry-path --count 9a81558..1d0f68d  master
    fatal: ambiguous argument '9a81558..1d0f68d  master': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
    
    
    sam@sams:~/MagicMirror.2.36.dev$ cd modules/SampleModule/
    sam@sams:~/MagicMirror.2.36.dev/modules/SampleModule$ git rev-list --ancestry-path --count 9a81558..1d0f68d  master
    1
    sam@sams:~/MagicMirror.2.36.dev/modules/SampleModule$ git status
    On branch master
    Your branch is up to date with 'origin/master'.
    
    nothing to commit, working tree clean
    
    sam@sams:~/MagicMirror.2.36.dev/modules/SampleModule$ git remote -v
    origin	https://github.com/sdetweil/SampleModule.git (fetch)
    origin	https://github.com/sdetweil/SampleModule.git (push)
    sam@sams:~/MagicMirror.2.36.dev/modules/SampleModule$ 
    

    note the MM folder name

    ~/MagicMirror.2.36.dev
    
  9. KristjanESPERANTO commented on May 18, 2026

    @KristjanESPERANTO
    Collaborator

    ~/MagicMirror.2.36.dev

    That's a little confusing. Why does the folder have an old version number? Both fixes are in v2.37.0-develop.

  10. khassel commented on May 18, 2026

    @khassel
    Collaborator

    I pulled new dev

    and you really switched to it? Looks like you are still on master ...

  11. sdetweil commented on May 18, 2026

    @sdetweil
    CollaboratorAuthor

    folder name was a residual, MM instance from MagicMirror org.. not my fork..

    ok, dumb, didn't switch.. weird..

  12. sdetweil commented on May 18, 2026

    @sdetweil
    CollaboratorAuthor

    now I get (after module update )

    [2026-05-18 14:46:29.193] [ERROR] [app] Whoops! There was an uncaught exception...
    [2026-05-18 14:46:29.193] [ERROR] [app] TypeError: Cannot read properties of undefined (reading 'disableHardwareAcceleration')
        at Object.<anonymous> (/home/sam/MagicMirror.2.36.dev/js/electron.js:18:6)
        at Module._compile (node:internal/modules/cjs/loader:1705:14)
        at Object..js (node:internal/modules/cjs/loader:1838:10)
        at Module.load (node:internal/modules/cjs/loader:1441:32)
        at Function._load (node:internal/modules/cjs/loader:1263:12)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
        at node:internal/main/run_main_module:36:49
    [2026-05-18 14:46:29.193] [ERROR] [app] MagicMirror² will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    [2026-05-18 14:46:29.193] [ERROR] [app] If you think this really is an issue, please open an issue on GitHub: https://github.com/MagicMirrorOrg/MagicMirror/issues
    [2026-05-18 14:46:29.444] [INFO]  [systeminformation] 
    ####  System Information  ####
    - SYSTEM:   manufacturer: System manufacturer; model: System Product Name; virtual: false; MM: v2.37.0-develop
    - OS:       platform: linux; distro: Ubuntu; release: 22.04.5 LTS; arch: x64; kernel: 5.15.0-177-generic
    - VERSIONS: electron: undefined; used node: 22.22.1; installed node: 22.22.1; npm: 10.9.4; pm2: 5.4.3
    - ENV:      XDG_SESSION_TYPE: x11; MM_CONFIG_FILE: undefined
                WAYLAND_DISPLAY:  undefined; DISPLAY: :0.0; ELECTRON_ENABLE_GPU: undefined
    - RAM:      total: 48076.70 MB; free: 39581.88 MB; used: 8494.82 MB
    - OTHERS:   uptime: 11104 minutes; timeZone: America/Chicago
    

    and the error was fatal

  13. sdetweil commented on May 18, 2026

    @sdetweil
    CollaboratorAuthor

    module was updated
    here is the updatenotification module config

          {
            module: "updatenotification",
            position: "top_center",
            order: "*",
            disabled: false,
            hiddenOnStartup: false,
            configDeepMerge: false,
            animateIn: "None",
            animateOut: "None",
            config: {
              updateAutorestart: true,
              updateInterval: 60000,
              updates: [
                { 'SampleModule':'git pull'}
              ]     
            }
          },
    
  14. added a commit that references this issue on May 20, 2026
    1b540ae
  15. KristjanESPERANTO commented on May 20, 2026

    @KristjanESPERANTO
    Collaborator

    @sdetweil #4163 got merged. Please check again :-)

  16. sdetweil commented on May 20, 2026

    @sdetweil
    CollaboratorAuthor

    ok, when mm is started with npm run start:x11, and a monitored module change is detected.. MM restarts correctly..
    (altho the console connection it lost and users will have to ps and kill as appropriate)

  17. KristjanESPERANTO commented on May 20, 2026

    @KristjanESPERANTO
    Collaborator

    Thanks for testing, @sdetweil! 🙂

  18. sdetweil commented on May 23, 2026

    @sdetweil
    CollaboratorAuthor

    restart when launched with pm2 works too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions