Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ObanErrorReporter purges imported data when the cleanup worker crashes — silent loss of completed CSV imports

Aperta Adatta ai principianti
#6,515 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@EmmS21 ci sta già lavorando.

Dal 26/7/2026.

  • #6547 di @EmmS21 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
clickhouse, elixir
Ambito
backend, databases

Direzione di ricerca

Inizia individuando ObanErrorReporter.on_job_exception/1 e i worker ImportAnalytics e LocalImportAnalyticsCleaner, quindi traccia il modo in cui vengono associati queue, worker e import_id. Riproduci o testa il percorso di errore del cleaner descritto nell’issue; il lavoro è completato quando le eccezioni del cleaner non possono eliminare un import né contrassegnarlo come fallito, mentre le eccezioni dell’importer mantengono la gestione prevista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: CE v3.2.1 (self-hosted, community-edition compose)

Summary: ObanErrorReporter.on_job_exception/1 matches crashed Oban jobs by queue: "analytics_imports" + presence of import_id in args — it never checks which worker crashed. Plausible.Workers.LocalImportAnalyticsCleaner runs in that same queue with import_id in its args. When the cleaner crashes (in our case: File.rm! → :eacces on import CSVs owned by a different uid), the reporter misinterprets it as a failed import:

  • attempts 1–19 → import_fail_transient/1 → Plausible.Purge.delete_imported_stats!/1 — deletes the completed import's ClickHouse data while site_imports.status still reads completed
  • attempt 20 (discard) → import_fail/1 → import marked failed + failure email

Observed impact: 15 successful local-storage CSV imports had all their data purged ~1 hour after completion (the cleaner's first scheduled run), while dashboards showed the imports as completed for 13 days. The only user-visible signal came two weeks later when the cleaner jobs exhausted retries and each import flipped to failed with a "please try the import again" email.

Repro sketch: complete a local CSV import, make the uploaded files un-deletable by the app user (e.g. chown root them), wait for the cleaner's scheduled run, observe imported_* tables purged for that import_id while the import still reads completed.

Suggested fix: scope on_job_exception/1 to worker: "Plausible.Workers.ImportAnalytics" (or exclude the cleaner), so cleanup failures can't purge import data. Arguably the cleaner also shouldn't share consequences with importers at all despite sharing the queue.

Happy to provide fuller forensics (query_log timelines, oban job history) if useful.

Lingua principale
Elixir
Stelle
29.7k
Fork
1.9k
Merge medio
3g 22h
PR unite (30g)
50

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di plausible/analytics

Tutte le issue di plausible/analytics

Issue simili

Altre issue su Elixir

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.