Skip to content

Migrations failure due to syntax error #7719

@amithalle

Description

@amithalle

Environment

Self hosted 26.1.0

Steps to Reproduce

  1. Deploy sentry helm chart - app version 26.1.0 with snuba 26.1.0 - a clean, new installation.
  2. use clickhouse with the documented supported version 23.8.11.29.altinitystable (deployed using the altinity operator) with replication and clickhouse keeper.
  3. snuba migrations run as part of the helm chart as a pre-install hook and FAIL

Expected Result

I expect migrations to complete properly and helm chart to continue deployment

Actual Result

Snuba migrations filed at migration 0050 with the following error:

Syntax error: failed at position 95 ('='): =128) CODEC (ZSTD(1)) AFTER attributes_float_39;
Expected one of: data type, nested table, identifier, token, Comma.

The failing query:

ALTER TABLE eap_items_1_local ADD COLUMN IF NOT EXISTS attributes_array JSON(max_dynamic_paths=128) CODEC (ZSTD(1)) AFTER attributes_float_39;

I tracked the code to a relatively new migration file snuba/snuba_migrations/events_analytics_platform/0050_add_attributes_array_column.py.

What I tried:

  1. upgrade the clickhouse version - not worked
  2. reverse the migration (using snuba cli snuba migrations reverse-in-progress) and retry - not working
  3. downgrade sentry and snuba to 25.10.0 - migration was not introduced and all is working (a migration reverse was still needed as the migration was marked as failed)

side note - during my troubleshooting, I noted that the documentation states a specific (and quite old) version of clickhouse. however, in the code there are min and max versions

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions