Error while installing the triggercmdagent
-
Hello,
because of a stupid mistake i had to reinstall my raspberry pi.I used these instructions: https://docs.triggercmd.com/#/./InstallRaspberryPi
But if i try to install with
sudo apt install ./triggercmdagent_1.0.1_all.deb
i get the follogwing errors:Get:1 /home/hannibal/downloads/triggercmdagent_1.0.1_all.deb triggercmdagent all 1.0.1 [22.2 MB] (Reading database ... 91248 files and directories currently installed.) Preparing to unpack .../triggercmdagent_1.0.1_all.deb ... Unpacking triggercmdagent (1.0.1) ... dpkg-deb (subprocess): decompressing archive '/home/hannibal/downloads/triggercmdagent_1.0.1_all.deb' (size=22246140) member 'data.tar': lzma error: compressed data is corrupt dpkg-deb: error: <decompress> subprocess returned error exit status 2 dpkg: error processing archive /home/hannibal/downloads/triggercmdagent_1.0.1_all.deb (--unpack): cannot copy extracted data for './usr/share/triggercmdagent/app/src/node.exe' to '/usr/share/triggercmdagent/app/src/node.exe.dpkg-new': unexpected end of file or stream Errors were encountered while processing: /home/hannibal/downloads/triggercmdagent_1.0.1_all.deb Notice: Download is performed unsandboxed as root as file '/home/hannibal/downloads/triggercmdagent_1.0.1_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) Error: Sub-process /usr/bin/dpkg returned an error code (1)If i read that right the installation file is corrupted, so i tried several times to download the file, but the error is the same every time.
So either the file is corrupted or i am doing something wrong, anyone any idea how what to do?
I hope this is all ok to read, english is not my strong side.
Greetings Hannibal
-
@Hannibal, thank you for reporting it! I tested it and ran into the same problem at first, but it's fixed now. Please download it again and try the install again.
-
@Russ It seems there is more:
hannibal@PI-3:~/downloads $ sudo apt install ./triggercmdagent_1.0.1_all.deb Note, selecting 'triggercmdagent' instead of './triggercmdagent_1.0.1_all.deb' Installing: triggercmdagent Summary: Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0 Download size: 0 B / 22.2 MB Space needed: 0 B / 25.8 GB available Get:1 /home/hannibal/downloads/triggercmdagent_1.0.1_all.deb triggercmdagent all 1.0.1 [22.2 MB] Selecting previously unselected package triggercmdagent. (Reading database ... 73934 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) ... Installing dependenencies from NPM npm warn config production Use `--omit=dev` instead. npm warn Unknown cli config "--unsafe-perm". This will stop working in the next major version of npm. npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated har-validator@5.1.5: this library is no longer supported npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated posix-argv-parser@2.0.0: No longer maintained added 266 packages, and audited 267 packages in 29s 7 packages are looking for funding run `npm fund` for details 14 vulnerabilities (9 moderate, 3 high, 2 critical) To address issues that do not require attention, run: npm audit fix To address all issues possible (including breaking changes), run: npm audit fix --force Some issues need review, and may require choosing a different dependency. Run `npm audit` for details. Notice: Download is performed unsandboxed as root as file '/home/hannibal/downloads/triggercmdagent_1.0.1_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)As you can see, the installation was not succesfull.
And i am again in over my head
-
@Hannibal said in Error while installing the triggercmdagent:
Notice: Download is performed unsandboxed as root as file '/home/hannibal/downloads/triggercmdagent_1.0.1_all.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
Copy/paste that into ChatGPT to know why, but you can safely ignore that "Notice". Basically it means the _apt user doesn't have access to your user's home directory where the .deb file is, so it's using root to access it instead.
It looks like the agent is installed now, so you can move on to the next steps:
triggercmdagent ( Paste in your token, and press ENTER. ) ( Press CTRL-C to quit. ) /usr/share/triggercmdagent/app/src/installdaemon.shThe triggercmdagent command should prompt you for a token which you can copy/paste from the Instructions page while logged in at https://www.triggercmd.com
-
@Russ Sorry, was away for a few weeks.
I tried again today, but there is a new problem if i try to use the following:
node /usr/lib/triggercmdagent/resources/app/src/agent.js --console node:internal/modules/cjs/loader:1520 throw err; ^ Error: Cannot find module '/usr/lib/triggercmdagent/resources/app/src/agent.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1517:15) at wrapResolveFilename (node:internal/modules/cjs/loader:1071:27) at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1095:10) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1122:12) at Module._load (node:internal/modules/cjs/loader:1294:5) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5) at node:internal/main/run_main_module:33:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v24.18.0So i looked into the folder, and it does not exist. edit(The whole folder)
So i thought i did not install the agent and tried to install again withsudo apt install ./triggercmdagent_1.0.1_all.deb Note, selecting 'triggercmdagent' instead of './triggercmdagent_1.0.1_all.deb' triggercmdagent is already the newest version (1.0.1). Summary: Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0So it is installed and it is not installed?
Any other idea what could be the problem?
Greetings
Hannibal -
@Hannibal, I see the problem. I told you /usr/lib/triggercmdagent which is the path on Ubuntu, not Raspberry Pi. Sorry about that. I corrected the "next steps" above to match the instructions here.
It should look like this when you run the triggercmdagent command as root:
pi@fe5978dee0e5:~$ sudo su - root@fe5978dee0e5:~# triggercmdagent Run installdaemon.sh to install the triggercmdagent daemon so it runs during boot Daemon install: false No token exists. Login to request one. prompt: token:Then run this to install the background agent that will startup as root during boot:
/usr/share/triggercmdagent/app/src/installdaemon.shThen edit /root/.TRIGGERcmdData/commands.json and make sure your commands have ground = background.