Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#6,515 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@EmmS21 がすでに取り組んでいます。

2026年7月26日 から。

  • #6547 @EmmS21 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
clickhouse, elixir
領域
backend, databases

調査の方向性

まず ObanErrorReporter.on_job_exception/1 と ImportAnalytics および LocalImportAnalyticsCleaner の worker を見つけ、queue、worker、import_id がどのように対応付けられているかを追跡します。issue に記載された cleaner の失敗経路を再現またはテストします。完了条件は、cleaner の例外によって import が purge されたり失敗としてマークされたりせず、一方で importer の例外については意図された処理が維持されることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Elixir
スター
29.7k
フォーク
1.9k
平均マージ
3日 22時間
マージ済み PR(30日)
50

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plausible/analytics のほかの issue

plausible/analytics の issue をすべて見る

似ている issue

Elixir の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。