self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Migration workflow_engine.0087_relink_crons_to_compatible_issue_workflows faulty

Open adepretis opened this issue 11 months ago • 14 comments

Self-Hosted Version

25.12.0

CPU Architecture

x86_64

Docker Version

28.5.1

Docker Compose Version

2.40.2

Machine Specification

  • [x] My system meets the minimum system requirements of Sentry

Installation Type

Upgrade from 25.10.0

Steps to Reproduce

Run ./install.sh

Expected Result

All good

Actual Result

Upgrade fails because of migration:

Migration workflow_engine.0087_relink_crons_to_compatible_issue_workflows is applied before its dependency monitors.0013_delete_monitor_is_muted_field on database 'default'

Reason seems to be https://github.com/getsentry/sentry/commit/6cae2701721b42db85e4897fd04c801491bec226

I worked around it for now by adding the following to x-sentry-defaults.volumes in docker-compose.yml:

- "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro"

with ./patches/0087_relink_crons_to_compatible_issue_workflows.py being the previous version of that file.

Migrations did run successful then:

Running migrations for default
Operations to perform:
  Apply all migrations: auth, contenttypes, discover, explore, feedback, flags, hybridcloud, insights, monitors, nodestore, notifications, preprod, prevent, releases, replays, sentry, sessions, sites, social_auth, tempest, uptime, workflow_engine
Running migrations:
  Applying feedback.0007_cleanup_failed_safe_deletes... OK
  Applying hybridcloud.0024_add_project_distribution_scope... OK
  Applying monitors.0011_backfill_monitor_environment_is_muted...Monitors
 OK
  Applying monitors.0012_remove_monitor_is_muted_field... OK
  Applying monitors.0013_delete_monitor_is_muted_field... OK
  Applying preprod.0018_add_preprod_artifact_app_icon_id_field... OK
  Applying preprod.0019_add_tooling_version_fields... OK
  Applying sentry.0997_add_has_trace_metrics_bit_to_project_model... OK
  Applying sentry.0998_add_prebuilt_id_to_dashboards... OK
  Applying sentry.0999_add_extrapolation_mode_to_snuba_query... OK
  Applying prevent.0001_create_prevent_ai_configuration... OK
  Applying prevent.0002_alter_integration_id_not_null... OK
  Applying sentry.1000_add_project_distribution_scope... OK
  Applying sentry.1001_prevent_grouphistory_infinte_recursion... OK
  Applying releases.0002_delete_dual_written_commit_tables... OK
  Applying releases.0003_real_delete_dual_written_commit_tables... OK
  Applying releases.0004_cleanup_failed_safe_deletes... OK
  Applying sentry.1002_group_history_prev_history_remove_db_constraint... OK
  Applying sentry.1003_group_history_prev_history_safe_removal... OK
  Applying sentry.1004_group_history_prev_history_delete... OK
  Applying sentry.1005_add_groupemailthread_project_date_index... OK
  Applying sentry.1006_drop_legacy_incidentseen_incidentsubscription... OK
  Applying sentry.1007_cleanup_failed_safe_deletes... OK
  Applying sentry.1008_loosen_unique_title_contraint... OK
  Applying sentry.1009_add_date_updated_to_organizationmapping... OK
  Applying sentry.1010_add_organizationcontributors_table... OK
  Applying sentry.1011_update_oc_integration_cascade_to_null... OK
  Applying replays.0007_organizationmember_replay_access... OK
  Applying sentry.1012_add_event_id_to_open_period... OK
  Applying sentry.1013_add_repositorysettings_table... OK
  Applying tempest.0003_use_encrypted_char_field... OK
  Applying uptime.0048_delete_uptime_status_columns... OK
  Applying uptime.0049_cleanup_failed_safe_deletes... OK
  Applying workflow_engine.0094_backfill_issue_stream_detector_workflows... OK
  Applying workflow_engine.0095_unique_detectorgroup_group... OK
  Applying workflow_engine.0096_delete_non_single_written_fire_history... OK
  Applying workflow_engine.0097_add_unique_constraint_to_datasource... OK
  Applying workflow_engine.0098_detectorgroup_detector_set_null... OK
  Applying workflow_engine.0099_backfill_metric_issue_detectorgroup... OK
  Applying workflow_engine.0100_move_is_single_written_to_pending... OK
  Applying workflow_engine.0101_remove_is_single_written_field... OK
  Applying workflow_engine.0102_cleanup_failed_safe_deletes... OK
  Applying workflow_engine.0103_add_unique_constraint... OK
  Applying workflow_engine.0104_action_data_fallthrough_type... OK

Event ID

No response

adepretis avatar Dec 17 '25 02:12 adepretis

I encountered the same issue. Could you please advise on how to resolve it?

yujingwyh avatar Dec 17 '25 11:12 yujingwyh

