MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED pm2 restarts magicmirror every few seconds

    Troubleshooting
    3
    6
    1564
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      panos last edited by

      Hello.
      I fresh install Magicmirror on raspbian buster.
      when I reboot the system to see if everything work like it should I notice that magicmirror does not start at all.
      pm2 shows this:
      0_1565094216661_Screenshot 2019-08-06 at 15.19.17.png

      Id is constantly changing and restart count is increasing.
      It seems that magicmirror is trying to start but for some reason, can’t
      Any suggestions?

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @panos last edited by

        @panos do

        pm2 logs
        

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • P
          panos last edited by

          PM2            | App [MagicMirror:0] exited with code [1] via signal [SIGINT]
          PM2            | App [MagicMirror:0] starting in -fork mode-
          PM2            | App [MagicMirror:0] online
          0|MagicMirror  | { Error: ENOENT: no such file or directory, open 'package.json'
          0|MagicMirror  |     at Object.openSync (fs.js:443:3)
          0|MagicMirror  |     at Object.readFileSync (fs.js:343:35)
          0|MagicMirror  |     at Object.<anonymous> (/home/pi/MagicMirror/js/app.js:15:32)
          0|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:778:30)
          0|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
          0|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:653:32)
          0|MagicMirror  |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
          0|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
          0|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:692:17)
          0|MagicMirror  |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:37)
          0|MagicMirror  |   errno: -2,
          0|MagicMirror  |   syscall: 'open',
          0|MagicMirror  |   code: 'ENOENT',
          0|MagicMirror  |   path: 'package.json' }
          PM2            | App [MagicMirror:0] exited with code [1] via signal [SIGINT]
          PM2            | App [MagicMirror:0] starting in -fork mode-
          PM2            | App [MagicMirror:0] online
          
          
          0|MagicMirror  | { Error: ENOENT: no such file or directory, open 'package.json'
          0|MagicMirror  |     at Object.openSync (fs.js:443:3)
          0|MagicMirror  |     at Object.readFileSync (fs.js:343:35)
          0|MagicMirror  |     at Object.<anonymous> (/home/pi/MagicMirror/js/app.js:15:32)
          0|MagicMirror  |     at Module._compile (internal/modules/cjs/loader.js:778:30)
          0|MagicMirror  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
          0|MagicMirror  |     at Module.load (internal/modules/cjs/loader.js:653:32)
          0|MagicMirror  |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
          0|MagicMirror  |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
          0|MagicMirror  |     at Module.require (internal/modules/cjs/loader.js:692:17)
          0|MagicMirror  |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:37)
          0|MagicMirror  |   errno: -2,
          0|MagicMirror  |   syscall: 'open',
          0|MagicMirror  |   code: 'ENOENT',
          0|MagicMirror  |   path: 'package.json' }
          
          1 Reply Last reply Reply Quote 0
          • bhepler
            bhepler Project Sponsor last edited by

            PM2 is restarting the mirror because the mirror process keeps crashing. Let’s try a rebuild. Try this:

            pm2 stop all
            cd /home/pi/MagicMirror
            npm install
            pm2 start 0
            
            1 Reply Last reply Reply Quote 0
            • P
              panos last edited by panos

              I tried this with no luck:(
              The issue persists…

              -EDIT-
              I manage to resolve the issue:

              • pm2 delete MagicMirror
              • pm2 start /home/pi/MagicMirror/installers/mm.sh
              • pm2 save

              pm2 process name is now ‘mm’ instead of ‘MagicMirror’
              so
              “pm2 start|stop|restart mm” is now the command that I will use
              Thanks for your help!!
              Cheers:)

              S 1 Reply Last reply Reply Quote 1
              • S
                sdetweil @panos last edited by sdetweil

                @panos yes, when doing install, it uses a config file which supplies a title. It’s in the installers folder

                Sam

                Create a working config
                How to add modules

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy