Skip to content

How to upgrade self-hosted Sentry from v21.5.0 to latest with minimal downtime on production environment? #3795

Open
@siva-mareedu

Description

@siva-mareedu

Self-Hosted Version

21.5.0

CPU Architecture

x86_64

Docker Version

20.10.21

Docker Compose Version

1.26.0

Machine Specification

  • My system meets the minimum system requirements of Sentry

Steps to Reproduce

  1. cd /opt/sentry
  2. git checkout main; git pull
  3. git checkout local_sentry;
  4. git merge --no-ff 21.5.0 -m "Merge tag '21.5.0' into local_sentry"
  5. Fixed the Conflicts in .env [keeping only latest changes of images]
  6. docker-compose down;
  7. docker-compose up -d
  8. docker-compose ps

Events are not flowing after this;

Expected Result

We are running a self-hosted Sentry (v21.4.1) on an EC2 instance which is deployed around 4 years ago. We want to upgrade to the latest version without losing the existing events in the system but we’re facing issues due to the large version gap.

We've Tried:: We attempted incremental upgrades (one version at a time). However, this approach is very time-consuming, and during one upgrade from v21.4.1 to v21.5.0, we experienced a 3-hour delay in event processing. The relay container showed repeated authentication errors like the following:

2025-06-30T09:57:29Z [relay_server::actors::upstream] ERROR: authentication encountered error: could not send request to upstream caused by: error sending request for url (http://web:9000/api/0/relays/register/response/): connection error: Connection reset by peer (os error 104)

2025-06-30T09:57:47Z [relay_server::actors::upstream] ERROR: authentication encountered error: could not send request to upstream caused by: error sending request for url (http://web:9000/api/0/relays/register/response/): connection error: Connection reset by peer (os error 104)

We verified that communication is working fine from relay and web manually through performing curl inside relay containers, but still throwing above error.
Although the issue eventually resolved itself, we are concerned that this will repeat in each upgrade step with causing long and repeated downtimes, which is not acceptable for our production system.

What We’re Looking For:: We’re looking for a safe and efficient way to upgrade from v21.4.1 to the latest self-hosted Sentry version (e.g. 25.x) with minimal downtime and no data loss.

We’re considering two approaches:

  1. Direct Upgrade: Is it possible to upgrade directly from v21.4.1 → latest? What are the potential issues or migration steps involved?
  2. Fresh Install + Data Migration: Can we migrate existing data (projects, issues, events, users, etc.) to newly created self hosted sentry instance ?? Are there recommended ways to achieve this using tools or scripts ?

Additional Details

Environment: PROD (EC2 instance with self hosted sentry deployment using docker-compose.yml).
Downtime tolerance: Minimal downtime preferred (a few minutes acceptable).
We are okay with either method (upgrade in-place or fresh install), as long as the existing production data is preserved and system reliability is maintained.

Any guidance, best practices or documentation links would be much appreciated.

Thank you !!

Actual Result

Got below errors during update to 21.5.0 from 21.4.1.
2025-06-30T09:57:29Z [relay_server::actors::upstream] ERROR: authentication encountered error: could not send request to upstream caused by: error sending request for url (http://web:9000/api/0/relays/register/response/): connection error: Connection reset by peer (os error 104)

2025-06-30T09:57:47Z [relay_server::actors::upstream] ERROR: authentication encountered error: could not send request to upstream caused by: error sending request for url (http://web:9000/api/0/relays/register/response/): connection error: Connection reset by peer (os error 104)

We want to upgrade our sentry to latest versions without losing data. Any guidance, best practices or documentation links would be much appreciated.

Event ID

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions