Termix icon indicating copy to clipboard operation
Termix copied to clipboard

Plugin sandbox supervisor mass-restarts the entire plugin fleet every ~30–90s on 26.11.2, with occasional full backend crash (EPIPE)

Open smargasy opened this issue 2 weeks ago • 6 comments

What happened?

Environment

  • Termix version: 26.11.2 (ghcr.io/termix-ssh/termix:latest, image digest 5edc6426038b)
  • Deployment: Docker (single container, docker run/compose)
  • Host: 15.6 GiB RAM, no memory/CPU limit set on the container
  • Started from a clean restart, confirmed low resource usage throughout (see below)

Summary

Since upgrading to 26.11.2 (the first release where every plugin runs in its own sandboxed process), the plugin supervisor periodically declares every running plugin simultaneously unresponsive ("stopped answering, restarting it"), SIGKILLs all of them, and restarts the whole fleet. This happens on a roughly 30–90 second cadence that doesn't correlate with any specific plugin, plugin count, or resource pressure. Separately, this cascade sometimes triggers an unhandled EPIPE error that crashes the entire Termix backend process, requiring the container's own supervisor to restart Node from scratch.

This makes the UI intermittently unusable: open SSH terminal sessions get dropped ("WebSocket pong timeout - terminating zombie connection"), the frontend shows "Server connection lost, recovering...", and UI panels briefly render empty mid-cascade.

Steps to reproduce

  1. Run Termix 26.11.2 in Docker with the default/full plugin set enabled.
  2. Leave it idle, or use it normally (an open SSH terminal tab is enough).
  3. Watch docker logs -f <container> — within roughly 30–90 seconds of any backend start/restart, every mounted plugin logs stopped answering, restarting it within the same second, followed by exited (SIGKILL) for all of them, then a full remount cycle.
  4. Repeat indefinitely — it recurs on its own cadence as long as the container runs.

Evidence it's not resource exhaustion

At the time of a cascade: CONTAINER CPU % MEM USAGE/LIMIT MEM % termix 9.75% 752.3MiB / 15.62GiB 4.70%

No memory/CPU limit is set on the container (Memory limit: 0 bytes, CPU limit: 0 nanocpus), host has 7.1 GiB available, no swap in use, and dmesg shows no OOM kills around the crash times.

Evidence it's not a specific plugin

Tested by disabling host-metrics alone (no change — cascade continued on the same cadence), then by uninstalling 13 plugins (automations, fleets, homepage, network-topology, proxmox, secret-sources, serial, session-recording, session-sharing, sso, sync, tailscale, tmux-monitor, web-endpoint), going from 34 plugins down to 21. The mass-restart cascade recurred within ~38 seconds of the next boot completing, with the same "every plugin at once" signature. Which specific plugin fails to activate within the 30s timeout also varies run to run (ai in one boot, sync in another) — it isn't tied to one plugin's code.

Representative log excerpt (mass cascade)

[10:52:40 PM] [WARN] [🧩] Plugin credential-tools: stopped answering, restarting it [op:plugin_sandbox] [10:52:40 PM] [WARN] [🧩] Plugin ssh-terminal: stopped answering, restarting it [op:plugin_sandbox] [10:52:40 PM] [WARN] [🧩] Plugin docker: stopped answering, restarting it [op:plugin_sandbox] ... (all 18+ active plugins, same timestamp) ... [10:52:40 PM] [ERROR] [🧩] Plugin ai: did not start: Plugin ai did not activate within 30000 ms [op:plugin_sandbox] [10:52:40 PM] [WARN] [🧩] Plugin docker: exited (SIGKILL) [op:plugin_sandbox] ... (all plugins SIGKILLed at the same timestamp) ...

Representative log excerpt (full backend crash)

node:events:505 throw er; // Unhandled 'error' event ^

