Filestore lifecycle expiry (as recommended in External Storage docs) deletes avatars, causing NoSuchKey 500s
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, python
- Lĩnh vực
- backend, documentation
Hướng nghiên cứu
The traces point to sentry/services/filestore/s3.py (the get path that raises NoSuchKey), sentry/models/files/abstractfile.py (getfile), and sentry/models/avatars/base.py (get_cached_photo). The External Storage docs page is the other place to read. The issue does not choose between the three suggestions (docs warning, separate bucket or prefix for long-lived files, cleanup of unreferenced blobs), so a newcomer would need a maintainer decision before coding. Done is not defined in the payload.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Self-Hosted Version
26.10.1
CPU Architecture
x86_64
Docker Version
N/A (Kubernetes deployment)
Docker Compose Version
N/A (Kubernetes deployment)
Machine Specification
- My system meets the minimum system requirements of Sentry
Installation Type
Existing install, filestore on an S3-compatible backend (sentry.filestore.s3.S3Boto3Storage)
Steps to Reproduce
- Configure the filestore on S3 (or any S3-compatible storage), as described in Self-Hosted External Storage.
- Upload an organization avatar (user and project avatars are affected the same way).
- Follow that page's guidance: since
sentry cleanupdoesn't delete external-storage files, add a bucket lifecycle rule that expires objects afterSENTRY_EVENT_RETENTION_DAYS(90 here). #3315 confirms this as the recommended approach. - Wait until the avatar's blob is older than the retention period.
- Load any page that shows the avatar.
Expected Result
Following the documented retention guidance doesn't destroy data that Sentry expects to keep forever. Either the docs say which filestore objects must not expire, or long-lived files are stored somewhere a blanket age-based rule can't reach.
Actual Result
The lifecycle rule deletes the avatar's FileBlob, but the File/FileBlobIndex rows still point at it. Every avatar request now returns a 500 error:
NoSuchKey: An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
sentry/services/filestore/s3.py in file
sentry/models/files/abstractfile.py in getfile
sentry/models/avatars/base.py in get_cached_photo
sentry/web/frontend/base.py in get (transaction: /organization-avatar/{organization_slug}/{avatar_id}/)
Without bucket versioning the file can't be recovered, so the avatar has to be uploaded again. Under the same rule it expires again after another retention period.
The filestore puts every blob under a content-addressed key (e.g. 68/8e1f/ead61b4f...), so nothing in the key shows what kind of file it is. That rules out a prefix-scoped rule, so there's no way to configure storage-side retention that protects long-lived files. The same applies to other filestore data that is expected to outlive event retention, such as release artifacts/source maps and debug files.
Suggestions, roughly in order of effort:
- Docs: warn on the External Storage page that a blanket age-based expiry on the filestore bucket also deletes avatars, and likely release files and debug files, and that the DB will still reference them.
- Separate storage for long-lived files: let avatars (and other non-event files) use their own bucket or key prefix, so lifecycle rules can target event data only.
- Cleanup: have
sentry cleanupdelete unreferenced blobs on external storage too, so a storage-side expiry isn't needed at all.
Event ID
No response
- Ngôn ngữ chính
- Shell
- Star
- 9.7k
- Fork
- 2k
- Merge trung bình
- 3 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/self-hosted
-
Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
getsentry/self-hosted#4644 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
getsentry/self-hosted#4518 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Waiting for: Product Owner
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 73/100
getsentry/self-hosted#4642 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Waiting for: Community
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
getsentry/self-hosted#4637 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Waiting for: Product Owner
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
getsentry/self-hosted#4629 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của getsentry/self-hosted
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ajithakdev/claude-desktop-rpm#43 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws/aws-networking-best-practices#256 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:terraform source:reader type:content-error
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
stephrobert/blog-roadmap#268 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fossi-foundation/globalfoundries-pdk-libs-gf180mcu_fd_pv#61 ·
-
ChatGPT directory is behind mainĐang mởopenai-directory
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100