getsentry / getsentry/self-hosted

Debug files being deleted if SENTRY_EVENT_RETENTION_DAYS is lower than 30 days

Open
#3,287 8 comments 1 reaction 0 assignees View on GitHub
Bug
Dominant language
Shell
Stars
9.6k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
12

Description

### Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

### Steps to Reproduce

1. Set SENTRY_EVENT_RETENTION_DAYS lower than 30 days (example is 1 day)
2. Upload a debug file in an project
3. Send events that need this debug file
4. Wait 2 days
5. Send events that need this debug file, date_accessed will not be updated
6. Execute a cleanup setting 1 day
7. Debug file will be removed

### Expected Result

Debug file shouldn't be removed because was used the same day as the cleanup was executed

### Actual Result

Debug file is removed because AVAILABLE_FOR_RENEWAL_DAYS is set to 30 days so `date_accessed` will not be updated inside `maybe_renew_debug_files` method because this field is updated if 30 days has passed

AVAILABLE_FOR_RENEWAL_DAYS should set to 1 day (or maybe less than 24 hours) so any value of SENTRY_EVENT_RETENTION_DAYS greater than 1 (or 0 if is managed in hours) will work the expected way

### Product Area

Processing

### Link

_No response_

### DSN

_No response_

### Version

24.8.0

Contributor guide

Open the contributing guide

Research direction

Locate the maybe_renew_debug_files method and the AVAILABLE_FOR_RENEWAL_DAYS definition, then reproduce the one-day retention scenario from the issue. Verify that using a debug file updates date_accessed before cleanup and that cleanup preserves a recently used debug file when retention is below 30 days.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.