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.

    How to upgrade a Linux "server" with minimal modules?

    Scheduled Pinned Locked Moved General Discussion
    29 Posts 2 Posters 83 Views 2 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.
    • E Offline
      ember1205 @sdetweil
      last edited by

      @sdetweil Yep.

      The only thing is puts on the screen of any potential interest is

      [ -f node_modules/.bin/husky ] && husky || echo no husky installed
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @ember1205
        last edited by

        @ember1205 what MM version is this?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          ember1205 @sdetweil
          last edited by

          @sdetweil I reverted back again (Leap 15.6)

          I recall seeing a 36 or something somewhere if that helps.

          I had even moved the MM folder off and tried starting again, re-installed npm 22 and 24, and the errors were exactly the same. Something is out-of-whack somewhere and I haven’t had the time to dig deep enough to understand if it’s MM, my linux machine, or a combo.

          I’m considering trying a fresh Leap 16 build and seeing what happens. If that works without an issue, then at least I know “it’s possible.”

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

            @ember1205 mm version is in package.json

            2.35/2.36
            all custom.css stuff moved to config folder (user managed files go here)
            default modules moved from modules/default to defaultmodules

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            E 1 Reply Last reply Reply Quote 0
            • E Offline
              ember1205 @sdetweil
              last edited by

              @sdetweil As mentioned, I reverted… back to whatever I was previously running.

              Working on a fresh Leap 16 install, fresh MM install. Running into problems with inability to connect to display (running serveronly, no display connected). Seems that the serverOnly config setting may not get used any more? I have to start the server with “node --run server” to get past the display errors.

              BTW… fresh install, there is no ‘default’ directory under modules… Thoughts?

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

                @ember1205 said:

                BTW… fresh install, there is no ‘default’ directory under modules… Thoughts?

                default modules moved from modules/default to MagicMirror/defaultmodules

                “server”: “node ./serveronly”

                looks like a bug in 2.36 , fixed in 2.37-develop

                3 more weeks til 2.37

                you could get develop branch
                https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current-problems-with-next-release-code

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                E 1 Reply Last reply Reply Quote 0
                • E Offline
                  ember1205 @sdetweil
                  last edited by

                  @sdetweil The bug may have been around for a while… my mm.sh script is launching the mirror via “npm run server” and that script is what pm2 uses to launch the mirror. I’ve been doing it that way for a long time, likely because the serverOnly config setting wasn’t working.

                  If I actively run “npm run server” and then do “ps aux |grep node” I do not see anything related to node18 in the process list.

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

                    @ember1205 said:

                    likely because the serverOnly config setting wasn’t working.

                    the serverOnly config only works with my run-start.sh script,
                    and was removed from the sample config.js a good while back.

                    for the node 18 thing,
                    if you disable the extra modules (make a new config.js, or use the sample, and use the env variable

                    export MM_CONFIG_FILE=config/filename
                    

                    to test

                    do you ses the same message?

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    E 1 Reply Last reply Reply Quote 0
                    • E Offline
                      ember1205 @sdetweil
                      last edited by

                      @sdetweil I don’t believe it’s the modules.

                      Leap 16 fresh install is fine with a fresh MM install as well. I upgraded the server again from Leap 15 to Leap16. Before the upgrade, I removed node and npm modules linked to version 18 and MM was running fine in all mannners.

                      After the upgrade, I made a couple of system-level changes (like disabling the firewall that it forces on you) and added the node/npm modules for version 24 and wasn’t able to start the mirror with pm2 like normal… it continues to throw errors about node18 being missing. However, running the mm.sh script manually or launching the mirror via either npm start server or node --run server works fine.

                      Did more digging around and found that the issue lies solely in the hands of pm2… the back-end environment was created back in the node/npm 18 days and that was saved in the configuration. The only way to find it was to do a “pm2 dump” and scan the file.

                      Once I knew it was pm2 for sure, the actual fix was pretty simple:

                      pm2 save
                      npm install pm2 -g
                      pm2 update
                      pm2 unstartup
                      pm2 startup
                      

                      If MM wasn’t still configured as a process…

                      cd ~
                      pm2 start mm.sh
                      pm2 save
                      

                      I’m running on Leap 16, latest patches, node/npm 18 is uninstalled, mirror is properly auto-launching. Now, I can update the modules and the mirror… But not before I do a snapshot! lol

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

                        @ember1205 awesome info!! Thanks for the update

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        E 1 Reply Last reply Reply Quote 0
                        • E Offline
                          ember1205 @sdetweil
                          last edited by

                          @sdetweil

                          Do any of your scripts check for pm2 and update the version during any installs or upgrades? Seems like, for the latter at least, that would be helpful.

                          My original mirror was obviously built quite a long time ago as the node18 variable was linked to the startup process. No idea how many MM revisions I went through between then and now and was always running on the much older version of node no matter what I did to upgrade the main system.

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

                            @ember1205 the upgrade script does

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            E 1 Reply Last reply Reply Quote 0
                            • E Offline
                              ember1205 @sdetweil
                              last edited by

                              @sdetweil

                              I don’t see anything in the script to do the pm2 save or a “pm2 start mm --udpate-env” so that it would use the new version of node. Not sure if your script is already gracefully handling those kinds of updates for the MM startup.

                              Also, since the script seems to assume Debian-based distro’s, dpkg doesn’t execute on my system and I’m not entirely sure if the script would effectively update my system for me. Thoughts on that?

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

                                @ember1205 it is Debian based for sure.

                                Doesn’t work in lxc’s, or other container types, docker

                                The upgrade-script, starting on line 496 is the code for pm2 upgrade

                                That was also extracted to upgradepm2.sh
                                If you wanted to do it separately

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

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

                                  Sorry, you were talking about refreshing the application defs on pm2.

                                  No, dont do that, never seen any side effect til now

                                  Will add it to the work list here
                                  https://github.com/sdetweil/MagicMirror_scripts/issues/125

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

                                  1 Reply Last reply Reply Quote 0

                                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                  With your input, this post could be even better 💗

                                  Register Login
                                  • 1
                                  • 2
                                  • 2 / 2
                                  • 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