pct exec / lxc-attach intermittently returns 129 (SIGHUP) in Debian 13 containers

ccjd

New Member
Nov 26, 2026
2
0
0
Summary: pct exec / lxc-attach intermittently returns 129 (SIGHUP) in Debian 13 containers when stdin, stdout or stderr is a terminal

Versions (two nodes, same results): pve-manager 9.2.32, pve-container 6.1.24, lxc-pve 7.0.0-2, kernel 7.0.14-30-pve. Containers: Debian 13, unprivileged.

Problem: pct exec <ctid> -- <command> sometimes exits with 129 and no output, although the command itself succeeds. It only happens when at least one of stdin, stdout and stderr is a terminal; with none of them on a terminal it did not happen once. It happens in every container tested on both nodes, and breaks automation (Ansible with a become password, which runs commands on a terminal) at random points.

Reproduce: rename the attached repro.sh.txt to repro.sh and run it on the PVE node as root, from an interactive shell, with a running Debian 13 container:

bash repro.sh <ctid>

The script runs each test 200 times back to back and counts the non-zero exits. stdin and stdout are always redirected; "tty" tests leave stderr on the terminal, "notty" tests redirect it as well:
- tty, pct exec with: install --version, mkdir -p, ls --version, true, chmod, cat --version
- tty, lxc-attach -n <ctid> directly, with install --version
- notty, pct exec and lxc-attach with install --version
- the install --version loop inside the container, started with a single pct exec

Results (CT 222 on one of the nodes):

Started 2026-11-26 08:31:21 UTC: CT 222, 200 runs per test, 10 tests (about 15 minutes; one dot = 20 runs)
tty pct exec install --version .......... 23 of 200 failed
tty pct exec mkdir -p .......... 11 of 200 failed
tty pct exec ls --version .......... 9 of 200 failed
tty pct exec true .......... 0 of 200 failed
tty pct exec chmod .......... 0 of 200 failed
tty pct exec cat --version .......... 1 of 200 failed
tty lxc-attach install --version .......... 5 of 200 failed
notty pct exec install --version .......... 0 of 200 failed
notty lxc-attach install --version .......... 0 of 200 failed
tty install --version inside the CT .......... 0 of 200 failed
Finished 2026-11-26 08:42:06 UTC

The failing runs exit with 129 (checked separately).

Observations:
- Without a terminal on any standard stream, no failure occurred in any test (several hundred runs over several script runs).
- How often it fails depends on the command: install --version fails often, true and chmod never failed in 600+ runs each, cat --version only once per 200. Rates vary between runs (mkdir -p: 1/200 in one run, 11/200 in another), so this looks timing-related rather than tied to a specific command.
- The same command run in a loop inside the container never fails, so the command itself is not the problem.
- lxc-attach directly fails as well, less often than pct exec.
- Under strace -f the failure did not occur in 100 runs, so it is timing-dependent.
- Exit code 129 suggests the attached process gets SIGHUP, presumably related to the pty that is set up when a standard stream is a terminal.

Possibly related: https://forum.proxmox.com/threads/pct-exec-fails-with-code-129.171729/ (apt list returning 129 in Debian 13 CTs; ls worked there as well).
 

Attachments

Follow-up: still reproducible after upgrading the node to pve-manager 9.3.1 / pve-container 6.1.28 (lxc-pve 7.0.0-2 and kernel 7.0.14-30-pve unchanged). Same script, same container:

Started 2026-11-26 09:26:55 UTC: CT 222, 200 runs per test, 10 tests (about 15 minutes; one dot = 20 runs)
tty pct exec install --version .......... 21 of 200 failed
tty pct exec mkdir -p .......... 3 of 200 failed
tty pct exec ls --version .......... 10 of 200 failed
tty pct exec true .......... 0 of 200 failed
tty pct exec chmod .......... 0 of 200 failed
tty pct exec cat --version .......... 0 of 200 failed
tty lxc-attach install --version .......... 4 of 200 failed
notty pct exec install --version .......... 0 of 200 failed
notty lxc-attach install --version .......... 0 of 200 failed
tty install --version inside the CT .......... 0 of 200 failed
Finished 2026-11-26 09:37:58 UTC

Again no failures without a terminal on any standard stream, and failures with only stderr on the terminal.