Skip to content

Fix: use separate env var for ClickHouse native port - #3

Open
mpont91 wants to merge 1 commit into
ent0n29:mainfrom
mpont91:fix/clickhouse-native-port
Open

Fix: use separate env var for ClickHouse native port#3
mpont91 wants to merge 1 commit into
ent0n29:mainfrom
mpont91:fix/clickhouse-native-port

Conversation

@mpont91

@mpont91 mpont91 commented Aug 25, 2026

Copy link
Copy Markdown

The analytics service talks to ClickHouse over two protocols, but both read CLICKHOUSE_PORT:

  • clickhouse_connect over HTTP (8123)
  • clickhouse_driver over native TCP (9000) — in nav_calculator.py, scheduler.py and run_all.py

The Dockerfile pins CLICKHOUSE_PORT=8123, so the native clients hit the HTTP port and fail:

nav_calculator - ERROR - Failed to calculate NAV for PSI-10: Code: 102.
Unexpected packet from server clickhouse:8123 (expected Hello or Exception...)
...same for all 7 funds -> "Calculated NAV for 0 funds"

No single value works for both, so this adds CLICKHOUSE_NATIVE_PORT (default 9000) for the three native call sites. CLICKHOUSE_PORT keeps its HTTP meaning.

Verified locally: NAV goes from 0 to 7 funds, no errors. Also applies to deploy/docker-compose.prod.yaml, which had the same setting.

The analytics service talks to ClickHouse over two protocols but both
read CLICKHOUSE_PORT. The Dockerfile pins it to 8123 (HTTP), so the
clickhouse_driver clients hit the HTTP port and fail with "Code: 102.
Unexpected packet from server", leaving NAV calculated for 0 funds.

Those three call sites now read CLICKHOUSE_NATIVE_PORT (default 9000).
Verified locally: NAV goes from 0 to 7 funds.
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