From d14b719bd2067da72bab81f82633b426b458fab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Arag=C3=B3n?= Date: Fri, 10 Jul 2026 11:41:54 +0000 Subject: [PATCH] debug(ci): print hostname/route on auto-discover failure - Drop 'set -euo pipefail' from the redeploy step so the auto-discovery loop and the diagnostic echos can run to completion even if a probe fails or a command returns empty output. - On failure to find Portainer, also print the container's hostname, hostname -I, and ip route to stderr. This is what we'll need if the host-net job container approach doesn't work and we need to debug further. --- .gitea/workflows/ci-cd.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci-cd.yaml b/.gitea/workflows/ci-cd.yaml index f28398d..649a7ec 100644 --- a/.gitea/workflows/ci-cd.yaml +++ b/.gitea/workflows/ci-cd.yaml @@ -69,9 +69,10 @@ jobs: PORTAINER_ENDPOINT_ID: ${{ secrets.PORTAINER_ENDPOINT_ID }} PORTAINER_STACK_ID: ${{ secrets.PORTAINER_STACK_ID }} run: | - set -euo pipefail - - echo "--- Step 0a: debug network from inside the job container ---" + # NOTE: no `set -e` here on purpose — the auto-discovery loop below + # needs to try every candidate even if some probes fail, and some + # diagnostic commands (ip route, hostname -I) might return empty + # in unusual container network setups without aborting the job. echo "hostname: $(hostname)" echo "hostname -I:" hostname -I 2>/dev/null || echo "(none)" @@ -120,6 +121,8 @@ jobs: if [ -z "$PORTAINER_URL" ]; then echo "ERROR: no candidate URL reached Portainer. Tried: ${CANDIDATES[@]}" >&2 + echo "ERROR: container hostname=$(hostname) IP=$(hostname -I)" >&2 + echo "ERROR: ip route=$(ip route 2>&1 | tr '\n' ';')" >&2 exit 1 fi