signalk-container 1.25.1 → 1.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -61,6 +61,14 @@ Every managed container, one-shot job container, and job label carries a **names
61
61
  - The **label keys** are namespaced too (`<ns>-charts-job`, `<ns>-job-owner`, `<ns>-job-label`, `<ns>-requested-resources`), so a dev instance's reap query doesn't even _list_ production's jobs. The name-prefix guard in `orphanFromContainer` (`name.startsWith(jobPrefix())`) remains the unspoofable-by-label trait — and being namespaced, it can never match a foreign-namespace helper.
62
62
  - The devcontainer sets `SIGNALK_CONTAINER_NAMESPACE=devpod` (in the installer repo's `dev/dev.sh`), so its containers are `devpod-<name>`. Note the prefix isolates **names and reaping**, not host **ports** — a consumer plugin that publishes a fixed host port still collides port-wise with its production twin; that is handled separately (pick non-colliding ports for dev).
63
63
 
64
+ ### nofile ulimits: rootless podman < 5.5.0 drops the API request
65
+
66
+ Rootless podman below 5.5.0 silently ignores `HostConfig.Ulimits` on the docker-compat create endpoint (containers/podman#25881, fixed by #25908) — verified live on 5.4.2: the created container inherits the **podman service's** limits and inspect echoes those effective values back as `RLIMIT_NOFILE`, not the request. Three consequences baked into the code:
67
+
68
+ - `readContainerNofile` treats the inspect echo as "asked" and `/proc/<pid>/limits` as "live"; on broken podman the two sources agree on the effective value, so the probe stays truthful even though the request was dropped.
69
+ - The `ensureRunning` nofile regrant bounds recreates two ways: against the previous create's _ask_ (daemon-capped Docker, where re-asking can't help) **and** against a per-observed-limit attempt map (`nofileRegrantAttempts`) — required because on broken podman the echo is not the ask, so the ask-bound alone cannot detect a failed attempt. Never remove either bound in isolation.
70
+ - The integration canary `src/test/integration/nofileProbe.test.ts` asserts probe-vs-/proc agreement and stopped-echo consistency on every runtime, and pins the requested value only where the runtime honors the API request (docker, podman ≥ 5.5.0).
71
+
64
72
  ### Podman SELinux flag
65
73
 
66
74
  `volumeArg(hostPath, containerPath, runtime)` adds `:Z` for podman bind mounts (Fedora/RHEL SELinux relabel). Named volumes — host strings without a leading `/` or `.` — MUST NOT receive `:Z`; podman rejects them with `"invalid option z for named volume"`. Always go through `volumeArg`, never build `-v host:container[:flags]` strings inline.
package/README.md CHANGED
@@ -324,13 +324,29 @@ sudo systemctl daemon-reload
324
324
  The new limit only applies once the **user manager itself restarts** — and
325
325
  `daemon-reload` does **not** restart an already-running `user@<uid>.service`.
326
326
  On a headless boat the SK user has linger enabled (`loginctl enable-linger`),
327
- so logging out and back in does not tear it down. Force a fresh user manager,
328
- then restart the container:
327
+ so logging out and back in does not tear it down. Force a fresh user manager:
329
328
 
330
329
  ```bash
331
330
  sudo systemctl restart user@$(id -u <sk-user>).service # or just reboot
332
331
  ```
333
332
 
333
+ Note that restarting the **container** is not enough on its own: a restart
334
+ re-applies the nofile value stored when the container was created, so a
335
+ container created under the old ceiling keeps the lower limit. Since
336
+ signalk-container 1.25.3 this resolves itself — on the next Signal K start,
337
+ `ensureRunning` compares the limit the container actually runs with against
338
+ what the host can now grant and recreates the container to apply the raise.
339
+ On older versions, remove the container (`podman rm -f sk-<name>`) so the
340
+ next plugin start recreates it with the raised limit.
341
+
342
+ > **Rootless Podman < 5.5.0**: the docker-compat API silently drops the
343
+ > ulimit request at container create
344
+ > ([containers/podman#25881](https://github.com/containers/podman/issues/25881),
345
+ > fixed in 5.5.0) — containers instead **inherit the podman service's own
346
+ > limits**. The user-manager drop-in above is then not just the ceiling but
347
+ > the actual source of the container's limit, and the recreate described
348
+ > above is what picks it up.
349
+
334
350
  **2. System-wide default (Raspberry Pi OS / openplotter, and the reliable
335
351
  fallback).** Stock Debian / Pi OS ships `/etc/systemd/system.conf` with a
336
352
  commented `#DefaultLimitNOFILE=1024:524288` — that 524288 _hard_ default is
@@ -785,6 +801,7 @@ See [doc/plugin-developer-guide.md](doc/plugin-developer-guide.md) for the full
785
801
  | `stop(name)` | Stop a running container |
786
802
  | `remove(name)` | Stop and remove a container |
787
803
  | `getState(name)` | Returns `running`, `stopped`, `missing`, or `no-runtime` |
804
+ | `getContainerNofile(name)` | Read the `nofile` limits the container actually runs with (live `/proc` probe, falling back to the create-time inspect echo); `null` = unknown. Use it to verify a reported ulimit clamp against reality (1.25.3+) |
788
805
  | `runJob(config)` | Execute a one-shot container job. Pass `config.signal` (an `AbortSignal`) to cancel a job mid-run — aborting force-removes the container and resolves with status `cancelled` (1.16.0+) |
789
806
  | `cleanupOrphanedJobs(filter)` | Reap this namespace's job containers (`<ns>-job-*`, `sk-job-*` by default) leaked by a previous server lifecycle, filtered by the caller's `ownerPluginId`. Idempotent — returns `{ reaped: OrphanJobInfo[] }` so the plugin can roll back any per-job state it had written |
790
807
  | `getLogs(name, options?)` | One-shot fetch of the last N lines of a container's combined stdout+stderr log. `tail` defaults to 200, max 10000; `since` is unix-epoch seconds |
@@ -1,8 +1,8 @@
1
1
  import type Docker from "dockerode";
2
- import { ContainerConfig, ContainerInfo, ContainerRuntimeInfo, ContainerState, DeviceIssue, EnsureRunningOptions, LocalImageSummary, ManagedImageRef, PruneResult, UlimitClamp, VolumeIssue, VolumeSpec } from "./types.js";
2
+ import { ContainerConfig, ContainerInfo, ContainerRuntimeInfo, ContainerState, DeviceIssue, EnsureRunningOptions, LocalImageSummary, ManagedImageRef, NofileLimits, PruneResult, UlimitClamp, VolumeIssue, VolumeSpec } from "./types.js";
3
3
  import { StreamingProcessHandle } from "./runtime.js";
4
4
  import { type ContainerClient } from "./client.js";
5
- import type { ErrorKind } from "./errors.js";
5
+ import { type ErrorKind } from "./errors.js";
6
6
  import { type DeviceNodeSpec } from "./devices.js";
7
7
  export declare function prefixedName(name: string): string;
8
8
  /**
@@ -527,6 +527,27 @@ export declare function diffContainerConfig(requested: ContainerConfig, live: Li
527
527
  * unclamped, preserving today's behaviour on those platforms.
528
528
  */
529
529
  export declare function readNofileHardCeiling(runtime: ContainerRuntimeInfo): number | null;
530
+ /**
531
+ * Parse the `Max open files` row out of a `/proc/<pid>/limits` file:
532
+ * `Max open files <soft> <hard> files`. Returns null on any shape
533
+ * surprise — callers treat null as "unknown", never as a limit.
534
+ */
535
+ export declare function parseProcLimitsNofile(content: string): NofileLimits | null;
536
+ export declare function _setProcLimitsReaderForTesting(fn: ((path: string) => string) | null): void;
537
+ export declare function _setNofileCeilingForTesting(fn: ((runtime: ContainerRuntimeInfo) => number | null) | null): void;
538
+ /**
539
+ * Read the nofile limits a managed container is ACTUALLY running with —
540
+ * as opposed to the value that was requested when it was created.
541
+ *
542
+ * Primary source is the live `/proc/<container-pid>/limits`; where that
543
+ * is not readable (containerized Signal K, rootful runtimes), fall back
544
+ * to the create-time request echoed through inspect, which the runtime
545
+ * applied verbatim or refused, so it equals the live value whenever it
546
+ * is present. Null means "unknown": no such container, or neither
547
+ * source available.
548
+ */
549
+ export declare function readContainerNofile(name: string, client?: ContainerClient): Promise<NofileLimits | null>;
550
+ export declare function _clearNofileRegrantAttemptsForTesting(): void;
530
551
  /**
531
552
  * Translate `ContainerConfig.ulimits` into the dockerode
532
553
  * `HostConfig.Ulimits` array (`{ Name, Soft, Hard }`). A bare number sets
@@ -675,6 +696,20 @@ export interface PruneRunLogger {
675
696
  * so the scheduler leaves the run unrecorded and retries it instead of
676
697
  * waiting out a full interval — both phases are idempotent.
677
698
  */
699
+ /**
700
+ * Build the reaper's view of managed images: every container recorded in a
701
+ * manifest, paired with the immutable image-ID it is currently running (or
702
+ * null when that cannot be determined). A per-container probe failure (e.g.
703
+ * corrupt storage making inspect 500 — issue #219) must not abort the whole
704
+ * list: the ref is kept with `runningImageId: null`, which
705
+ * `selectImagesToReap` treats as unanchored and keeps every version of that
706
+ * image — fail-safe.
707
+ */
708
+ export declare function collectManagedImageRefs(runtime: ContainerRuntimeInfo, manifests: ReadonlyArray<{
709
+ containers: Record<string, {
710
+ image: string;
711
+ }>;
712
+ }>, debug: (msg: string) => void, client?: ContainerClient): Promise<ManagedImageRef[]>;
678
713
  export declare function runScheduledPrune(runtime: ContainerRuntimeInfo, collectManaged: () => Promise<ManagedImageRef[]>, keepImageVersions: number, log: PruneRunLogger, client?: ContainerClient): Promise<void>;
679
714
  export declare function execInContainer(runtime: ContainerRuntimeInfo, name: string, command: string[], client?: ContainerClient): Promise<{
680
715
  exitCode: number;
@@ -1 +1 @@
1
- {"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../src/containers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,oBAAoB,EAEpB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EAIvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EASL,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAOtB,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,GAAE,OAAe,GACxB,MAAM,CAOR;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAE7E;AAcD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACvC,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SA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ACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEtD;AAeD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS1E;AASD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEvE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,KAAK,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAe,EACvC,MAAM,GAAE,eAA6B,GACpC,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CA8C1B;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,MAAc,EACzB,UAAU,GAAE,MAAY,GACvB,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -5,6 +5,7 @@ import { existsSync, readFileSync } from "node:fs";
5
5
  import { rm } from "node:fs/promises";
6
6
  import { isContainerized, makeLineSplitter, userMappingFlags, } from "./runtime.js";
7
7
  import { demuxToText, demuxBufferToText, getClient, safe, safeInspect, } from "./client.js";
8
+ import { describeError, isStorageCorruptError, } from "./errors.js";
8
9
  import { DEVICES_UNRESOLVED_LABEL, filterUnresolvedDeviceEntries, KEEP_ORIGINAL_GROUPS_ANNOTATION, parseUnresolvedDevicesLabel, presentLiveDeviceNodes, resolveDeviceRequests, resolveGroupAdd, unresolvedGroupNames, } from "./devices.js";
9
10
  import { parseResourceLimits, resourcePayloadForRun } from "./resources.js";
10
11
  import { containerPrefix, requestedResourcesLabel } from "./namespace.js";
@@ -1559,14 +1560,9 @@ export function readNofileHardCeiling(runtime) {
1559
1560
  }
1560
1561
  };
1561
1562
  if (runtime.isRootless) {
1562
- // "Max open files <soft> <hard> files" — the third column.
1563
1563
  try {
1564
- const line = readFileSync("/proc/self/limits", "utf8")
1565
- .split("\n")
1566
- .find((l) => l.startsWith("Max open files"));
1567
- const hard = line?.trim().split(/\s+/)[4];
1568
- const n = hard === "unlimited" ? Infinity : Number(hard);
1569
- return Number.isFinite(n) && n > 0 ? n : null;
1564
+ return (parseProcLimitsNofile(readFileSync("/proc/self/limits", "utf8"))
1565
+ ?.hard ?? null);
1570
1566
  }
1571
1567
  catch {
1572
1568
  return null;
@@ -1574,6 +1570,104 @@ export function readNofileHardCeiling(runtime) {
1574
1570
  }
1575
1571
  return read("/proc/sys/fs/nr_open");
1576
1572
  }
1573
+ /**
1574
+ * Parse the `Max open files` row out of a `/proc/<pid>/limits` file:
1575
+ * `Max open files <soft> <hard> files`. Returns null on any shape
1576
+ * surprise — callers treat null as "unknown", never as a limit.
1577
+ */
1578
+ export function parseProcLimitsNofile(content) {
1579
+ const line = content.split("\n").find((l) => l.startsWith("Max open files"));
1580
+ if (!line)
1581
+ return null;
1582
+ const toLimit = (raw) => {
1583
+ if (raw === "unlimited")
1584
+ return Infinity;
1585
+ const n = Number(raw);
1586
+ return Number.isSafeInteger(n) && n > 0 ? n : null;
1587
+ };
1588
+ const cols = line.trim().split(/\s+/);
1589
+ const soft = toLimit(cols[3]);
1590
+ const hard = toLimit(cols[4]);
1591
+ return soft !== null && hard !== null ? { soft, hard } : null;
1592
+ }
1593
+ // Injection seam for tests: the /proc/<pid>/limits reader used by
1594
+ // readContainerNofile. Production always uses readFileSync.
1595
+ let procLimitsReader = (p) => readFileSync(p, "utf8");
1596
+ export function _setProcLimitsReaderForTesting(fn) {
1597
+ procLimitsReader = fn ?? ((p) => readFileSync(p, "utf8"));
1598
+ }
1599
+ // Injection seam for tests: the host nofile ceiling probe used by the
1600
+ // create-time clamp and the regrant check. Production always uses
1601
+ // readNofileHardCeiling (real /proc reads), which tests can't control.
1602
+ let nofileCeilingFn = readNofileHardCeiling;
1603
+ export function _setNofileCeilingForTesting(fn) {
1604
+ nofileCeilingFn = fn ?? readNofileHardCeiling;
1605
+ }
1606
+ async function readContainerNofileState(name, client) {
1607
+ const inspect = (await safeInspect(() => client.getContainer(prefixedName(name)).inspect()));
1608
+ if (!inspect)
1609
+ return null;
1610
+ let live = null;
1611
+ const pid = inspect.State?.Running ? inspect.State?.Pid : undefined;
1612
+ if (typeof pid === "number" && pid > 0) {
1613
+ try {
1614
+ live = parseProcLimitsNofile(procLimitsReader(`/proc/${pid}/limits`));
1615
+ }
1616
+ catch {
1617
+ // unreadable (different pidns/uid) — the inspect echo remains
1618
+ }
1619
+ }
1620
+ let asked = null;
1621
+ for (const entry of inspect.HostConfig?.Ulimits ?? []) {
1622
+ // podman's libpod shape spells it RLIMIT_NOFILE; docker/compat use nofile.
1623
+ const entryName = entry.Name?.toLowerCase().replace(/^rlimit_/, "");
1624
+ if (entryName === "nofile" &&
1625
+ typeof entry.Soft === "number" &&
1626
+ typeof entry.Hard === "number") {
1627
+ asked = { soft: entry.Soft, hard: entry.Hard };
1628
+ break;
1629
+ }
1630
+ }
1631
+ return { live, asked };
1632
+ }
1633
+ /**
1634
+ * Read the nofile limits a managed container is ACTUALLY running with —
1635
+ * as opposed to the value that was requested when it was created.
1636
+ *
1637
+ * Primary source is the live `/proc/<container-pid>/limits`; where that
1638
+ * is not readable (containerized Signal K, rootful runtimes), fall back
1639
+ * to the create-time request echoed through inspect, which the runtime
1640
+ * applied verbatim or refused, so it equals the live value whenever it
1641
+ * is present. Null means "unknown": no such container, or neither
1642
+ * source available.
1643
+ */
1644
+ export async function readContainerNofile(name, client = getClient()) {
1645
+ const state = await readContainerNofileState(name, client);
1646
+ return state ? (state.live ?? state.asked) : null;
1647
+ }
1648
+ /** The hard nofile limit a `ContainerConfig.ulimits` request asks for, if any. */
1649
+ function requestedNofileHard(ulimits) {
1650
+ const nofile = ulimits?.["nofile"];
1651
+ if (nofile === undefined)
1652
+ return null;
1653
+ return typeof nofile === "number" ? nofile : nofile.hard;
1654
+ }
1655
+ // The live nofile hard limit observed the last time a regrant recreate was
1656
+ // attempted, per (prefixed) container name. Rootless podman < 5.5.0 ignores
1657
+ // the compat API's ulimit request entirely (containers/podman#25881, fixed
1658
+ // by #25908) and echoes the EFFECTIVE limits back through inspect — there
1659
+ // the asked-vs-grantable comparison cannot detect that a recreate already
1660
+ // failed to lift the limit, so without this guard a host whose Signal K
1661
+ // process carries a higher limit than its podman service would recreate the
1662
+ // container on every ensureRunning. Value-keyed on the observed limit: a
1663
+ // retry unlocks by itself as soon as the observed limit actually changes
1664
+ // (e.g. the operator raised the podman service's limit and the next
1665
+ // recreate would inherit it). In-memory by design — at worst one recreate
1666
+ // attempt per Signal K process lifetime per observed value.
1667
+ const nofileRegrantAttempts = new Map();
1668
+ export function _clearNofileRegrantAttemptsForTesting() {
1669
+ nofileRegrantAttempts.clear();
1670
+ }
1577
1671
  /**
1578
1672
  * Translate `ContainerConfig.ulimits` into the dockerode
1579
1673
  * `HostConfig.Ulimits` array (`{ Name, Soft, Hard }`). A bare number sets
@@ -1767,7 +1861,7 @@ function buildCreateOptions(name, config, runtime, healthcheck, debug = () => {
1767
1861
  // rootless container asking for more than the calling user's hard limit
1768
1862
  // is rejected by crun and never starts, so we lower it (and log) rather
1769
1863
  // than let the container fail.
1770
- const ulimits = ulimitsForRun(config.ulimits, readNofileHardCeiling(runtime), (requested, granted) => {
1864
+ const ulimits = ulimitsForRun(config.ulimits, nofileCeilingFn(runtime), (requested, granted) => {
1771
1865
  const reason = `nofile ulimit ${requested} exceeds this host's hard limit; clamped to ${granted}. ` +
1772
1866
  `Raise the limit for the user running the container runtime to use a higher value.`;
1773
1867
  debug(reason);
@@ -1823,8 +1917,32 @@ export async function ensureRunning(runtime, name, config, debug, options, clien
1823
1917
  * will be undefined and only positive drift is detected.
1824
1918
  */
1825
1919
  prior, _postRecreate = false, _pull = pullImage) {
1826
- const state = await getContainerState(runtime, name, client);
1827
1920
  const fullName = prefixedName(name);
1921
+ let state;
1922
+ try {
1923
+ state = await getContainerState(runtime, name, client);
1924
+ }
1925
+ catch (err) {
1926
+ if (_postRecreate || !isStorageCorruptError(err))
1927
+ throw err;
1928
+ // Storage corruption (issue #219): inspect 500s but force-remove still
1929
+ // works, and managed containers keep their state in bind mounts, so
1930
+ // remove + recreate is the recovery. Bounded: if removal or the re-read
1931
+ // fails we throw, and the _postRecreate re-entry never retries.
1932
+ debug(`Container ${fullName} has corrupt storage (${describeError(err)}); removing and recreating`);
1933
+ try {
1934
+ await removeContainer(runtime, name, client);
1935
+ state = await getContainerState(runtime, name, client);
1936
+ }
1937
+ catch (recoveryErr) {
1938
+ throw new Error(`Container ${fullName} has corrupt storage and automatic recovery failed. ` +
1939
+ `Remove it manually (\`${runtime.runtime} rm -f ${fullName}\`)` +
1940
+ (runtime.runtime === "podman"
1941
+ ? " or repair the store (`podman system check --repair --force`)"
1942
+ : "") +
1943
+ ` and retry. Underlying error: ${describeError(recoveryErr)}`, { cause: recoveryErr });
1944
+ }
1945
+ }
1828
1946
  const imageRef = qualifyImage(config.digest
1829
1947
  ? `${config.image}@${config.digest}`
1830
1948
  : `${config.image}:${config.tag}`, runtime);
@@ -1939,6 +2057,89 @@ prior, _postRecreate = false, _pull = pullImage) {
1939
2057
  debug(`Container ${fullName} floating-tag digest drift detected (${liveId.slice(0, 19)}… → ${remoteId.slice(0, 19)}…); recreating`);
1940
2058
  return recreateUnlessWedged(`digest ${liveId.slice(0, 19)}… → ${remoteId.slice(0, 19)}…`);
1941
2059
  };
2060
+ // Emit the still-capped advisory so consumers keep showing the true live
2061
+ // state; `granted` is the limit the container actually runs with.
2062
+ const adviseNofileCapped = (grantedHard, requestedHard) => safeInvokeUlimitClamped(options?.onUlimitClamped, {
2063
+ ulimit: "nofile",
2064
+ requested: requestedHard,
2065
+ granted: grantedHard,
2066
+ reason: `${fullName} is running with a nofile limit of ${grantedHard}, ` +
2067
+ `below the requested ${requestedHard}, and a recreate cannot ` +
2068
+ `currently do better. Raise the limit of the host service that ` +
2069
+ `runs the containers to lift it.`,
2070
+ }, (err) => debug(`ensureRunning(${name}): onUlimitClamped handler threw: ${err instanceof Error ? err.message : String(err)}`));
2071
+ // ulimits sit outside drift detection (changing one doesn't justify the
2072
+ // recreate downtime), which leaves one gap: after an operator raises the
2073
+ // host nofile ceiling, the existing container keeps the lower limit it was
2074
+ // created with forever — a restart re-applies the stored value. Close the
2075
+ // gap here: when the host would now ask for MORE nofile than the previous
2076
+ // create asked, recreate to apply it (completing the documented "raise the
2077
+ // host limit" fix without manual container surgery). When it can't do
2078
+ // better, re-emit the clamp advisory so consumers reflect the live capped
2079
+ // state across Signal K restarts — the create-time event alone would
2080
+ // vanish on the next plugin start while the container stayed capped. A
2081
+ // null probe means "unknown", never capped: no recreate, no advisory.
2082
+ const checkNofileRegrant = async () => {
2083
+ const requestedHard = requestedNofileHard(config.ulimits);
2084
+ if (requestedHard === null)
2085
+ return false;
2086
+ const state = await readContainerNofileState(name, client);
2087
+ const live = state ? (state.live ?? state.asked) : null;
2088
+ if (!state || !live)
2089
+ return false;
2090
+ const ceiling = nofileCeilingFn(runtime);
2091
+ const grantable = ceiling !== null && Number.isFinite(ceiling)
2092
+ ? Math.min(requestedHard, ceiling)
2093
+ : requestedHard;
2094
+ // Compare against what the previous create ASKED for, not what the
2095
+ // container got: a recreate re-asks with `grantable`, so it can only
2096
+ // improve on a smaller previous ask. When the runtime granted less
2097
+ // than asked (a daemon whose own unit limit caps what it hands out —
2098
+ // asking again cannot help), recreating would thrash the container on
2099
+ // every ensureRunning without ever lifting the limit.
2100
+ const asked = state.asked ?? live;
2101
+ if (grantable > asked.hard &&
2102
+ nofileRegrantAttempts.get(fullName) !== live.hard) {
2103
+ nofileRegrantAttempts.set(fullName, live.hard);
2104
+ debug(`Container ${fullName} was created asking nofile ${asked.hard} but ` +
2105
+ `the host now grants ${grantable}; recreating to apply it`);
2106
+ if (await recreateUnlessWedged(`nofile ${asked.hard} → ${grantable}`)) {
2107
+ // Verify the recreate actually lifted the limit. On rootless podman
2108
+ // < 5.5.0 the re-ask is dropped like the original ask (see
2109
+ // nofileRegrantAttempts), so a skewed host — Signal K process limit
2110
+ // above the podman service's — recreates once and lands back on the
2111
+ // old value. Without this post-check that session would show no
2112
+ // advisory at all: the create emits no clamp (the ceiling looks
2113
+ // fine) and this path returned before the still-capped check below.
2114
+ // Best-effort telemetry: the recreate itself succeeded, so a probe
2115
+ // failure here must degrade to "no advisory", never fail the start.
2116
+ // A container that landed exactly on `grantable` got what the create
2117
+ // asked after clamping — the create-time clamp event (if any) already
2118
+ // reported that value, so advising again would duplicate it. A
2119
+ // container that landed anywhere else (a runtime that dropped the
2120
+ // ask) makes the create-time event wrong, and this advisory is the
2121
+ // correction.
2122
+ try {
2123
+ const after = await readContainerNofileState(name, client);
2124
+ const afterLive = after ? (after.live ?? after.asked) : null;
2125
+ if (afterLive &&
2126
+ requestedHard > afterLive.hard &&
2127
+ afterLive.hard !== grantable) {
2128
+ adviseNofileCapped(afterLive.hard, requestedHard);
2129
+ }
2130
+ }
2131
+ catch (err) {
2132
+ debug(`ensureRunning(${name}): post-regrant nofile verify failed: ${err instanceof Error ? err.message : String(err)}`);
2133
+ }
2134
+ return true;
2135
+ }
2136
+ // Wedged — kept running on the old limit; fall through to advise.
2137
+ }
2138
+ if (requestedHard > live.hard) {
2139
+ adviseNofileCapped(live.hard, requestedHard);
2140
+ }
2141
+ return false;
2142
+ };
1942
2143
  switch (state) {
1943
2144
  case "running": {
1944
2145
  if (_postRecreate) {
@@ -1951,6 +2152,8 @@ prior, _postRecreate = false, _pull = pullImage) {
1951
2152
  return;
1952
2153
  if (await checkAndRecreateOnDigestDrift())
1953
2154
  return;
2155
+ if (await checkNofileRegrant())
2156
+ return;
1954
2157
  debug(`Container ${fullName} already running`);
1955
2158
  return;
1956
2159
  }
@@ -1966,6 +2169,8 @@ prior, _postRecreate = false, _pull = pullImage) {
1966
2169
  return;
1967
2170
  if (await checkAndRecreateOnDigestDrift())
1968
2171
  return;
2172
+ if (await checkNofileRegrant())
2173
+ return;
1969
2174
  debug(`Starting stopped container ${fullName}`);
1970
2175
  await startByFullName(client, fullName);
1971
2176
  return;
@@ -2570,6 +2775,36 @@ export async function reapSupersededImages(runtime, managed, keepImageVersions,
2570
2775
  * so the scheduler leaves the run unrecorded and retries it instead of
2571
2776
  * waiting out a full interval — both phases are idempotent.
2572
2777
  */
2778
+ /**
2779
+ * Build the reaper's view of managed images: every container recorded in a
2780
+ * manifest, paired with the immutable image-ID it is currently running (or
2781
+ * null when that cannot be determined). A per-container probe failure (e.g.
2782
+ * corrupt storage making inspect 500 — issue #219) must not abort the whole
2783
+ * list: the ref is kept with `runningImageId: null`, which
2784
+ * `selectImagesToReap` treats as unanchored and keeps every version of that
2785
+ * image — fail-safe.
2786
+ */
2787
+ export async function collectManagedImageRefs(runtime, manifests, debug, client = getClient()) {
2788
+ const refs = [];
2789
+ for (const manifest of manifests) {
2790
+ for (const [containerName, entry] of Object.entries(manifest.containers)) {
2791
+ let runningImageId = null;
2792
+ try {
2793
+ // Inspect the container directly — going through getImageDigest
2794
+ // would try an image-name lookup first, so a local image tagged
2795
+ // with the container's name would shadow the container's .Image.
2796
+ const info = await safeInspect(() => client.getContainer(prefixedName(containerName)).inspect());
2797
+ runningImageId = info?.Image ?? null;
2798
+ }
2799
+ catch (err) {
2800
+ debug(`Image reaper: cannot read the running image of ${prefixedName(containerName)} ` +
2801
+ `(${describeError(err)}); keeping all versions of ${entry.image} this run`);
2802
+ }
2803
+ refs.push({ image: entry.image, runningImageId });
2804
+ }
2805
+ }
2806
+ return refs;
2807
+ }
2573
2808
  export async function runScheduledPrune(runtime, collectManaged, keepImageVersions, log, client = getClient()) {
2574
2809
  let firstError = null;
2575
2810
  try {