From 3c28dbfbe883acd062a2c0a7c8ebf49d5ff852bf Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Fri, 31 Oct 2025 18:17:21 +0100 Subject: [PATCH] Fix: Verbesserte Login-Debug-Ausgabe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Zeigt jetzt immer Login-Output, auch wenn leer - Setzt +e / -e für korrekte Exit-Code-Erfassung - Bessere Fehleranalyse für 401/Unauthorized - Detailliertere Fehlermeldungen --- .gitea/workflows/production-deploy.yml | 31 ++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/production-deploy.yml b/.gitea/workflows/production-deploy.yml index 869f3085..80ad7085 100644 --- a/.gitea/workflows/production-deploy.yml +++ b/.gitea/workflows/production-deploy.yml @@ -250,9 +250,35 @@ jobs: echo "✅ Registry erreichbar über HTTP: http://$TEST_URL (Status: $HTTP_CODE)" # Versuche Login mit HTTP (ohne :5000 nochmal hinzuzufügen) + # Docker benötigt möglicherweise insecure-registry Konfiguration für HTTP + echo " Versuche Docker Login..." + + # Führe Login aus und sammle Output UND Exit-Code + set +e # Erlaube Fehler während Login-Versuch LOGIN_OUTPUT=$(echo "$REGISTRY_PASSWORD" | docker login "$TEST_URL" -u "$REGISTRY_USER" --password-stdin 2>&1) LOGIN_EXIT_CODE=$? - echo " Login-Output: $LOGIN_OUTPUT" + set -e # Zurück zu strict mode + + echo " Login-Exit-Code: $LOGIN_EXIT_CODE" + echo " Login-Output:" + if [ -n "$LOGIN_OUTPUT" ]; then + echo "$LOGIN_OUTPUT" | while IFS= read -r line; do + echo " $line" + done || echo " (keine Ausgabe)" + else + echo " (keine Ausgabe)" + fi + + # Prüfe ob es ein insecure-registry Problem ist + if echo "$LOGIN_OUTPUT" | grep -qi "insecure\|certificate\|tls\|unauthorized\|401"; then + echo " ⚠️ Mögliche Probleme:" + if echo "$LOGIN_OUTPUT" | grep -qi "unauthorized\|401"; then + echo " - Unauthorized (401): Möglicherweise falsche Credentials" + fi + if echo "$LOGIN_OUTPUT" | grep -qi "insecure\|certificate\|tls"; then + echo " - SSL/Insecure Registry Problem erkannt" + fi + fi if [ $LOGIN_EXIT_CODE -eq 0 ]; then echo "✅ Erfolgreich bei Registry angemeldet: $TEST_URL" @@ -260,7 +286,8 @@ jobs: LOGIN_SUCCESS=true break else - echo "⚠️ Login fehlgeschlagen für $TEST_URL (Exit Code: $LOGIN_EXIT_CODE), versuche nächste URL..." + echo "⚠️ Login fehlgeschlagen für $TEST_URL (Exit Code: $LOGIN_EXIT_CODE)" + echo " Prüfe Login-Output oben für Details" fi else echo "⚠️ Registry nicht erreichbar: http://$TEST_URL (Status: $HTTP_CODE)"