docs: document 502 error fix for Docker registry and update workflow
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Failing after 7m27s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 7m21s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Failing after 2m15s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Failing after 1m53s
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Failing after 7m27s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 7m21s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Failing after 2m15s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Failing after 1m53s
Added a detailed session log documenting the root cause and resolution of 502 errors during Docker image pushes. Updated `.gitea/workflows/docker-publish.yaml` to bypass Pangolin for internal registry access and disable attestation manifests to prevent additional token requests.
This commit is contained in:
@@ -95,6 +95,12 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Pangolin-Bypass: Gitea direkt intern erreichbar machen (10.0.0.22:3000)
|
||||
# Hintergrund: Ohne diesen Eintrag routet der Runner über Pangolin (git.mo-code.at),
|
||||
# was bei großen Docker-Layern (70+ Sekunden Upload) mit 502 abbricht.
|
||||
- name: Registry intern auflösen (Pangolin-Bypass)
|
||||
run: echo "10.0.0.22 git.mo-code.at" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@@ -121,6 +127,10 @@ jobs:
|
||||
platforms: linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
# Attestation-Manifeste deaktivieren: verhindert extra OAuth-Token-Requests
|
||||
# die bei proxied Registries (Pangolin) ebenfalls mit 502 fehlschlagen können
|
||||
provenance: false
|
||||
sbom: false
|
||||
build-args: |
|
||||
DOCKER_BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
VERSION=${{ github.sha }}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
type: JOURNAL
|
||||
status: DONE
|
||||
owner: DevOps
|
||||
date: 2026-03-06
|
||||
---
|
||||
|
||||
# Session Log — Pipeline 502 Bad Gateway Fix
|
||||
|
||||
## Problem
|
||||
|
||||
Der Gitea-Runner (VM 102, `10.0.0.23`) brach beim Docker-Push mit `502 Bad Gateway` ab:
|
||||
|
||||
```
|
||||
ERROR: failed to push git.mo-code.at/.../ping-service:latest:
|
||||
failed to authorize: failed to fetch oauth token:
|
||||
unexpected status from POST request to https://git.mo-code.at/v2/token: 502 Bad Gateway
|
||||
```
|
||||
|
||||
Der Build lief durch (alle Layers gebaut), aber der Push schlug nach ~70 Sekunden fehl.
|
||||
|
||||
## Root Cause
|
||||
|
||||
Der Runner routete den Registry-Push über Pangolin (CT 100, `10.0.0.21`) → `git.mo-code.at` → Gitea (CT 101, `10.0.0.22`). Bei großen Image-Layern (70+ Sekunden Upload) brach Pangolin die Verbindung ab und antwortete mit 502 — sowohl beim Blob-Upload (PUT) als auch beim abschließenden OAuth-Token-Fetch für den Manifest-Push.
|
||||
|
||||
**Zusätzlich:** `docker/build-push-action` generiert standardmäßig Attestation-Manifests (SLSA Provenance + SBOM), die weitere Token-Requests auslösen — jeder davon ein zusätzliches 502-Risiko bei Pangolin.
|
||||
|
||||
## Änderungen
|
||||
|
||||
### `.gitea/workflows/docker-publish.yaml`
|
||||
|
||||
**1. Pangolin-Bypass via `/etc/hosts`**
|
||||
|
||||
```yaml
|
||||
- name: Registry intern auflösen (Pangolin-Bypass)
|
||||
run: echo "10.0.0.22 git.mo-code.at" | sudo tee -a /etc/hosts
|
||||
```
|
||||
|
||||
Bewirkt: Der Runner löst `git.mo-code.at` direkt auf `10.0.0.22` (Gitea intern) auf.
|
||||
Push läuft nun intern 10.0.0.23 → 10.0.0.22, kein Pangolin-Timeout mehr möglich.
|
||||
Image-Tags bleiben `git.mo-code.at/...` — für externe Pulls weiterhin korrekt.
|
||||
|
||||
**2. Attestation-Manifeste deaktiviert**
|
||||
|
||||
```yaml
|
||||
provenance: false
|
||||
sbom: false
|
||||
```
|
||||
|
||||
Bewirkt: Keine zusätzlichen Manifest-Pushes, kein extra Token-Request am Ende des Builds.
|
||||
|
||||
## Netz-Topologie (zur Referenz)
|
||||
|
||||
```
|
||||
Runner (VM 102, 10.0.0.23)
|
||||
↓ /etc/hosts: git.mo-code.at → 10.0.0.22
|
||||
Gitea (CT 101, 10.0.0.22:3000) ← direkter Push, kein Pangolin
|
||||
↑
|
||||
Pangolin (CT 100, 10.0.0.21) ← nur noch für externe Nutzer
|
||||
↑
|
||||
git.mo-code.at (Internet)
|
||||
```
|
||||
|
||||
## Gelernt
|
||||
|
||||
- Pangolin-Tunnel ist für kurze REST-Calls geeignet, nicht für große Binär-Uploads (Docker Layers)
|
||||
- Self-hosted Runner sollten Registry-Endpunkte immer intern auflösen
|
||||
- `provenance: false` + `sbom: false` ist Best Practice für private/interne Registries
|
||||
Reference in New Issue
Block a user