fix(scrapers): disable catalog-object SSR beat-cron — DOM.РФ WAF cooldown #516
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#516
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/disable-catalog-ssr-waf-cooldown"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
backend/app/workers/beat_schedule.py:243: закомментирован entryscrape-kn-catalog-objects-weekly(вт 04:00 UTC). Возврат после WAF cooldown 24-48h.Root cause / context
DOM.РФ дал hard-ban на VPS IP после серии failed extras-сессий:
Warm_up из PR #503 получает cookies успешно (
got WAF cookies ['___dmpkit___', 'domain_sid']в worker logs), но WAF всё равно возвращает challenge HTML на/portal-kn/api/sales/portal/tableи/сервисы/api/object/*для нашего IP. Phase A list/portal-kn/api/kn/objectsпока пропускает.Catalog-object SSR (
tasks.scrape_kn_catalog_objects) использует ТОТ ЖЕBrowserSession+ navigates на/сервисы/каталог-новостроек/объект/{id}— точно те же endpoints под WAF. Next beat-tick вт 26.05 04:00 UTC насыпет 300 failed SSR fetches и углубит WAF reputation penalty.What's already done
UPDATE job_settings SET enabled=false WHERE job_type IN ('scrape_kn','objective_sync')— оба DOM.РФ jobs disabled через DBRe-enable plan
/admin/scrapeForce run на 1 объектjob_settings(UPDATE enabled=true для scrape_kn, objective_sync)Test plan
tasks.scrape_kn_catalog_objects.*enqueued (можно проверить через/api/v1/admin/scrape/queueили beat logs)Risk: LOW
DOM.РФ накатил WAF hard-ban на VPS IP после серии failed extras-сессий (run 26/27/28 — суммарно ~15400+ requests с body '<!-- waf -->'). Catalog-object SSR (`tasks.scrape_kn_catalog_objects`) использует тот же BrowserSession и navigates на /сервисы/каталог-новостроек/объект/{id} — точно те же endpoints под WAF. Next beat-tick вт 26.05 04:00 UTC насыпет 300 failed SSR fetches и углубит WAF reputation penalty. Commented out беспрепятственно (без infrastructure change). Возврат после 24-48h WAF cooldown + targeted test через admin/scrape. Параллельные disable'ы через DB job_settings уже сделаны: - scrape_kn (enabled=false) - objective_sync (enabled=false)Deep Code Review — verdict: APPROVE
Summary
backend/app/workers/beat_schedule.py)Cross-file impact (verified)
backend/app/workers/celery_app.py:52— task moduleapp.workers.tasks.scrape_kn_catalog_objectsstill ininclude=list. Worker can execute on demand, no import-error risk on beat reload.backend/app/api/v1/admin_scrape.py:1254— admin endpointapply_asyncpath still intact. Manual trigger via/admin/scrapeworks for re-enable test (per PR plan step 1).backend/tests/workers/test_scrape_kn_catalog_objects.py— untouched, task itself unchanged. No regression coverage needed for beat-toggle.pzz-sync-monthly,nspd-quarter-dump-refresh-weekly) intact — clean surgical edit.What this disables (confirmed)
scrape-kn-catalog-objects-weekly(вт 04:00 UTC, batch 300, region 66)./сервисы/каталог-новостроек/объект/{id}SSR + sharedBrowserSessionas failing extras runs 26/27/28 → continuing would deepen WAF reputation penalty. Correct call.job_settingsrows forscrape_kn+objective_syncalready toggled via DB).Data freshness impact
wall_type,energy_eff,ceiling_height_m,parking_*). Not on core SF read path. Stale window 24-48h acceptable.domrf_kn_objectsrows continue to be served as-is.Re-enable plan (well-formed)
/admin/scrapeForce run → 0 failures gate → uncomment + revert DB toggles. Reasonable.Positive
Risk / reversibility
Merging.