Skip to content

fix(sentry): pin clickhouse to the version sentry 26.7 actually needs - #158

Merged
TheMeinerLP merged 1 commit into
mainfrom
fix/sentry-clickhouse-version
Aug 16, 2026
Merged

fix(sentry): pin clickhouse to the version sentry 26.7 actually needs#158
TheMeinerLP merged 1 commit into
mainfrom
fix/sentry-clickhouse-version

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Collaborator

Fixes the failed install from #156 and corrects a wrong call in the design.

Symptom

sentry-snuba-migrate failed seven times, so the Sentry HelmRelease never went Ready:

MigrationInProgress: events_analytics_platform: 0050_add_attributes_array_column

Migrations 0049 and 0050 are wedged at in_progress: a first run died mid-migration, and every later run refuses to touch a group that still has one open. ClickHouse itself is healthy — zero restarts, no OOM.

Cause

The clickhouse chart from sentry-kubernetes carries appVersion 23.8, while upstream self-hosted Sentry builds from altinity/clickhouse-server:25.3.6.10034.altinitystable.

The design justified that chart as "the version Snuba is tested against". True once; not for Sentry 26.7, whose events_analytics_platform migrations need the newer server. My mistake.

Fix

  • Pin image/imageVersion to the Altinity build upstream uses.
  • Disable the replica StatefulSet. It is gated on remote_servers.replica.backup.enabled, not on replicas, so replicas: 1 still left clickhouse-replica-0 running — with no Zookeeper it can never sync.

Rendered: one StatefulSet, correct image, replicas: 1, no replica services.

Manual step after merge

ClickHouse holds no real data yet, so the wedged state is cleared by starting fresh:

kubectl -n sentry delete pvc -l app.kubernetes.io/name=clickhouse
flux reconcile helmrelease clickhouse -n sentry

🤖 Generated with Claude Code

The install never finished. sentry-snuba-migrate failed seven times with

  MigrationInProgress: events_analytics_platform:
    0050_add_attributes_array_column

and the migrations table showed 0049 and 0050 both stuck at in_progress: a
first run died mid-migration, and every later run refuses to touch a group
that still has one open.

The cause is the ClickHouse version. The sentry-kubernetes clickhouse chart
carries appVersion 23.8, while upstream self-hosted Sentry builds its image
from altinity/clickhouse-server:25.3.6.10034.altinitystable. Choosing that
chart was justified in the design as "the version Snuba is tested against" --
true once, but not for Sentry 26.7, whose events_analytics_platform
migrations need the newer server.

Also disables the replica StatefulSet. It is gated on
remote_servers.replica.backup.enabled, not on replicas, so `replicas: 1` left
a second unsynchronisable copy running -- there is no Zookeeper for it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Qx7mKDeDhysBWsqtqM1yr
@TheMeinerLP
TheMeinerLP merged commit f598c97 into main Aug 16, 2026
5 checks passed
@TheMeinerLP
TheMeinerLP deleted the fix/sentry-clickhouse-version branch August 16, 2026 11:47
TheMeinerLP added a commit that referenced this pull request Aug 16, 2026
…ers dir (#162)

The image pin from #158 was necessary but not sufficient: the upgrade still
failed and Flux rolled back to 23.8 five times, reporting

  StatefulSet/sentry/clickhouse status: 'Failed'

The image itself is fine -- it pulls and runs. What breaks is the entrypoint.
ClickHouse images from 24.x on run a user-setup step: with neither
CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD set, it writes
users.d/default-user.xml to disable network access for `default`. This chart
mounts users.d from a ConfigMap, so that path is read-only and the container
dies before the server starts:

  /entrypoint.sh: line 156:
    /etc/clickhouse-server/users.d/default-user.xml: Read-only file system

Verified by running the image with the chart's three ConfigMaps mounted: it
fails exactly there, and starts cleanly once CLICKHOUSE_SKIP_USER_SETUP=1 is
set. The chart's users ConfigMap already defines `default`, so skipping the
step is correct rather than a workaround.

The chart has no env: block -- it only exports SHARD in the container
command -- so this cannot come from values and is patched in via the
postRenderer that already sets the priority class.


Claude-Session: https://claude.ai/code/session_017Qx7mKDeDhysBWsqtqM1yr

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
TheMeinerLP added a commit that referenced this pull request Aug 16, 2026
…ers dir (#164)

The image pin from #158 was necessary but not sufficient: the upgrade still
failed and Flux rolled back to 23.8 five times, reporting

  StatefulSet/sentry/clickhouse status: 'Failed'

The image itself is fine -- it pulls and runs. What breaks is the entrypoint.
ClickHouse images from 24.x on run a user-setup step: with neither
CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD set, it writes
users.d/default-user.xml to disable network access for `default`. This chart
mounts users.d from a ConfigMap, so that path is read-only and the container
dies before the server starts:

  /entrypoint.sh: line 156:
    /etc/clickhouse-server/users.d/default-user.xml: Read-only file system

Verified by running the image with the chart's three ConfigMaps mounted: it
fails exactly there, and starts cleanly once CLICKHOUSE_SKIP_USER_SETUP=1 is
set. The chart's users ConfigMap already defines `default`, so skipping the
step is correct rather than a workaround.

The chart has no env: block -- it only exports SHARD in the container
command -- so this cannot come from values and is patched in via the
postRenderer that already sets the priority class.


Claude-Session: https://claude.ai/code/session_017Qx7mKDeDhysBWsqtqM1yr

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant