refactor: improve logging system and add deployment fixes
- Enhance logging handlers (Console, DockerJson, File, JsonFile, MultiFile) - Improve exception and line formatters - Update logger initialization and processor management - Add Ansible playbooks for staging 502 error troubleshooting - Update deployment documentation - Fix serializer and queue components - Update error kernel and queued log handler
This commit is contained in:
22
DEPLOYMENT_FIX.md
Normal file
22
DEPLOYMENT_FIX.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Deployment Fix f?r Staging 502 Error
|
||||
|
||||
Das Problem: Nach jedem Deployment tritt der 502-Fehler wieder auf.
|
||||
|
||||
## L?sung: Deployment-Script erweitern
|
||||
|
||||
F?ge nach Zeile 991 in `.gitea/workflows/build-image.yml` folgenden Code ein:
|
||||
|
||||
```yaml
|
||||
# Fix nginx upstream configuration - critical fix for 502 errors
|
||||
# sites-available/default uses 127.0.0.1:9000 but PHP-FPM runs in staging-app container
|
||||
echo \"?? Fixing nginx PHP-FPM upstream configuration (post-deploy fix)...\"
|
||||
sleep 5
|
||||
docker compose exec -T staging-nginx sed -i '/upstream php-upstream {/,/}/s|server 127.0.0.1:9000;|server staging-app:9000;|g' /etc/nginx/sites-available/default || echo \"?? Upstream fix (127.0.0.1) failed\"
|
||||
docker compose exec -T staging-nginx sed -i '/upstream php-upstream {/,/}/s|server localhost:9000;|server staging-app:9000;|g' /etc/nginx/sites-available/default || echo \"?? Upstream fix (localhost) failed\"
|
||||
docker compose exec -T staging-nginx nginx -t && docker compose restart staging-nginx || echo \"?? Nginx config test or restart failed\"
|
||||
echo \"? Nginx configuration fixed and reloaded\"
|
||||
```
|
||||
|
||||
**Position:** Nach Zeile 991 (`docker compose restart staging-app || echo \"?? Failed to restart staging-app\"`) und vor Zeile 993 (`echo \"? Waiting for services to stabilize...\"`)
|
||||
|
||||
**Grund:** Die Container werden mit `--force-recreate` neu erstellt, wodurch die Datei `/etc/nginx/sites-available/default` wieder aus dem Docker-Image kommt und `127.0.0.1:9000` verwendet. Dieser Fix muss nach jedem Deployment ausgef?hrt werden.
|
||||
Reference in New Issue
Block a user