ObanErrorReporter purges imported data when the cleanup worker crashes — silent loss of completed CSV imports
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
調査の方向性
まず 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 whilesite_imports.statusstill readscompleted - 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
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plausible/analytics のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
plausible/analytics#5201 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
plausible/analytics#5200 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
[Tracker] Scroll-depth tracking still forces layout on large pages after #6174対応中かも @trotzig が 21 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
メンテナーはふだん 2 日以内に返信
plausible/analytics の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
MustacheCase/zanadir#403 ·
メンテナーはふだん 1 日以内に返信
-
pip: same package pinned twice with different casing in pyproject.toml, only the first pin is updated対応中かも @v-abhishekbhaskar が 1 日前に担当しました。 オープンL: python L: ruby:bundler T: bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
dependabot/dependabot-core#16756 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
feat: signup pageオープンd: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100