MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

MM2.10 & Pi3b - run-start.sh issue? (Exit status 7, errno 7, error code ELIFECYCLE)



  • Chaps,

    After an uneventful (but lucky?) fresh install of MM2.10 plus adding some modules (Network-Connection, RSTPStream, Darksky Weather) everything worked nicely.
    Remote access via WinSCP was working fine at any time as well.
    Changes to any files are done using Notepad++.

    However, several hours later trying to get the screensaver disabled (and no, I did not change the master autostart above the pi-folder structure, but in the pi-subdirectory structure), MM doesn’t start properly anymore.
    Very long fetch times of data, resizing of the video stream does not occur anymore, etc.

    Behaviour:

    1. The pi is constantly shown on the router (access through WiFi).
    2. MM can be accessed after a pi reboot as usual - it works perfectly.
      But after starting MM by using ‘npm start’ in the MagicMirror folder and closing MM using CTRL-Q, it does not allow
      me to access the Pi anymore. No login possible (‘Trying to connect to host’ … runs into the timeout)
    3. Observation: Gathering data for the modules seem to slow down considerably when MM tries starting the
      MMM-NetworkConnection module which requires the speedtest done. Looking at this very module and resinstalling
      it with ‘npm install’ in the respective module folder, did not change the behaviour.

    The npm log shows the following:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'start' ]
    2 info using npm@6.13.4
    3 info using node@v10.15.2
    4 verbose run-script [ 'prestart', 'start', 'poststart' ]
    5 info lifecycle magicmirror@2.10.0~prestart: magicmirror@2.10.0
    6 info lifecycle magicmirror@2.10.0~start: magicmirror@2.10.0
    7 verbose lifecycle magicmirror@2.10.0~start: unsafe-perm in lifecycle true
    8 verbose lifecycle magicmirror@2.10.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirror/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
    9 verbose lifecycle magicmirror@2.10.0~start: CWD: /home/pi/MagicMirror
    10 silly lifecycle magicmirror@2.10.0~start: Args: [ '-c', './run-start.sh' ]
    11 silly lifecycle magicmirror@2.10.0~start: Returned: code: 7  signal: null
    12 info lifecycle magicmirror@2.10.0~start: Failed to exec start script
    13 verbose stack Error: magicmirror@2.10.0 start: `./run-start.sh`
    13 verbose stack Exit status 7
    13 verbose stack     at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    13 verbose stack     at EventEmitter.emit (events.js:189:13)
    13 verbose stack     at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack     at ChildProcess.emit (events.js:189:13)
    13 verbose stack     at maybeClose (internal/child_process.js:970:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    14 verbose pkgid magicmirror@2.10.0
    15 verbose cwd /home/pi/MagicMirror
    16 verbose Linux 4.19.75-v7+
    17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "start"
    18 verbose node v10.15.2
    19 verbose npm  v6.13.4
    20 error code ELIFECYCLE
    21 error errno 7
    22 error magicmirror@2.10.0 start: `./run-start.sh`
    22 error Exit status 7
    23 error Failed at the magicmirror@2.10.0 start script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 7, true ]
    

    I tried t figure it out on my own and researched a lot of similar ELIFECYCLE issues in this forum and outside (but never with an error# 7), but I am not able get it right - most probably 'cause I am a Newbie in Linux …

    While I do have a clean MM2.10-without-modules image I can resinstall, I would like to know what I did wrong (if indeed I did).
    Can anybody please give me a hint, where to look at?

    Best
    XR



  • @sdetweil, you are correct.
    I determined that the MMM-RTSPStream module is causing the problem for sure, by cross testing the two modules.

    Am doing a new install of this as an update install via npm install in the appropriate module folder did not make it work again.

    • re removing the screensaver/blank screen, do you know how to fix this as well?

    Thank you for your help!

    Best XR



  • @xray2607 said in MM2.10 & Pi3b - run-start.sh issue? (Exit status 7, errno 7, error code ELIFECYCLE):

    However, several hours later trying to get the screensaver disabled

    I’m gonna ask some questions… did u try the automated install or manual, as automated asks it u want screensaver off and then does it.

    I updated the run-start.sh script in 2.10 to do some additional work…

    can u change line 1 of runstart.sh to

    #!/bin/bash
    

    to

    #!/bin/bash -x
    

    and then do npm start from the MagicMirror folder, you might see

    > ./run-start.sh
    
    + ./untrack-css.sh
    + '[' -z '' ']'
    + export DISPLAY=:0
    + DISPLAY=:0
    ++ uname -m
    + arch=aarch64
    + false=false
    ++ grep -v '^\s//' config/config.js
    ++ grep -i serveronly:
    ++ tr -d ',"'\'''
    ++ awk '{print tolower($2)}'
    + serveronly=
    + serveronly=false
    ++ pgrep Xorg
    + xorg=5557
    ++ uname
    + mac=Linux
    + '[' false. '!=' false. -o aarch64 == armv6l ']'
    + '[' 5557. == . -a Linux '!=' Darwin ']'
    + electron js/electron.js
    

    please post your results

    also, can u show me the output of
    uname -a
    and
    lsb_release -a

    thx



  • Many thanks, Sam!

    Will do first thing in the morning.

    XR



  • @sdetweil, did the inputs you recommended.

    Following output after changing the run-start.sh file:

    > magicmirror@2.10.0 start /home/pi/MagicMirror
    > ./run-start.sh
    
    + ./untrack-css.sh
    + '[' -z :0.0 ']'
    ++ uname -m
    + arch=armv7l
    + false=false
    ++ grep -v '^\s//' config/config.js
    ++ grep -i serveronly:
    ++ awk '{print tolower($2)}'
    ++ tr -d ',"'\'''
    + serveronly=
    + serveronly=false
    ++ pgrep Xorg
    + xorg=484
    ++ uname
    + mac=Linux
    + '[' false. '!=' false. -o armv7l == armv6l ']'
    + '[' 484. == . -a Linux '!=' Darwin ']'
    + electron js/electron.js
    [06:29:21.444] [LOG]    Starting MagicMirror: v2.10.0
    [06:29:21.459] [LOG]    Loading config ...
    [06:29:21.470] [LOG]    Loading module helpers ...
    [06:29:21.593] [LOG]    Initializing new module helper ...
    [06:29:21.594] [LOG]    Module helper loaded: updatenotification
    [06:29:21.597] [LOG]    No helper found for module: clock.
    [06:29:22.784] [LOG]    Initializing new module helper ...
    [06:29:22.785] [LOG]    Module helper loaded: calendar
    [06:29:22.989] [LOG]    Initializing new module helper ...
    [06:29:22.990] [LOG]    Module helper loaded: MMM-Fuel
    [06:29:23.274] [LOG]    Initializing new module helper ...
    [06:29:23.275] [LOG]    Module helper loaded: MMM-NetworkConnection
    [06:29:24.444] [LOG]    Initializing new module helper ...
    [06:29:24.445] [LOG]    Module helper loaded: MMM-DarkSkyForecast
    [06:29:26.327] [LOG]    Initializing new module helper ...
    [06:29:26.328] [LOG]    Module helper loaded: MMM-RTSPStream
    [06:29:26.415] [LOG]    Initializing new module helper ...
    [06:29:26.416] [LOG]    Module helper loaded: newsfeed
    [06:29:26.417] [LOG]    All module helpers loaded.
    [06:29:26.418] [LOG]    Starting server on port 8080 ... 
    [06:29:26.445] [LOG]    Server started ...
    [06:29:26.447] [LOG]    Connecting socket for: updatenotification
    [06:29:26.448] [LOG]    Connecting socket for: calendar
    [06:29:26.450] [LOG]    Starting node helper for: calendar
    [06:29:26.451] [LOG]    Connecting socket for: MMM-Fuel
    [06:29:26.452] [LOG]    Starting module helper: MMM-Fuel
    [06:29:26.454] [LOG]    Connecting socket for: MMM-NetworkConnection
    [06:29:26.455] [LOG]    MMM-NetworkConnection helper started ...
    [06:29:26.456] [LOG]    Connecting socket for: MMM-DarkSkyForecast
    [06:29:26.457] [LOG]    ====================== Starting node_helper for module [MMM-DarkSkyForecast]
    [06:29:26.459] [LOG]    Connecting socket for: MMM-RTSPStream
    [06:29:26.463] [LOG]    PM2: Stopping all OMXPlayer Streams...
    [06:29:26.468] [LOG]    Connecting socket for: newsfeed
    [06:29:26.470] [LOG]    Starting module: newsfeed
    [06:29:26.470] [LOG]    Sockets connected & modules started ...
    [06:29:27.165] [LOG]    Launching application.
    [06:29:31.793] [LOG]    Create new calendar fetcher for url: https://calendar.google.com/calendar/ical/removed-for-privacy-reasons>
    [06:29:32.245] [LOG]    Create new news fetcher for url: first-feed - Interval: 300000
    [06:29:32.335] [LOG]    Create new news fetcher for url: second-feed - Interval: 300000
    [06:29:32.340] [LOG]    Create new news fetcher for url: third-feed - Interval: 300000
    [06:29:33.717] [LOG]    starting network connection testing
    [06:29:34.289] [LOG]    Starting stream stream1 using VLC with args --width 600 --height 340 -I dummy --video-on-top --no-video-deco --no-embedded-video --video-title=stream1 rtsp://admin:removed-for-privacy-reasons@192.168.1.41:554/11...
    [06:29:34.383] [INFO]   DP2: Running window resizers...
    [06:29:36.398] [LOG]    Whoops! There was an uncaught exception...
    [06:29:36.399] [ERROR]  TypeError: Cannot convert undefined or null to object
        at Function.keys ()
        at stopProcs (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:469:32)
        at pm2.list (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:498:17)
        at /home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2/lib/API.js:606:19
        at /home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2-axon-rpc/lib/client.js:45:10
        at Parser. (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/pm2-axon/lib/sockets/req.js:67:8)
        at Parser.emit (events.js:182:13)
        at Parser._write (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_modules/amp/lib/stream.js:91:16)
        at doWrite (_stream_writable.js:410:12)
        at writeOrBuffer (_stream_writable.js:394:5)
    [06:29:36.408] [LOG]    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    [06:29:36.409] [LOG]    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    [06:29:41.434] [INFO]   DP2: Running window resizers...
    [06:30:33.602] [LOG]    starting network connection testing
    [06:31:05.984] [LOG]    Whoops! There was an uncaught exception...
    [06:31:05.985] [ERROR]  { Error: connect EHOSTUNREACH 151.101.2.219:80
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
      errno: 'EHOSTUNREACH',
      code: 'EHOSTUNREACH',
      syscall: 'connect',
      address: '151.101.2.219',
      port: 80 }
    [06:31:05.991] [LOG]    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    [06:31:05.992] [LOG]    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    [06:31:20.713] [LOG]    Shutting down server...
    [06:31:20.715] [LOG]    Stopping module helper: updatenotification
    [06:31:20.716] [LOG]    Stopping module helper: calendar
    [06:31:20.717] [LOG]    Stopping module helper: MMM-Fuel
    [06:31:20.718] [LOG]    Stopping module helper: MMM-NetworkConnection
    [06:31:20.719] [LOG]    Stopping module helper: MMM-DarkSkyForecast
    [06:31:20.721] [LOG]    Shutting down MMM-RTSPStream streams that were using vlc
    [06:31:20.722] [LOG]    Killing DevilsPie2...
    [06:31:20.727] [LOG]    Killing All VLC Streams...
    [06:31:20.729] [LOG]    Stopping module helper: newsfeed
    

    Output on command ‘uname -a’:

    Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux
    

    Output on command 'lsb_release -a:

    No LSB modules are available.
    Distributor ID:	Raspbian
    Description:	Raspbian GNU/Linux 10 (buster)
    Release:	10
    Codename:	buster
    

    Any data I removed above from the output of the start script do not interfere with the problem.
    The modules in question, RTSPStream+Calendar+Newsfeed work perfectly with the data I omitted.

    Many thanks again, Sam, for looking into this.

    Post note: Can the issue really be the EHOSTUNREACH ?
    I have not removed the MMM-NetworkConnection module from the config.js file. Yet.

    Best
    XR



  • … and no, I did the manual install.

    XR


  • Module Developer

    @xray2607 The error log rather hints to your streaming module being the issue

    [06:29:36.399] [ERROR]  TypeError: Cannot convert undefined or null to object
        at Function.keys ()
        at stopProcs (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:469:32)
        at pm2.list (/home/pi/MagicMirror/modules/MMM-RTSPStream/node_helper.js:498:17)
    

    Have you tried deactivating that one and restarting the mirror?
    Maybe there’s a problem with both modules disturbing each other for some reason?



  • @lavolp3
    I will have to check that in the evening, as I have not yet disabled any of the modules.

    • The mirror was restarted around 40 times over the last 48h (complete reboot as well as disconnecting the PSU for 30min or so).
    • Did a couple of ‘npm start dev’ sessions as well. (but I only have limited understanding of what I am seeing in the dev window)
    • Individually reinstalled a couple of the modules.
    • Did ‘npm audit’ and ‘npm audit fix’ (0 vulnerabilities), plus ‘npm install’ in the MagicMirror folder (again, no problems)

    I am struggling with the fact that everything worked fine up to one point, and without me doing anything it stops working smoothly.
    If I did anything wrong, I would like to understand the why/how in order to avoid it in the future.

    Going to post my findings here.

    XR



  • @xray2607 said in MM2.10 & Pi3b - run-start.sh issue? (Exit status 7, errno 7, error code ELIFECYCLE):

    … and no, I did the manual install.

    ok, before changing anything else.

    the manual update (git pull & npm install) leaves out a crucial step… if any of the modules need dependencies,then THEY ALSO need an npm install cycle done in their folders…

    so, look thru all the module folders, if any contain a package.json file, then run npm install in each folder that does

    please do check and update as required

    i see both MMM-RTSPStream and MMM-NetworkConnection have that file…
    MMM-RTSPStream is the module to put out the message right before the error… so… its likely that is the problem



  • @sdetweil, thanks for your swift reply, will do.



  • @sdetweil, you are correct.
    I determined that the MMM-RTSPStream module is causing the problem for sure, by cross testing the two modules.

    Am doing a new install of this as an update install via npm install in the appropriate module folder did not make it work again.

    • re removing the screensaver/blank screen, do you know how to fix this as well?

    Thank you for your help!

    Best XR


Log in to reply