Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .changeset/aio-documentdb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@hyperdx/api': minor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 P1 — Breaking all-in-one change ships as a minor bump, so the floating :2 and latest tags pick it up

release.yml (around lines 859–864 and 1052–1057) retags every release as ${IMAGE}:${MAJOR} and latest. The PR description's own repro uses clickstack-all-in-one:2. With a minor changeset, anyone tracking :2 who pulls or restarts gets an image that exits at boot (because of the WiredTiger gate) or, with the opt-in set, starts with an empty metadata database. Either mark this major or publish it under a new image major tag, so existing :2 deployments don't hit the breaking upgrade unannounced.

Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond

---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change shipped as minor bump

High Severity

The changeset marks this as a minor bump of @hyperdx/api, but the all-in-one image now refuses to boot on an existing /data/db volume (or starts empty if HYPERDX_ACCEPT_EMPTY_METADATA=true). Release tagging still promotes every release to :2 and latest, so anyone tracking those tags who pulls or restarts gets a crash loop or an empty metadata database (users, sources, dashboards, alerts).

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9e64f12. Configure here.


feat: store all-in-one metadata in DocumentDB instead of MongoDB 4.0.5

DocumentDB is MIT licensed and runs on Postgres 18, which removes the SSPL
licence and the critical OpenSSL 1.1.1k CVEs that came with the bundled MongoDB.
Metadata still lives on the `/data/db` mount, now under `/data/db/pgdata`. The
image cannot read the MongoDB files already there, so it refuses to start on a
`/data/db` volume that holds them. Users, sources, dashboards and alerts saved by
an older image need to be moved across once, or set
`HYPERDX_ACCEPT_EMPTY_METADATA=true` to start with an empty database instead:

1. Stop the old container, then start its MongoDB on its own:
`docker run -d --name old-mongod -v <volume>:/data/db --entrypoint mongod <old-image> --dbpath /data/db --bind_ip_all`
2. Dump it with the 4.0 tools, since newer `mongodump` refuses MongoDB 4.0:
`docker run --rm --network container:old-mongod mongo:4.0.5 mongodump --db hyperdx --archive > hyperdx.archive`
3. Remove `old-mongod`, start the new image with the same `/data/db` volume and
`-e HYPERDX_ACCEPT_EMPTY_METADATA=true`, and wait for the UI to load.
4. Restore into it, then restart the container:
`docker run --rm -i --network container:<new-container> mongo:7.0 mongorestore --uri "mongodb://hyperdx:hyperdx@localhost:10260/?authMechanism=SCRAM-SHA-256" --ssl --tlsInsecure --drop --archive < hyperdx.archive`

The old MongoDB files stay in `/data/db` until you delete them.
2 changes: 1 addition & 1 deletion .github/actions/e2e-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ runs:
shell: bash
run: |
docker buildx create --use --driver=docker-container
docker buildx build docker/documentdb -t hyperdx/documentdb:local --cache-to "type=gha,mode=max,scope=documentdb" --cache-from "type=gha,scope=documentdb" --load
docker buildx build . -f docker/hyperdx/Dockerfile --target documentdb -t hyperdx/documentdb:local --cache-to "type=gha,mode=max,scope=documentdb" --cache-from "type=gha,scope=documentdb" --load

- name: Start E2E Docker Compose
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:
docker/hyperdx/**
docker/clickhouse/**
docker/otel-collector/**
.vex/**
docker/documentdb/**
- name: Setup Docker Buildx
if:
github.event_name != 'pull_request' ||
Expand Down
150 changes: 0 additions & 150 deletions .vex/openssl-mongodb.vex.json

This file was deleted.

3 changes: 2 additions & 1 deletion agent_docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ yarn dev # or equivalently: make dev
- Docker Compose manages ClickHouse, DocumentDB, OTel Collector
- The metadata store is [DocumentDB](https://github.com/documentdb/documentdb)
(Postgres plus a Mongo wire-protocol gateway), built from
`docker/documentdb/Dockerfile`. The API still talks to it through Mongoose.
the `documentdb` stage of `docker/hyperdx/Dockerfile`, the same build the
all-in-one image ships. The API still talks to it through Mongoose.
To browse it with MongoDB Compass or `mongosh`, connect to
`mongodb://hyperdx:hyperdx@localhost:<HDX_DEV_MONGO_PORT>/?tls=true&tlsAllowInvalidCertificates=true&authMechanism=SCRAM-SHA-256`.
Everything works except Compass's Performance tab (the gateway doesn't
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ services:
- internal
db:
image: hyperdx/documentdb:local
build: ./docker/documentdb
build:
context: .
dockerfile: docker/hyperdx/Dockerfile
target: documentdb
environment:
DOCDB_USER: hyperdx
DOCDB_PASSWORD: hyperdx
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ services:
hdx.dev.service: documentdb
hdx.dev.port: '${HDX_DEV_MONGO_PORT:-27017}'
image: hyperdx/documentdb:local
build: ./docker/documentdb
build:
context: .
dockerfile: docker/hyperdx/Dockerfile
target: documentdb
environment:
DOCDB_USER: hyperdx
DOCDB_PASSWORD: hyperdx
Expand Down
48 changes: 0 additions & 48 deletions docker/documentdb/Dockerfile

This file was deleted.

3 changes: 3 additions & 0 deletions docker/documentdb/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ set -euo pipefail
if [ "$(id -u)" = 0 ]; then
# Volumes may be root-owned or hold lost+found, and initdb needs an empty dir it owns.
install -d -o postgres -g postgres -m 700 "$PGDATA"
# Data dirs created before postgres was pinned to UID 70 hold files under the old UID.
# Hardlinks are skipped so a planted link can't hand postgres a root-owned file.
find "$PGDATA" -xdev ! -user postgres \( -type d -o -links 1 \) -exec chown -h postgres:postgres {} +
exec su-exec postgres "$0" "$@"
fi

Expand Down
Loading
Loading