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.

    Electron Crashing after update to 2.21.0 with PM2

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    10 Posts 2 Posters 1.8k 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.
    • P Offline
      pattanner92
      last edited by

      After updating my MagicMirror to version 2.21.0 it seems that Electron is crashing when using PM2 with the following error at crash (from pm2 logs):

      0|mm  | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGTERM
      

      After the restart there seems to be a large number of errors thrown, though with a repeating pattern of the following:

      0|mm       | [30696:1006/101030.900201:ERROR:angle_platform_impl.cc(43)] renderergl_utils.cpp:2519 (CheckError): GL call functions->texStorage2D(ToGLenum(type), static_cast<GLsizei>(levels), texStorageFormat.internalFormat, size.width, size.height) generated error 0x00000505 in ../../third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp, setStorage:1052.
      0|mm       | [30696:1006/101030.901706:ERROR:shared_context_state.cc(811)] SharedContextState context lost via Skia OOM.
      0|mm       | [30696:1006/101030.903252:ERROR:gpu_service_impl.cc(990)] Exiting GPU process because some drivers can't recover from errors. GPU process will restart shortly.
      0|mm       | [19587:1006/101030.932806:ERROR:command_buffer_proxy_impl.cc(329)] GPU state invalid after WaitForGetOffsetInRange.
      0|mm       | [19587:1006/101030.940181:ERROR:gpu_process_host.cc(974)] GPU process exited unexpectedly: exit_code=8704
      0|mm       | MESA-LOADER: failed to retrieve device information
      0|mm       | MESA-LOADER: failed to retrieve device information
      0|mm       | MESA-LOADER: failed to retrieve device information
      

      Now, if I run MagicMirror by using npm start while in the ~/MagicMirror directory, it seems to stay up. Hoping someone has some insight on this. I can easily manually start the system, but would rather not have to every time.

      S 2 Replies Last reply Reply Quote 1
      • S Offline
        sdetweil @pattanner92
        last edited by

        @pattanner92 how did you upgrade? manual or use my automated scripts?

        which os is this?

        show outout of

        uname -a
        lsb_release -a
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @pattanner92 also add

          export ELECTRON_DISABLE_GPU=1

          to the installers/mm.sh before the
          npm start line

          or wherever the mm comes from (in the pm2 logs output)
          my setup script use the mm.sh in the installers folder

          Sam

          How to add modules

          learning how to use browser developers window for css changes

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

            @sdetweil
            Output of first command is:

            Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux
            

            Output of second command is:

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

            I did so a manual upgrade. Though I typically do that without running into too many issues.

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

              @sdetweil
              Still seems to crash. This is how I have configured my pm2 start script:

              cd ~/MagicMirror
              export ELECTRON_DISABLE_GPU=1
              DISPLAY=:0 npm start
              
              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @pattanner92
                last edited by

                @pattanner92 sorry two more

                node -v
                npm-v

                u are running on 32 bit buster, which is ok
                on some armv7l device, pi3, 4, or pi0w2

                Sam

                How to add modules

                learning how to use browser developers window for css changes

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

                  @sdetweil
                  node v16.16.0
                  npm v8.11.0

                  I am running on a Raspberry Pi B3+

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

                    @pattanner92 can u try running my upgrade script with force instead of apply

                    see
                    https://github.com/sdetweil/MagicMirror_scripts

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

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

                      @sdetweil
                      EDIT: I was digging while cleaning up pm2 so it didn’t display my old script. I noticed that the mm.sh script in ~/MagicMirror/installers was indeed missing export ELECTRON_DISABLE_GPU=1. Adding that back to the script seems to keep it stable. Still wondering if this is an Electron version issue.

                      No dice. Here are the errors I am seeing in the logs - I pulled only the errors to see if I caught them all. Here is what I am seeing at the exit event:

                      0|mm  | [25978:1009/112505.776458:ERROR:zygote_communication_linux.cc(275)] Failed to send GetTerminationStatus message to zygote
                      0|mm  | [25978:1009/112505.812741:ERROR:zygote_communication_linux.cc(275)] Failed to send GetTerminationStatus message to zygote
                      0|mm  | [25978:1009/112505.848727:ERROR:network_service_instance_impl.cc(470)] Network service crashed, restarting service.
                      0|mm  | [25978:1009/112505.880738:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=1002
                      0|mm  | [25978:1009/112505.897587:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=1002
                      0|mm  | [25978:1009/112505.917812:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=1002
                      0|mm  | [25978:1009/112505.942511:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=1002
                      0|mm  | [25978:1009/112505.959337:ERROR:gpu_process_host.cc(968)] GPU process launch failed: error_code=1002
                      

                      And later in the restart process I saw these errors:

                      0|mm  | [09.10.2022 11:25.36.393] [ERROR] 
                      0|mm  | (node:26362) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
                      0|mm  | (Use `electron --trace-deprecation ...` to show where the warning was created)
                      

                      I did go in and check for the line export ELECTRON_DISABLE_GPU=1 in the startup script mm.sh and it is there. I did have two startup scripts (one that was created before your script was a a thing) and made sure it was there in both as I wasn’t sure which pm2 was using. The original is out in the home folder - I made a backup and then ran your pm2 setup script. While it seemed to reconfigure pm2 to use the script in ~/MagicMirror/installers it still crashes. Figured I would try that in case something was walking over itself.

                      Could this be an Electron version issue?

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

                        @pattanner92 the buffer thing is a warning, but not our code. nothing we can do

                        the gpu errors are concerning, because u have gpu use turned off.

                        do u know what driver is being used in /boot/config.txt, like this

                        dtoverlay=vc4-fkms-v3d
                        

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        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