Files
hassio-addons/portainer_agent/CHANGELOG.md
Alexandre 7cd844ac9f fix(templates): populate /run/s6/container_environment when the entrypoint is PID 1 (#3013)
Add-ons that override the base image's ENTRYPOINT ["/init"] with
ENTRYPOINT ["/usr/bin/env"] plus CMD ["/ha_entrypoint.sh"] never run s6-overlay's
stage 1, so nothing creates /run/s6/container_environment. `with-contenv` empties
the environment and repopulates it from that directory, which means every script
carrying a #!/usr/bin/with-contenv shebang outside the three globs whose shebang
ha_entrypoint.sh rewrites either exits non-zero before its first line of logic
(directory missing: s6-envdir errors) or runs against whatever a cont-init script
happened to leave there.

Measured in a running add-on of this repo whose PID 1 is /ha_entrypoint.sh: a
with-contenv script saw 16 environment variables where the entrypoint has 110, with
SUPERVISOR_TOKEN among the missing. Neither failure prints anything, so all that
surfaces is whatever the caller makes of a non-zero exit — a Docker HEALTHCHECK
reading "unhealthy" for eight months, in the case that prompted this. Cron jobs,
user-facing CLI wrappers and the user's own script.sh share the blind spot.

Dump the environment here instead, with s6-dumpenv, which is what stage 1 would
have done. Guarded on being PID 1 and on with-contenv existing, so it neither runs
under /init — where stage 1 already wrote the directory — nor warns in images that
have no with-contenv to fix.

Filled in a sibling directory and renamed into place rather than written live. A
half-populated envdir is worse than an absent one: s6-envdir accepts it, so a
with-contenv script starts and runs against an environment quietly missing
SUPERVISOR_TOKEN, where an absent one stops it at its shebang. A HEALTHCHECK can run
alongside PID 1, and rename(2) means such a reader sees the directory either absent
or complete. Measured with a racing poller over 664 samples: only 0 or 110 entries,
never a partial count.

The directory is cleared first rather than written over. /run is not a tmpfs in
these containers, so an image layer could persist entries there, and merging into
them would leave variables PID 1 does not have, including a stale SUPERVISOR_TOKEN.
A failed rm aborts the attempt, since mkdir -p accepts a surviving
symlink-to-directory and would let the dump follow it.

A failed seed leaves the directory absent, which is how this already fails today, so
the failure mode is unchanged rather than newly degraded — but it now says so.

Placed after the shebang probe on purpose. The probe's first candidate is
"/command/with-contenv bashio" and it fails today in exactly these add-ons, so the
probe falls through to "/usr/bin/env bashio". Seeding earlier would make that first
candidate start succeeding and flip the shebang of every cont-init and service
script that lands here, which is a much larger change than this fixes.

Refs #3006

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 14:30:13 +02:00

5.6 KiB

2.44.0.1 (2026-08-24)

  • Rebuild to pick up a fix in the shared entrypoint: when ha_entrypoint.sh runs as PID 1, as it does in this add-on, it now populates /run/s6/container_environment, so a script carrying a #!/usr/bin/with-contenv shebang gets a populated environment including SUPERVISOR_TOKEN instead of failing at its shebang. Nothing shipped in this add-on still uses that shebang (the healthcheck moved to plain bash in 2.44.0), so this changes nothing about the agent itself; it matters for a script.sh added by the user, and it is the add-on that build-tests the shared change

2.44.0 (2026-08-23)

  • Fix: Use portainer/agent:alpine-sts to match the STS release channel configured in updater.json
  • Fix: Align add-on versioning with Portainer STS releases

2025.12.7 (2026-08-23)

  • Fix: Docker reported the addon as unhealthy in Portainer. The healthcheck script could never run because its shebang required the s6-overlay environment, which this addon's entrypoint does not set up (https://github.com/alexbelgium/hassio-addons/issues/3002)
  • Remove the unused and broken wait-for-signal script; nothing invoked it

2025.12.6 (2026-08-01)

  • Version renamed from 2025.12-6, which Home Assistant could not order and therefore could not reliably offer as an update: every number of the previous version is kept, as a section of its own. The addon itself and the upstream version it tracks are unchanged

2025.12-6 (2025-12-31)

  • Minor bugs fixed

2025.12-5 (2025-12-31)

  • Minor bugs fixed

2025.12-4 (2025-12-31)

  • Minor bugs fixed

2025.12-3 (2025-12-31)

  • Minor bugs fixed

2025.12-2 (2025-12-31)

  • Minor bugs fixed

alpine-sts-3 (2025-12-30)

  • Minor bugs fixed

alpine-sts-2 (2025-12-30)

  • Minor bugs fixed

alpine-sts (2025-12-30)

  • Fix: Restore official Portainer Agent image source - Fix circular dependency (Fixes #2318)
  • Revert COPY --from to use official ghcr.io/portainerci/agent:latest instead of self-reference
  • Restored multi-architecture support via ARG BUILD_FROM/ARG BUILD_ARCH (fixes aarch64 builds)
  • Removed stderr suppression to preserve error messages for user diagnostics
  • This fixes build failures that prevented users from updating
  • Updated config.yaml version tag to match buildable image tag

alpine-sts-bashio-fix (2025-12-29)

  • Fix: PROTECTION MODE IS ENABLED error when protection mode is OFF (Fixes #2307)

  • Update bashio from v0.17.5 → main branch for improved API error handling

  • Add robust protection mode check with Docker socket fallback

  • Tested and verified working on Home Assistant OS

  • Fix: PROTECTION MODE IS ENABLED error when protection mode is OFF (Fixes #2307)

  • Update bashio from v0.17.5 → main branch for improved API error handling

  • Add robust protection mode check with Docker socket fallback

  • Tested and verified working on Home Assistant OS

alpine-sts (2025-12-24)

  • Update to latest version from portainer/agent

(2025-12-23)

alpine-sts (2025-05-24)

  • Update to latest version from portainer/agent

linux-arm64-2.21.5-alpine (2025-05-10)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.5-alpine (2024-12-21)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.4-alpine (2024-10-26)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.3-alpine (2024-10-12)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.2-alpine (2024-09-28)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.1-alpine (2024-09-14)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.0-rc2-alpine (2024-08-24)

  • Update to latest version from portainer/agent

linux-ppc64le-2.21.0-rc1-alpine (2024-08-17)

  • Update to latest version from portainer/agent

linux-ppc64le-2.20.3-alpine (2024-05-25)

  • Update to latest version from portainer/agent

linux-ppc64le-2.20.2-alpine (2024-05-04)

  • Update to latest version from portainer/agent

linux-ppc64le-2.20.1-alpine (2024-04-06)

  • Update to latest version from portainer/agent

linux-ppc64le-2.20.0-alpine (2024-03-23)

  • Update to latest version from portainer/agent

linux-arm64-2.19.4-alpine-3 (2024-03-21)

  • Minor bugs fixed

linux-arm64-2.19.4-alpine-2 (2024-03-14)

  • Minor bugs fixed

linux-arm64-2.19.4-alpine (2024-01-20)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.19.4 (2023-12-09)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.19.3 (2023-11-25)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.19.2 (2023-11-18)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.19.1 (2023-09-23)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.19.0 (2023-09-02)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.18.4 (2023-07-08)

  • Update to latest version from portainer/agent

windowsltsc2022-amd64-2.18.3 (2023-06-10)

  • Update to latest version from portainer/agent

2.18.3-alpine (2023-05-27)

  • Update to latest version from portainer/agent

2.18.2-7 (2023-05-22)

  • Minor bugs fixed

2.18.2-6 (2023-05-21)

  • Require unprotected
  • Correct healthcheck
  • First build