Error: write EPIPE at target._send (node:internal/child_process:932:20) at target.send (node:internal/child_process:805:19) at ChildProcess. (file:///app/dist/backend/backend/plugins/sandbox/launcher/main.js:189:35) ... Emitted 'error' event on ChildProcess instance at: at node:internal/child_process:936:39 ... { errno: -32, code: 'EPIPE', syscall: 'write' }

Node.js v26.13.1 Setting up user permissions (PUID: 1000, PGID: 1000)... ...

This crashes the whole Node process (not just a plugin sandbox); the container's entrypoint script detects the exit and restarts the entire backend, re-loading and re-activating all plugins from scratch (~27–80 seconds downtime per occurrence).

Also seen on every boot (possibly related, possibly separate)

host-metrics consistently logs this on each restart, independent of the cascade: [ERROR] [🧩] Initial metrics polling failed {"operation":"initial_metrics_poll_unhandled","hostId":X}: ctx.hosts.probeTargets needs an acting user [op:plugin:host-metrics]

Filing this for visibility in case it's related to the supervisor's internal scheduling/health-check path, but per the test above, disabling host-metrics entirely did not stop the mass-restart cascade, so I believe it's a distinct issue.

Expected behavior

Plugin processes should be health-checked and restarted individually on failure, not as a mass simultaneous event across the whole fleet, and a plugin sandbox error should never be able to crash the core backend process via an unhandled EPIPE.

Impact

Dropped SSH terminal sessions, intermittently empty UI panels ("Server connection lost, recovering..."), and periodic full-backend outages of 30–80s. This affects a stock install with no unusual configuration.

Steps to reproduce

  1. Run Termix 26.11.2 in Docker with the default/full plugin set enabled.
  2. Leave it idle, or use it normally (an open SSH terminal tab is enough).
  3. Watch docker logs -f <container> — within roughly 30–90 seconds of any backend start/restart, every mounted plugin logs stopped answering, restarting it within the same second, followed by exited (SIGKILL) for all of them, then a full remount cycle.
  4. Repeat indefinitely — it recurs on its own cadence as long as the container runs.

What did you expect?

Filing this for visibility in case it's related to the supervisor's internal scheduling/health-check path, but per the test above, disabling host-metrics entirely did not stop the mass-restart cascade, so I believe it's a distinct issue.

Expected behavior

Plugin processes should be health-checked and restarted individually on failure, not as a mass simultaneous event across the whole fleet, and a plugin sandbox error should never be able to crash the core backend process via an unhandled EPIPE.

Impact

Dropped SSH terminal sessions, intermittently empty UI panels ("Server connection lost, recovering..."), and periodic full-backend outages of 30–80s. This affects a stock install with no unusual configuration.

Termix version

26.11.2

Platform

Web browser

Server install

Docker

Environment

No response

Logs


Anything else?

No response

Before you submit

  • [x] I searched open and closed issues and this is not a duplicate
  • [x] I am on the latest version, or I said which version I am on

smargasy avatar Nov 18 '26 23:11 smargasy

Auto-triage

The plugin sandbox supervisor in Termix 26.11.2 incorrectly mass-restarts all plugins simultaneously due to a health check loop, and an unhandled EPIPE error during restart crashes the entire backend process.

Field Value
Type Bug
Difficulty 3/5 (Moderate)
Priority High

A maintainer will take a look. If anything above looks wrong, just say so.

termix-triage-bot[bot] avatar Nov 18 '26 23:11 termix-triage-bot[bot]

Thanks for the detailed report, it made this much easier to track down. Two fixes are coming in 26.11.3 which will get deployed soon.

  • The full crash: when plugins got restarted, Termix kept sending them messages for a moment after they stopped. The first failed send was handled, the second one wasn't, and that took the whole server down. That's the EPIPE in your log. It's fixed now.
  • The restarts: when almost every plugin goes quiet at the same moment, it's Termix itself that was busy, not all the plugins hanging. It used to restart all of them anyway, which made things worse and kept the loop going. Now it waits it out and logs one line. A single stuck plugin still gets restarted.

The host-metrics "needs an acting user" error is fixed in Host Metrics 1.4.2.

If it still happens on 26.11.3, please send the log from the 30 seconds before the line "plugins stopped answering at once" so I can see what's keeping it busy.

LukeGus avatar Nov 19 '26 01:11 LukeGus

This was fixed in v26.11.3. Update Termix to the latest version to get it. Thanks for the report!

termix-triage-bot[bot] avatar Nov 21 '26 13:11 termix-triage-bot[bot]

Seems still an issue

SiriosDev avatar Nov 22 '26 11:11 SiriosDev

Reopening, since @SiriosDev says this still happens. A maintainer will take another look.

termix-triage-bot[bot] avatar Nov 22 '26 11:11 termix-triage-bot[bot]

This was fixed in v26.12.0. Update Termix to the latest version to get it. Thanks for the report!

termix-triage-bot[bot] avatar Dec 02 '26 02:12 termix-triage-bot[bot]