TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Raspberry Pi install failed

    Scheduled Pinned Locked Moved Raspberry Pi
    11 Posts 3 Posters 3.0k 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.
    • A Offline
      Antonio36996
      last edited by

      I get this errors while trying to install triggercmdagent in my raspberry pi zero (no wifi version, running with eth cable), I have installed everything you said in last posts, npm, nodejs... Everything. Tried rebooting, reinstalling npm, nodejs, triggedcmdagent... and everything gets to the same point.
      Thanks.

      pi@raspberrypi:~ $ sudo apt-get upgrade
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      Calculating upgrade... Done
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Do you want to continue? [Y/n] y
      Setting up triggercmdagent (1.0.1) ...
      Directory 'node_modules' exists. Running 'npm rebuild'
      dpkg: error processing package triggercmdagent (--configure):
      installed triggercmdagent package post-installation script subprocess returned error exit status 1
      Errors were encountered while processing:
      triggercmdagent
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      RussR 1 Reply Last reply Reply Quote 0
      • RussR Offline
        Russ @Antonio36996
        last edited by Russ

        @Antonio36996, can you send me the output of this command?

        dpkg -i triggercmdagent_1.0.1_all.deb
        

        Also, please try an uninstall and re-install like this:

        systemctl stop triggercmdagent
        /usr/share/triggercmdagent/app/src/removedaemon.sh
        apt remove triggercmdagent
        dpkg -i triggercmdagent_1.0.1_all.deb
        triggercmdagent
        (CTRL-C)
        /usr/share/triggercmdagent/app/src/installdaemon.sh
        

        I tried a fresh install using setup.bat with this method and it worked.

        I also tried installing using the original method after a fresh Raspbian install and that worked for me too.

        EDIT: Another idea - please try this and let me know what you see.

        cd /usr/share/triggercmdagent/app
        npm install
        

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • A Offline
          Antonio36996
          last edited by

          This is the output, thanks

          sudo dpkg -i triggercmdagent_1.0.1_all.deb
          (Reading database ... 51918 files and directories currently installed.)
          Preparing to unpack triggercmdagent_1.0.1_all.deb ...
          Unpacking triggercmdagent (1.0.1) over (1.0.1) ...
          Setting up triggercmdagent (1.0.1) ...
          Directory 'node_modules' exists. Running 'npm rebuild'
          dpkg: error processing package triggercmdagent (--install):
          installed triggercmdagent package post-installation script subprocess returned error exit status 1
          Errors were encountered while processing:
          triggercmdagent
          pi@raspberrypi:~ $ cd /usr/share/triggercmdagent/app
          pi@raspberrypi:/usr/share/triggercmdagent/app $ npm install
          pi@raspberrypi:/usr/share/triggercmdagent/app $ cd ~
          pi@raspberrypi:~ $ sudo dpkg -i triggercmdagent_1.0.1_all.deb
          (Reading database ... 51918 files and directories currently installed.)
          Preparing to unpack triggercmdagent_1.0.1_all.deb ...
          Unpacking triggercmdagent (1.0.1) over (1.0.1) ...
          Setting up triggercmdagent (1.0.1) ...
          Directory 'node_modules' exists. Running 'npm rebuild'
          dpkg: error processing package triggercmdagent (--install):
          installed triggercmdagent package post-installation script subprocess returned error exit status 1
          Errors were encountered while processing:
          triggercmdagent
          pi@raspberrypi:~ $ sudo systemctl stop triggercmdagent
          Failed to stop triggercmdagent.service: Unit triggercmdagent.service not loaded.
          pi@raspberrypi:~ $ sudo /usr/share/triggercmdagent/app/src/removedaemon.sh
          Failed to stop triggercmdagent.service: Unit triggercmdagent.service not loaded.
          pi@raspberrypi:~ $ sudo apt remove triggercmdagent
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          The following packages will be REMOVED:
          triggercmdagent
          0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
          1 not fully installed or removed.
          After this operation, 0 B of additional disk space will be used.
          Do you want to continue? [Y/n] y
          (Reading database ... 51918 files and directories currently installed.)
          Removing triggercmdagent (1.0.1) ...
          pi@raspberrypi:~ $ sudo dpkg -i triggercmdagent_1.0.1_all.deb
          Selecting previously unselected package triggercmdagent.
          (Reading database ... 49379 files and directories currently installed.)
          Preparing to unpack triggercmdagent_1.0.1_all.deb ...
          Unpacking triggercmdagent (1.0.1) ...
          Setting up triggercmdagent (1.0.1) ...
          Directory 'node_modules' exists. Running 'npm rebuild'
          dpkg: error processing package triggercmdagent (--install):
          installed triggercmdagent package post-installation script subprocess returned error exit status 1
          Errors were encountered while processing:
          triggercmdagent
          pi@raspberrypi:~ $ triggercmdagent
          pi@raspberrypi:~ $ sudo /usr/share/triggercmdagent/app/src/installdaemon.sh
          cp: cannot create regular file '/root/.TRIGGERcmdData/triggercmdagent.service': No such file or directory
          /usr/share/triggercmdagent/app/src/daemonmgr.sh: 10: /usr/share/triggercmdagent/ app/src/daemonmgr.sh: cannot create /root/.TRIGGERcmdData/triggercmdagent.servic e: Directory nonexistent
          /usr/share/triggercmdagent/app/src/daemonmgr.sh: 11: /usr/share/triggercmdagent/ app/src/daemonmgr.sh: cannot create /root/.TRIGGERcmdData/triggercmdagent.servic e: Directory nonexistent
          cp: cannot stat '/root/.TRIGGERcmdData/triggercmdagent.service': No such file or directory
          Failed to start triggercmdagent.service: Unit triggercmdagent.service not found.
          Failed to enable unit: Unit file triggercmdagent.service does not exist.
          Unit triggercmdagent.service could not be found.
          pi@raspberrypi:~ $

          RussR 1 Reply Last reply Reply Quote 0
          • RussR Offline
            Russ @Antonio36996
            last edited by Russ

            @Antonio36996, something went wrong with the installation. This could be tricky to fix. I noticed this command didn't even give you any output. Not even an error:

            pi@raspberrypi:/usr/share/triggercmdagent/app $ npm install

            I also noticed you're doing all of this as the pi user. The instructions have you switch to the root user with sudo su -

            I recommend trying those steps again as root, and add this command after the apt remove command:

            rm -rf /usr/share/triggercmdagent
            

            If that doesn't work, I recommend starting over with a fresh Raspbian installation. The new method using setup.bat is the easiest, but it assumes you're using a Windows computer. It also installs the agent for you.

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            • A Offline
              Antonio36996
              last edited by

              @Russ Thanks for answering, I can't reinstall raspbian again because I have other services like pihole, pivpn...
              At the beginning I could execute triggercmdagent and asked me to enter the token, however as the apt upgrade still being saying that wasn't successful I reinstalled it, and since that didn't work.
              This is my output using su

              pi@raspberrypi:~ $ sudo su -
              root@raspberrypi:~# apt remove triggercmdagent

              Reading package lists... Done

              Building dependency tree

              Reading state information... Done

              The following packages will be REMOVED:

              triggercmdagent

              0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.

              1 not fully installed or removed.

              After this operation, 0 B of additional disk space will be used.

              Do you want to continue? [Y/n] y

              (Reading database ... 51918 files and directories currently installed.)

              Removing triggercmdagent (1.0.1) ...

              root@raspberrypi:~# rm -rf /usr/share/triggercmdagent

              root@raspberrypi:~# dpkg -i triggercmdagent_1.0.1_all.deb

              Selecting previously unselected package triggercmdagent.

              (Reading database ... 49379 files and directories currently installed.)

              Preparing to unpack triggercmdagent_1.0.1_all.deb ...

              Unpacking triggercmdagent (1.0.1) ...

              Setting up triggercmdagent (1.0.1) ...

              Directory 'node_modules' exists. Running 'npm rebuild'

              dpkg: error processing package triggercmdagent (--install):

              installed triggercmdagent package post-installation script subprocess returned error exit status 1

              Errors were encountered while processing:

              triggercmdagent

              root@raspberrypi:~# triggercmdagent

              root@raspberrypi:~# /usr/share/triggercmdagent/app/src/installdaemon.sh

              cp: cannot create regular file '/root/.TRIGGERcmdData/triggercmdagent.service': No such file or directory

              /usr/share/triggercmdagent/app/src/daemonmgr.sh: 10: /usr/share/triggercmdagent/ app/src/daemonmgr.sh: cannot create /root/.TRIGGERcmdData/triggercmdagent.servic e: Directory nonexistent

              /usr/share/triggercmdagent/app/src/daemonmgr.sh: 11: /usr/share/triggercmdagent/ app/src/daemonmgr.sh: cannot create /root/.TRIGGERcmdData/triggercmdagent.servic e: Directory nonexistent

              cp: cannot stat '/root/.TRIGGERcmdData/triggercmdagent.service': No such file or directory

              Failed to start triggercmdagent.service: Unit triggercmdagent.service not found.

              Failed to enable unit: Unit file triggercmdagent.service does not exist.

              Unit triggercmdagent.service could not be found.

              root@raspberrypi:~# apt-get -y install npm nodejs

              Reading package lists... Done

              Building dependency tree

              Reading state information... Done

              nodejs is already the newest version (10.19.0~dfsg1-1).

              npm is already the newest version (5.8.0+ds6-4).

              0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

              1 not fully installed or removed.

              After this operation, 0 B of additional disk space will be used.

              Setting up triggercmdagent (1.0.1) ...

              Directory 'node_modules' exists. Running 'npm rebuild'

              dpkg: error processing package triggercmdagent (--configure):

              installed triggercmdagent package post-installation script subprocess returned error exit status 1

              Errors were encountered while processing:

              triggercmdagent

              E: Sub-process /usr/bin/dpkg returned an error code (1)

              root@raspberrypi:~#

              RussR 1 Reply Last reply Reply Quote 0
              • RussR Offline
                Russ @Antonio36996
                last edited by

                @Antonio36996, I'm sorry about this trouble. Unfortunately the output isn't giving my much info to go on. Here's another idea you could try:

                sudo su -
                apt remove triggercmdagent
                rm -rf /usr/share/triggercmdagent/app
                mkdir /usr/share/triggercmdagent/app
                cd /usr/share/triggercmdagent/app
                git clone https://github.com/rvmey/TRIGGERcmd-Agent.git
                /usr/share/triggercmdagent/app/src/installdaemon.sh
                

                Russell VanderMey

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  Antonio36996 @Russ
                  last edited by

                  @Russ Does not work, thank you anyways!

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Antonio36996
                    last edited by

                    Finnaly I solved it!!! As I was getting errors since I started, I decided to install node, which broke my nodejs installation, I found the answer here.
                    I removed the package node and everything went perfect! Thank you so much!

                    RussR 1 Reply Last reply Reply Quote 0
                    • RussR Offline
                      Russ @Antonio36996
                      last edited by

                      @Antonio36996, nice job! I'm glad you got it working.

                      Russell VanderMey

                      1 Reply Last reply Reply Quote 0
                      • Radosław SzałkowskiR Offline
                        Radosław Szałkowski
                        last edited by

                        @Russ I have a problem and I don't know what I'm doing wrong - I always have your default configuration file. I even tried to remove and install.

                        root@raspberrypi:/home/pi# triggercmdagent
                        Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot
                        Daemon install: false
                        Logging in with saved token.
                        Checking if the 5fb03d4f355bc6001903ba40 computer exists.
                        This computer was deleted from your account.  Login to recreate it.
                        prompt: token:  mytoken
                        Token saved for next time.
                        Tokenfile: /root/.TRIGGERcmdData/token.tkn
                        ComputerIDfile: /root/.TRIGGERcmdData/computerid.cfg
                        Logging in with saved token to run foreground tasks.
                        Computer ID 5fb0406efe27220019319bad saved for next time.
                        Write backup completed.
                        
                        
                          |>    Now connected to https://www.triggercmd.com.
                        \___/   For help, see: http://bit.ly/2q0QDpf
                                (using sails.io.js node SDK @v1.1.13)
                                 Connected at: Sat Nov 14 2020 20:39:12 GMT+0000 (Greenwich Mean Time)
                        
                        
                        
                        Initiated command removals
                        Initiated command adds
                        { message: 'Subscribed to 5fb0406efe27220019319bad!' }
                        { message: 'Subscribed to 5fb0406efe27220019319bad!' }
                        Added Gnome Editor
                        ^C
                        root@raspberrypi:/home/pi# nano /root/.TRIGGERcmdData/commands.json
                        root@raspberrypi:/home/pi# nano /root/.TRIGGERcmdData/commands.json
                        root@raspberrypi:/home/pi# /usr/share/triggercmdagent/app/src/installdaemon.sh
                        Daemon install: true
                        Logging in with saved token.
                        Checking if the 5fb0406efe27220019319bad computer exists.
                        This computer exists in your account.
                        ● triggercmdagent.service - TRIGGERcmd Agent
                           Loaded: loaded (/etc/systemd/system/triggercmdagent.service; enabled; vendor preset: enabled)
                           Active: active (running) since Sat 2020-11-14 20:42:06 GMT; 1s ago
                         Main PID: 11693 (node)
                            Tasks: 6 (limit: 2063)
                           CGroup: /system.slice/triggercmdagent.service
                                   └─11693 node /usr/share/triggercmdagent/app/src/daemon.js --run /root/.TRIGGERcmdData
                        
                        Nov 14 20:42:06 raspberrypi systemd[1]: Started TRIGGERcmd Agent.```
                        
                        Maybe you have any idea? Thanks!
                        RussR 1 Reply Last reply Reply Quote 0
                        • RussR Offline
                          Russ @Radosław Szałkowski
                          last edited by

                          @Radosław-Szałkowski, from that output it looks like the background service installation worked.

                          Can you show me the output of this command?

                          systemctl status triggercmdagent
                          

                          Russell VanderMey

                          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
                          • First post
                            Last post