MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Shutting down/restarting via PM2 not closing server

    Scheduled Pinned Locked Moved Solved Troubleshooting
    2 Posts 1 Posters 1.5k Views 1 Watching
    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.
    • bheplerB Offline
      bhepler Module Developer
      last edited by

      I’m using PM2 to monitor the MagicMirror2 process as per the Autostarting Magic Mirror tutorial. When I make a change and wish to restart the mirror process, I enter pm2 restart mm and let PM2 do its thing. However, when I do so I get the following error:

      Whoops! There was an uncaught exception...
      0|mm       | { Error: listen EADDRINUSE :::8080
      0|mm       |     at Object.exports._errnoException (util.js:1022:11)
      0|mm       |     at exports._exceptionWithHostPort (util.js:1045:20)
      0|mm       |     at Server._listen2 (net.js:1262:14)
      0|mm       |     at listen (net.js:1298:10)
      0|mm       |     at Server.listen (net.js:1376:9)
      0|mm       |     at new Server (/home/pi/MagicMirror/js/server.js:26:9)
      0|mm       |     at /home/pi/MagicMirror/js/app.js:219:18
      0|mm       |     at loadNextModule (/home/pi/MagicMirror/js/app.js:168:5)
      0|mm       |     at /home/pi/MagicMirror/js/app.js:163:6
      0|mm       |     at Class.loaded (/home/pi/MagicMirror/modules/node_modules/node_helper/index.js:19:3)
      0|mm       |   code: 'EADDRINUSE',
      0|mm       |   errno: 'EADDRINUSE',
      0|mm       |   syscall: 'listen',
      0|mm       |   address: '::',
      0|mm       |   port: 8080 }
      

      This normally occurs when you have MM2 running and attempt to start the mirror again. But that’s not the case as far as I can tell. If I use PM2 to stop the MM2 process, netstat -l doesn’t show anything listening on port 8080, but I still get the error above if I start the mirror process.

      This only started after I upgraded to v2.1.2, if that helps. A full reboot will have the mirror start normally. Any ideas?

      1 Reply Last reply Reply Quote 0
      • bheplerB Offline
        bhepler Module Developer
        last edited by

        Update: I’ve traced this to the MMM-RTSPStream module. Disabling this module lets PM2 restart the process normally. I’ll take this problem over there. Feel free to close this out.

        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 Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy