fix(traefik-maljarka-502-bug): diagnosed — root cause CMS-side, не traefik
Bisect через X-Forwarded headers: IIS+CMS возвращает 502 specifically для Host: maljarka.tandemmebel.ru + X-Forwarded-Proto: https. Без XFP=https → 200. URL Rewrite rule из cms-port-leak-fix ставит HTTPS=on/SERVER_PORT=443 → CMS код для этого hostname падает в HTTPS-context. Same class как emspb /admin/assets 500 NullRef, rimiz 404 — pre-existing CMS issues. Side finding: traefik file-watch broken под Docker Desktop Windows (WSL2 9p не пропускает inotify). Rename .yml → .disabled оставался без эффекта 38min после изменения; только docker restart traefik подхватил. Это значит iis-traefik-dead-routes-cleanup был фантомным до сегодняшнего restart 07:42 UTC. 2 новых wiki concepts: traefik-file-watch-wsl2-broken (workarounds) + cms-maljarka-https-mode-crash (3 workarounds + 5 investigation places). Новая follow-up ⚪ cms-maljarka-https-mode-bug-fix. Final smoke post-restart: 7 live hosts ✅ Microsoft-IIS/10.0 без regression, 2 dead routes (sestech, ics-artmaterials) → 404 (cleanup теперь real). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
26
STATUS.md
26
STATUS.md
@@ -55,12 +55,26 @@ _Updated: 2026-05-21_
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ⚪ [traefik-maljarka-502-bug] — `maljarka.tandemmebel.ru` через traefik HTTPS → 502, backend 200
|
## 🟢 [traefik-maljarka-502-bug] — diagnosed: root cause = CMS-side, не traefik
|
||||||
**Status:** ready (заведена 2026-05-21 в ходе [[iis-traefik-dead-routes-cleanup]]).
|
**Status:** done (2026-05-21 — diagnosed; fix отложен в новую ⚪ task [[cms-maljarka-https-mode-bug-fix]]).
|
||||||
**Symptom:** `docker exec traefik wget --spider https://maljarka.tandemmebel.ru/` → 502 Bad Gateway. Direct `wget --header='Host: maljarka.tandemmebel.ru' http://host.docker.internal:8089/` (тот же путь без traefik chain) → 200 OK Microsoft-IIS/10.0, 43KB HTML body.
|
**Root cause найден через bisect headers:** IIS+CMS возвращает **502 specifically для `Host: maljarka.tandemmebel.ru` + `X-Forwarded-Proto: https`**. Другие cms hosts (tandemmebel, emspb, etc.) с XFP=https → 301/200 корректно. Без XFP=https maljarka → 200 OK (43KB "Малярка от Тандеммебель"). Mechanism: URL Rewrite rule из [[cms-server-port-leak-fix]] ставит HTTPS=on/SERVER_PORT=443 → CMS код падает specifically для этого hostname в HTTPS-context (NullRef / missing config / redirect loop — нужно искать). Same class как `emspb /admin/assets 500 NullRef`, `rimiz.ru 404` — pre-existing CMS issues выявленные миграцией.
|
||||||
**Config sanity:** `maljarka.yml` синтаксически identical работающему `tandemmebel.yml` (same router shape, same service `http://host.docker.internal:8089/`, same `passHostHeader: true`). LE cert для `maljarka.tandemmebel.ru` присутствует в `acme.json`.
|
**Side findings:**
|
||||||
**Next action:** (1) `docker exec traefik wget -O - https://maljarka.tandemmebel.ru/ 2>&1 | head -50` посмотреть точное traefik error response; (2) check traefik access logs (нужно включить если выключены) для конкретного path; (3) попробовать `docker restart traefik` (может быть stale state — traefik uptime 38h); (4) compare маljarka.yml header bytes (BOM, line endings) с tandemmebel.yml — может скрытая разница.
|
1. **Traefik file-watch broken под Docker Desktop Windows** (WSL2 9p mount не пропускает inotify) — обнаружено через тест: rename .yml → .disabled, route остаётся active в runtime. Wiki concept [[traefik-file-watch-wsl2-broken]] с workarounds. Любой config change требует `docker restart traefik`.
|
||||||
**Priority:** low — site responds 200 через прямой path; traefik 502 затрагивает только публичный HTTPS доступ. Если этот subdomain критичен для tandemmebel — повысить priority.
|
2. **Dead routes cleanup был фантомным** до restart — sestech/ics-artmaterials .disabled только сегодня стали реально 404'нуться (после моего restart 07:42 UTC).
|
||||||
|
**Verification post-restart:** 7 live hosts (emspb/on.snolla/www.tandemmebel/kupimknigi/pilorama98/labtools.ru/labtools.pro) — Microsoft-IIS/10.0 ✅ без regression. 2 dead routes (sestech, ics-artmaterials) → 404 (cleanup теперь real). Maljarka 502 — без изменений (CMS-side, не traefik).
|
||||||
|
**Branch:** master
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚪ [cms-maljarka-https-mode-bug-fix] — `maljarka.tandemmebel.ru` падает 502 в HTTPS-mode IIS
|
||||||
|
**Status:** ready (заведена 2026-05-21 как follow-up к diagnosed [[traefik-maljarka-502-bug]]). Полный mechanism в [[cms-maljarka-https-mode-crash]] wiki concept.
|
||||||
|
**Scope:** CMS code (или CMS DB config) для `maljarka.tandemmebel.ru` ASP.NET-падает с 502 когда `HTTPS=on`/`SERVER_PORT=443` server vars выставлены URL Rewrite rule'ом. Без HTTPS-context — 200 OK. Эффект: site недоступен через публичный HTTPS chain.
|
||||||
|
**Next action:**
|
||||||
|
1. IIS logs `C:\inetpub\logs\LogFiles\W3SVC*\` — найти request с Host=maljarka.tandemmebel.ru + XFP=https, sub-status code.
|
||||||
|
2. Event Viewer → Application → ASP.NET errors с stack trace.
|
||||||
|
3. CMS DB: per-host config table — есть ли запись для maljarka.tandemmebel.ru с HttpsUrl/BaseUrl/etc.
|
||||||
|
4. Если quick fix критичен: workaround A в wiki concept (strip X-Forwarded-Proto в maljarka middleware) или workaround B (negate condition в URL Rewrite rule).
|
||||||
|
**Priority:** depends — насколько критичен maljarka.tandemmebel.ru для tandemmebel.ru клиента. Если real customer traffic — high. Если test/internal subdomain — low.
|
||||||
**Branch:** master
|
**Branch:** master
|
||||||
**Done:** bak-серия `.bak-pre-attempt2-2026-05-19` для 13 yml; IIS binding `snolla *:8089` + Stop/Start Website; loop-detect через `host.docker.internal:8089` ≠ NAT loop (resolves to 192.168.65.254 host gateway) ✅; 11 cms yml (snolla, rimiz, labtools, labtoolspro, pilorama98, tandemmebel, emspb, kupimknigi, maljarka, sestech, isc-artmaterials) patched `:18080 → :8089`; host-side smoke 20 hostnames → все `Server: Microsoft-IIS/10.0` ✅; 📱 phone-tests (mobile internet): `emspb.ru` ✅, `labtools.ru` ✅; traefik logs clean (only known docker.sock noise); pre-existing CMS issues подтверждены и НЕ regression: `rimiz.ru/ics-artmaterials.com 404` (CMS-routing); `snolla.com` 301 → `on.snolla.com` (canonical default subdomain), `on/pilorama98/labtools/emspb.snolla.com` 200 OK.
|
**Done:** bak-серия `.bak-pre-attempt2-2026-05-19` для 13 yml; IIS binding `snolla *:8089` + Stop/Start Website; loop-detect через `host.docker.internal:8089` ≠ NAT loop (resolves to 192.168.65.254 host gateway) ✅; 11 cms yml (snolla, rimiz, labtools, labtoolspro, pilorama98, tandemmebel, emspb, kupimknigi, maljarka, sestech, isc-artmaterials) patched `:18080 → :8089`; host-side smoke 20 hostnames → все `Server: Microsoft-IIS/10.0` ✅; 📱 phone-tests (mobile internet): `emspb.ru` ✅, `labtools.ru` ✅; traefik logs clean (only known docker.sock noise); pre-existing CMS issues подтверждены и НЕ regression: `rimiz.ru/ics-artmaterials.com 404` (CMS-routing); `snolla.com` 301 → `on.snolla.com` (canonical default subdomain), `on/pilorama98/labtools/emspb.snolla.com` 200 OK.
|
||||||
**Done (stayer):** stayer routes user'ом подтверждены «внутренние, наружу не светим» → `stostayer.yml → stostayer.yml.disabled`, `oldstostayer.yml → oldstostayer.yml.disabled`; `docker restart traefik`; verify: `stostayer.snolla.com`/`old.stostayer.ru` → 404 traefik no-route ✅; host IIS sites `stostayer :8090`/`stostayer.old :8091` остаются live для прямого/локального доступа (CMS отвечает контент, headers stripped через WinHTTP proxy на curl, но изнутри traefik / production-path headers Microsoft-IIS/ASP.NET корректные).
|
**Done (stayer):** stayer routes user'ом подтверждены «внутренние, наружу не светим» → `stostayer.yml → stostayer.yml.disabled`, `oldstostayer.yml → oldstostayer.yml.disabled`; `docker restart traefik`; verify: `stostayer.snolla.com`/`old.stostayer.ru` → 404 traefik no-route ✅; host IIS sites `stostayer :8090`/`stostayer.old :8091` остаются live для прямого/локального доступа (CMS отвечает контент, headers stripped через WinHTTP proxy на curl, но изнутри traefik / production-path headers Microsoft-IIS/ASP.NET корректные).
|
||||||
|
|||||||
52
cms-maljarka-https-mode-bug-fix.md
Normal file
52
cms-maljarka-https-mode-bug-fix.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# cms-maljarka-https-mode-bug-fix
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Починить `maljarka.tandemmebel.ru` чтобы он отвечал 200 (не 502) через публичный HTTPS chain. Root cause diagnosed в [[traefik-maljarka-502-bug]]: IIS+CMS падает на этом hostname когда `HTTPS=on`/`SERVER_PORT=443` выставлены URL Rewrite rule'ом. Full mechanism — wiki concept [[cms-maljarka-https-mode-crash]].
|
||||||
|
|
||||||
|
## Key files
|
||||||
|
|
||||||
|
- `C:\sites\snolla\Web.config` — URL Rewrite rule "ForwardedProto-HTTPS" из [[cms-server-port-leak-fix]]
|
||||||
|
- `C:\inetpub\logs\LogFiles\W3SVC*\` — IIS logs site `snolla` (нужно найти sub-status 502.x для конкретного request)
|
||||||
|
- CMS DB — table с per-host config (per [[recovery-architecture-snapshot]], CMS использует MSSQL контейнер)
|
||||||
|
- CMS source: `MoreThenCms.Admin\Mis\Web\Mvc\UrlHelpers\UrlHelpers.cs:14-37` (`Url.SiteRoot()`) — паттерн из [[cms-server-port-leak-fix]]; возможно тут helper падает specifically на этом host
|
||||||
|
|
||||||
|
## Bisect-trace evidence
|
||||||
|
|
||||||
|
```
|
||||||
|
direct backend Host: maljarka.tandemmebel.ru → 200 OK (43KB)
|
||||||
|
direct backend Host: maljarka.tandemmebel.ru + X-Forwarded-For → 200 OK
|
||||||
|
direct backend Host: maljarka.tandemmebel.ru + X-Forwarded-Proto:https → 502 ← триггер
|
||||||
|
direct backend Host: tandemmebel.ru + X-Forwarded-Proto:https → 301 (correct)
|
||||||
|
```
|
||||||
|
|
||||||
|
Single variable: `X-Forwarded-Proto: https` для этого specific hostname.
|
||||||
|
|
||||||
|
## Next action
|
||||||
|
|
||||||
|
1. **IIS logs**:
|
||||||
|
```powershell
|
||||||
|
Get-Content 'C:\inetpub\logs\LogFiles\W3SVC1\u_extend1*.log' -Tail 500 | Select-String 'maljarka' | Select-Object -Last 20
|
||||||
|
```
|
||||||
|
Найти sub-status (502.3 = bad gateway, 502.4 = no server, 502.5 = ARR config, etc.).
|
||||||
|
|
||||||
|
2. **Event Viewer**:
|
||||||
|
```powershell
|
||||||
|
Get-EventLog -LogName Application -Source 'ASP.NET*' -Newest 50 | Where-Object Message -Match 'maljarka' | Format-List
|
||||||
|
```
|
||||||
|
Stack trace покажет точное место crash.
|
||||||
|
|
||||||
|
3. **CMS DB inspection** — есть ли запись для `maljarka.tandemmebel.ru` в table с per-host URLs, и поле HttpsUrl/BaseUrl не NULL ли там.
|
||||||
|
|
||||||
|
4. **Quick workaround если real customer traffic** — apply Workaround B из [[cms-maljarka-https-mode-crash]] (negate condition в URL Rewrite rule for this Host). Backup Web.config first.
|
||||||
|
|
||||||
|
## Open questions
|
||||||
|
|
||||||
|
- [ ] Какой priority? Зависит от того real customer traffic на `maljarka.tandemmebel.ru` или это internal/test subdomain.
|
||||||
|
- [ ] Если CMS bug — fix CMS code или DB hot-fix?
|
||||||
|
- [ ] DLL patch для null-guard (от [[cms-admin-assets-root-folders-seed]]) — может тот же класс bugов; может в одном вылазе чинить вместе.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- 3 workarounds + 5 investigation places задокументированы в [[cms-maljarka-https-mode-crash]] wiki concept.
|
||||||
|
- Не trivially связан с [[cms-server-port-leak-fix]] — там URL Rewrite rule добавлен правильно, но CMS код в этом конкретном случае ломается. Регрессия CMS, не fix'а.
|
||||||
Reference in New Issue
Block a user