I encountered the same issue. Could you please advise on how to resolve it?

  1. Create a folder named patches in the root of the git repo
  2. Download this file to that folder https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py e.g. wget -O patches/0087_relink_crons_to_compatible_issue_workflows.py https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py
  3. Edit docker-compose.yaml look for a line starting x-sentry-defaults then under volumes add - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" This is my git diff
+++ b/docker-compose.yml
@@ -76,6 +76,7 @@ x-sentry-defaults: &sentry_defaults
     - "./sentry:/etc/sentry"
     - "./geoip:/geoip:ro"
     - "./certificates:/usr/local/share/ca-certificates:ro"
+    - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" 
 x-snuba-defaults: &snuba_defaults
   <<: *restart_policy
   depends_on:
  1. Run the install script as normal

rwkyqwertee avatar Dec 17 '25 11:12 rwkyqwertee

I encountered the same issue. Could you please advise on how to resolve it?

  1. Create a folder named patches in the root of the git repo
  2. Download this file to that folder https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py e.g. wget -O patches/0087_relink_crons_to_compatible_issue_workflows.py https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py
  3. Edit docker-compose.yaml look for a line starting x-sentry-defaults then under volumes add - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" This is my git diff
+++ b/docker-compose.yml
@@ -76,6 +76,7 @@ x-sentry-defaults: &sentry_defaults
     - "./sentry:/etc/sentry"
     - "./geoip:/geoip:ro"
     - "./certificates:/usr/local/share/ca-certificates:ro"
+    - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" 
 x-snuba-defaults: &snuba_defaults
   <<: *restart_policy
   depends_on:
  1. Run the install script as normal

After the update is successful, should the patches be deleted and the entry removed from docker-compose.yml?

janignjic avatar Dec 17 '25 22:12 janignjic

I confirm this worked, thanks a lot!

I guess we can remove patch, can we?

cocorossello avatar Dec 18 '25 13:12 cocorossello

@rwkyqwertee : I owe you a beer. This fixed my self hosted POC that was put on ice a week or two ago.

Gazzonyx avatar Dec 18 '25 13:12 Gazzonyx

+1

Tabll avatar Dec 21 '25 16:12 Tabll

I encountered the same issue. Could you please advise on how to resolve it?

  1. Create a folder named patches in the root of the git repo
  2. Download this file to that folder https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py e.g. wget -O patches/0087_relink_crons_to_compatible_issue_workflows.py https://raw.githubusercontent.com/getsentry/sentry/b2246d4d66b5288fb1832c9f655a602e223eac6e/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py
  3. Edit docker-compose.yaml look for a line starting x-sentry-defaults then under volumes add - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" This is my git diff
+++ b/docker-compose.yml
@@ -76,6 +76,7 @@ x-sentry-defaults: &sentry_defaults
     - "./sentry:/etc/sentry"
     - "./geoip:/geoip:ro"
     - "./certificates:/usr/local/share/ca-certificates:ro"
+    - "./patches/0087_relink_crons_to_compatible_issue_workflows.py:/usr/src/sentry/src/sentry/workflow_engine/migrations/0087_relink_crons_to_compatible_issue_workflows.py:ro" 
 x-snuba-defaults: &snuba_defaults
   <<: *restart_policy
   depends_on:
  1. Run the install script as normal

Thank you so much, this is very effective.

Tabll avatar Dec 22 '25 02:12 Tabll

this will be fixed in next release ?

hheexx avatar Dec 23 '25 08:12 hheexx

this will be fixed in next release ?

This issue has the Self-hosted: Next Release tag added to it now ;)

darrelajonas avatar Dec 23 '25 08:12 darrelajonas

How about 25.12.1 ?

hheexx avatar Dec 23 '25 12:12 hheexx

25.12.1 is now released. It should include a fix for the issue here

https://github.com/getsentry/self-hosted/releases/tag/25.12.1

hubertdeng123 avatar Dec 23 '25 17:12 hubertdeng123

I can confirm that upgrading from 25.10.0 to 25.12.1 (skipping over 25.12.0) works fine :)

darrelajonas avatar Jan 05 '26 13:01 darrelajonas

I will close this issue in the meantime, feel free to open up a new one if you have another problem :) Enjoy your self-hosted sentry!

aldy505 avatar Jan 07 '26 00:01 aldy505

I will close this issue in the meantime, feel free to open up a new one if you have another problem :) Enjoy your self-hosted sentry!

On a personal note, If this self-hosted POC gets traction, I'm going to extract a cheque from accounting and make it "not my problem" in the best way possible. :) But, self-hosting is the easiest way to iterate quickly before officially starting a New Technology Proposal, so I really appreciate that it's offered and not treated like a second class citizen by the team and community.

Gazzonyx avatar Jan 07 '26 15:01 Gazzonyx