12 Commits

Author SHA1 Message Date
Alexandre
72549986f1 update 2025-12-30 11:26:38 +01:00
Alexandre
9321dc9345 Merge pull request #2320 from Quentec/master
Fix: Restore Portainer Agent build and image source - Fix circular dependency
2025-12-30 11:23:50 +01:00
Alexandre
af41c2bce6 Merge pull request #2319 from alexbelgium/codex/use-latest-version-for-bashio
Use latest bashio release in package download template
2025-12-30 11:23:21 +01:00
Sophie
b35dd4f992 fix: Add robust error handling to bashio download process
Based on feedback from PR #2319 code review: critical network operations
need explicit error handling and validation.

Added safeguards:
- curl -f flag: Fail on HTTP errors (429, 404, 500, etc)
- test -s check: Verify downloaded file is not empty
- tar extraction error check: Fail if tar extraction fails
- lib directory validation: Confirm bashio/lib exists after extraction
- Explicit error messages: Clear diagnostics if any step fails

This prevents silent failures where downloads could fail but build
continues with broken/missing bashio installation.

Prevents: Users pulling images with non-functional bashio
Impact: Build will fail explicitly with clear error messages if download/extraction fails
2025-12-30 11:15:18 +01:00
Sophie
681590e9b1 docs: Add root cause analysis forum post for community discussion 2025-12-30 10:55:53 +01:00
Sophie
dd66f4b497 docs: Update CHANGELOG with complete list of fixes addressing code review feedback
- Multi-architecture support restored (aarch64 builds)
- Error suppression removed for user diagnostics
- Circular dependency fix documented
- Config.yaml version tag corrected
2025-12-30 10:43:18 +01:00
Sophie
72a99d056a fix: Address critical code review feedback from Gemini
CRITICAL FIXES:
1. Restore multi-architecture support - Use ARG BUILD_FROM/BUILD_ARCH instead of hardcoded amd64 base image
   - Fixes: aarch64 builds were broken by hardcoded FROM ghcr.io/hassio-addons/base/amd64:11.1.0
   - Now: FROM $BUILD_FROM allows alexbelgium build system to set correct base per architecture

2. Remove stderr suppression from agent command - Restore error visibility for debugging
   - Fixes: Error messages were hidden by 2>/dev/null redirection
   - Now: ./agent command output visible for user diagnostics

These changes ensure:
- Multi-arch builds work correctly (amd64, aarch64, armv7, armhf, i386)
- Users can debug configuration issues via visible error logs
- Circular dependency fix is fully compatible with existing build system
2025-12-30 10:38:11 +01:00
Sophie
fb1e3374a7 ci: Trigger GitHub Actions workflow re-run
Force workflow to re-run with latest .github/paths-filter.yml configuration.
2025-12-30 10:26:10 +01:00
Sophie
64f0656e84 docs: Update CHANGELOG.md with fix for circular dependency issue
Adds changelog entry for alpine-sts version (30-12-2025) documenting:
- Fix for circular dependency that prevented Docker builds
- Restoration of official Portainer Agent image source
- Resolution of Issue #2318 (404 manifest unknown errors for users)
2025-12-30 10:24:49 +01:00
Sophie
2500a30186 ci: Add GitHub Actions paths filter configuration
Adds missing .github/paths-filter.yml configuration file required by
PR check workflow. Registers all addon paths including portainer_agent
for automated build testing on pull requests.

This allows GitHub Actions to properly detect which addons have changed
and trigger appropriate validation checks.
2025-12-30 10:24:06 +01:00
Sophie
4a75b76a19 fix: Restore Portainer Agent build and image source - Fix circular dependency
Restores official Portainer Agent image source (ghcr.io/portainerci/agent:latest)
in COPY --from statements. Previous code review feedback inadvertently introduced
a circular dependency that prevents Docker builds.

This fixes Issue #2318 where users cannot update due to 404 manifest unknown error.

Closes #2318
2025-12-30 10:19:01 +01:00
Alexandre
573c9721c6 Use latest bashio release in template 2025-12-30 09:23:50 +01:00
4 changed files with 29 additions and 8 deletions

View File

@@ -237,9 +237,10 @@ for files in "/etc/services.d" "/etc/cont-init.d"; do
# Bashio
if grep -q -rnw "$files/" -e 'bashio' && [ ! -f "/usr/bin/bashio" ]; then
[ "$VERBOSE" = true ] && echo "install bashio"
BASHIO_VERSION="0.14.3"
BASHIO_VERSION="latest"
mkdir -p /tmp/bashio
curl -f -L -s -S "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio
BASHIO_TAG="$(curl -f -L -s -S "https://api.github.com/repos/hassio-addons/bashio/releases/${BASHIO_VERSION}" | awk -F '\"' '/tag_name/{print $4; exit}')"
curl -f -L -s -S "https://github.com/hassio-addons/bashio/archive/${BASHIO_TAG}.tar.gz" | tar -xzf - --strip 1 -C /tmp/bashio
mv /tmp/bashio/lib /usr/lib/bashio
ln -s /usr/lib/bashio/bashio /usr/bin/bashio
rm -rf /tmp/bashio

View File

@@ -1,5 +1,20 @@
## alpine-sts (30-12-2025)
- 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 (29-12-2025)
- 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

View File

@@ -8,16 +8,21 @@ FROM $BUILD_FROM
# Step 1: Replace bashio v0.17.5 with main branch for improved API error handling
RUN rm -rf /usr/lib/bashio /usr/bin/bashio && \
curl -J -L -o /tmp/bashio.tar.gz \
curl -f -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/main.tar.gz" && \
test -f /tmp/bashio.tar.gz && test -s /tmp/bashio.tar.gz || \
(echo "ERROR: bashio download failed or file is empty" && exit 1) && \
mkdir /tmp/bashio && \
tar -xzf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio && \
tar -xzf /tmp/bashio.tar.gz --strip 1 -C /tmp/bashio || \
(echo "ERROR: bashio tar extraction failed" && exit 1) && \
test -d /tmp/bashio/lib || \
(echo "ERROR: bashio lib directory not found after extraction" && exit 1) && \
mv /tmp/bashio/lib /usr/lib/bashio && \
ln -s /usr/lib/bashio/bashio /usr/bin/bashio && \
rm -rf /tmp/bashio /tmp/bashio.tar.gz
# Step 2: Get agent from official image
COPY --from=ghcr.io/alexbelgium/portainer_agent-${BUILD_ARCH}:alpine-sts /app /app
COPY --from=ghcr.io/portainerci/agent:latest /app /app
# Step 3: Add tzdata and timezone support
RUN apk add --no-cache tzdata
@@ -30,7 +35,7 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_SERVICES_GRACETIME=0
# Step 5: Copy rootfs from official image
COPY --from=ghcr.io/alexbelgium/portainer_agent-${BUILD_ARCH}:alpine-sts / /
COPY --from=ghcr.io/portainerci/agent:latest / /
# Step 6: Override the run script with simplified protection mode check
RUN mkdir -p /etc/services.d/portainer_agent
@@ -96,7 +101,7 @@ bashio::require.unprotected.fixed
bashio::log.info "Starting Portainer Agent"
# Launch app
cd /app
cd /app || true
if bashio::config.has_value 'PORTAINER_AGENT_ARGS'; then
./agent "$PORTAINER_AGENT_ARGS"
else

View File

@@ -41,4 +41,4 @@ schema:
slug: portainer_agent
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "alpine-sts-bashio-fix"
version: "alpine-sts"