Bug: Infrastructure agent unable to stop #1012

Closed
opened 2026-04-05 16:24:49 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @sysoppl on 5/8/2024

Describe the bug
Unable to stop agent on linux

To Reproduce
Steps to reproduce the behavior:

  1. Installed agent using curl -s https://xxx/docs/static/scripts/infrastructure-agent/install-linux.sh | bash command
  2. Started agent using oneuptime-infrastructure-agent start --secret-key=1234 --oneuptime-url=https://xxx command
  3. Used oneuptime-infrastructure-agent stop command
  4. See error

Expected behavior
Ability to stop agent

Server:
OS: debian 12 / Linux 6.5.13-1-pve

Deployment Type
self hosted

Additional context

root@s1:~# oneuptime-infrastructure-agent stop
node:internal/process/per_thread:223
      throw new ErrnoException(err, 'kill');
            ^

Error: kill ESRCH
    at process.kill (node:internal/process/per_thread:223:13)
    at Object.handler (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/Index.ts:133:25)
    at /root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:8993
    at j (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:4956)
    at _.handleValidationAndGetResult (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:8962)
    at _.applyMiddlewareAndGetResult (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:9604)
    at _.runCommand (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:7231)
    at [runYargsParserAndExecuteCommands] (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:58539)
    at te.parse (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:40478)
    at te.get [as argv] (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:62028) {
  errno: -3,
  code: 'ESRCH',
  syscall: 'kill'
}

Node.js v22.1.0
*Originally created by @sysoppl on 5/8/2024* **Describe the bug** Unable to stop agent on linux **To Reproduce** Steps to reproduce the behavior: 1. Installed agent using ```curl -s https://xxx/docs/static/scripts/infrastructure-agent/install-linux.sh | bash``` command 2. Started agent using ```oneuptime-infrastructure-agent start --secret-key=1234 --oneuptime-url=https://xxx``` command 3. Used ```oneuptime-infrastructure-agent stop``` command 4. See error **Expected behavior** Ability to stop agent **Server:** OS: debian 12 / Linux 6.5.13-1-pve **Deployment Type** self hosted **Additional context** ``` root@s1:~# oneuptime-infrastructure-agent stop node:internal/process/per_thread:223 throw new ErrnoException(err, 'kill'); ^ Error: kill ESRCH at process.kill (node:internal/process/per_thread:223:13) at Object.handler (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/Index.ts:133:25) at /root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:8993 at j (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:4956) at _.handleValidationAndGetResult (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:8962) at _.applyMiddlewareAndGetResult (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:9604) at _.runCommand (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:7231) at [runYargsParserAndExecuteCommands] (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:58539) at te.parse (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:40478) at te.get [as argv] (/root/.nvm/versions/node/v22.1.0/lib/node_modules/@oneuptime/infrastructure-agent/node_modules/yargs/build/index.cjs:1:62028) { errno: -3, code: 'ESRCH', syscall: 'kill' } Node.js v22.1.0 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#1012