Skip to content

[EDP][ERAG] Files uploaded through the SeaweedFS webhook are re-ingested on every sync #99

Open

Description

@alexatosatos

Use the real S3 ETag from SeaweedFS events when registering files

Fixes the bug reported in the issue: process_seaweedfs_event() stored new_entry.attributes.md5 — a base64 of the raw 16-byte MD5 digest — as the file's ETag. The sync diff compares against the ETag reported by the S3 API (hex MD5 digest), so every file uploaded through the webhook was permanently flagged "update" and re-ingested (delete + re-embed) on every Synchronize.

Change

src/edp/app/main.py (process_seaweedfs_event, create/update/rename branch):

  • Prefer new_entry.extended['Seaweed-X-Amz-ETag'] — SeaweedFS stores the actual S3 ETag string base64-encoded there — and decode it.
  • Fall back to attributes.get('md5', '') when the extended block is absent (older SeaweedFS versions), preserving current behaviour in that case.
  • Add the now-required import base64.

No schema or API change. Multipart uploads are covered because the stored ETag includes the -N suffix, exactly as the S3 API reports it.

Validation (live E-RAG 2.3.0 deployment, SeaweedFS 4.22, k3s)

  • S3 PUT → create event → file registered with ETag bb12e3559a339bb1fd93367929ef071a, identical to the S3 HEAD value; ingestion completed; GET /api/files/sync → "no action" with no manual Synchronize.
  • S3 DELETE → delete event → DB row and vector chunks removed.
  • Rows previously stored with the base64 value were repaired with a one-off UPDATE files SET etag=... and are stable.

fix.patch
issue.md
pr-description.md

Activity

  1. added
    bug
    on Oct 29, 2026
  2. changed the title [-]fix(edp): use the real S3 ETag from SeaweedFS events when registering files[/-] [+][EDP][ERAG] Files uploaded through the SeaweedFS webhook are re-ingested on every sync[/+] on Oct 29, 2026
  3. sys-aibot commented on Oct 29, 2026

    @sys-aibot

    Thanks for the detailed report and the fix, @alexatosatos!

    Triage: title aligned with our [Category][Repo] convention, labelled bug. The report is complete: it names the function and comes with a fix. The fix is under review in #105; this issue will be closed when it merges.

  4. added a commit that references this issue on Nov 26, 2026
    98fbd00
  5. added a commit that references this issue on Dec 4, 2026
    d96b5b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions