fix: resolve RedisCache array offset error and improve discovery diagnostics

- Fix RedisCache driver to handle MGET failures gracefully with fallback
- Add comprehensive discovery context comparison debug tools
- Identify root cause: WEB context discovery missing 166 items vs CLI
- WEB context missing RequestFactory class entirely (52 vs 69 commands)
- Improved exception handling with detailed binding diagnostics
This commit is contained in:
2025-09-12 20:05:18 +02:00
parent 8040d3e7a5
commit e30753ba0e
46990 changed files with 10789682 additions and 89639 deletions

View File

@@ -41,9 +41,9 @@ scp -i ~/.ssh/production "$TMP_ARCHIVE" "$SERVER_USER@$SERVER_IP:/tmp/project.ta
echo -e "${YELLOW}Entpacke Dateien auf dem Server...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "tar -xzf /tmp/project.tar.gz -C $REMOTE_PATH"
# 7. Umgebungsdatei erstellen, falls nicht vorhanden
echo -e "${YELLOW}Überprüfe/erstelle .env Datei...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "[ -f $REMOTE_PATH/.env ] || cp $REMOTE_PATH/.env.example $REMOTE_PATH/.env"
# 7. Production Umgebungsdatei kopieren
echo -e "${YELLOW}Kopiere Production-Umgebungsdatei...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "cp $REMOTE_PATH/.env.production $REMOTE_PATH/.env"
# 8. Berechtigungen setzen
echo -e "${YELLOW}Setze Berechtigungen...${RESET}"
@@ -53,11 +53,57 @@ ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "chmod -R 775 $REMOTE_PATH/storage $REMO
echo -e "${YELLOW}Installiere Abhängigkeiten und baue Assets...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "cd $REMOTE_PATH && composer install --no-dev && npm ci && npm run build"
# 10. Docker Container neu starten
# 10. SSL-Zertifikate prüfen und ggf. einrichten
echo -e "${YELLOW}Prüfe SSL-Zertifikate...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "
cd $REMOTE_PATH
if [ ! -f ssl/fullchain.pem ] || [ ! -f ssl/privkey.pem ]; then
echo 'SSL-Zertifikate fehlen - bitte setup-production-ssl.sh ausführen'
echo 'Starte ohne SSL für erste Einrichtung...'
mkdir -p ssl
# Temporäre selbst-signierte Zertifikate für ersten Start
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ssl/privkey.pem \
-out ssl/fullchain.pem \
-subj '/CN=michaelschiemer.de'
chmod 644 ssl/fullchain.pem ssl/privkey.pem
fi
"
# 11. Docker Container neu starten
echo -e "${YELLOW}Starte Docker Container neu...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "cd $REMOTE_PATH && docker compose up -d"
# 11. Aufräumen
# 12. Validate production configuration
echo -e "${YELLOW}Validiere Production-Konfiguration...${RESET}"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "cd $REMOTE_PATH && \
# Check environment configuration
APP_ENV=\$(grep '^APP_ENV=' .env | cut -d'=' -f2 | tr -d '\"')
APP_DEBUG=\$(grep '^APP_DEBUG=' .env | cut -d'=' -f2 | tr -d '\"')
echo 'Environment: \$APP_ENV'
echo 'Debug mode: \$APP_DEBUG'
if [ '\$APP_ENV' = 'production' ] && [ '\$APP_DEBUG' = 'false' ]; then
echo '✓ Production environment correctly configured'
else
echo '✗ WARNING: Environment not configured for production!'
exit 1
fi
# Test security endpoints (wait for containers to be ready)
sleep 10
# Test blocked route - should return 404 in production
debug_response=\$(curl -s -o /dev/null -w '%{http_code}' -H 'User-Agent: Mozilla/5.0' https://localhost/debug 2>/dev/null || echo 'connection_failed')
if [ '\$debug_response' = '404' ]; then
echo '✓ Debug routes properly blocked'
else
echo '✗ WARNING: Debug routes not properly blocked (got: \$debug_response)'
fi
"
# 13. Aufräumen
echo -e "${YELLOW}Räume auf...${RESET}"
rm -rf "$TMP_DIR" "$TMP_ARCHIVE"
ssh $SSH_OPTS "$SERVER_USER@$SERVER_IP" "rm /tmp/project.tar.gz"