Commit 9ab4a39
chore(mongo): upgrade embedded MongoDB from 6.0 to 7.0 (#41743)
## Summary
Upgrades the embedded MongoDB in the Appsmith Docker image from 6.0 (EOL
July 2024) to 7.0.
- **`base.dockerfile`** — switches apt repo, GPG key, and list file from
the MongoDB `6.0` stream to `7.0`. Stays on the jammy (22.04) packages
because MongoDB doesn't publish a noble (24.04) apt repo yet — same
pattern the 6.0 install already used on Ubuntu 24.04. Local smoke build
installs `mongodb-org 7.0.31` and `mongosh 2.8.2`.
- **`mongodb-fixer.sh`** — writes a `.appsmith-mongo-fcv-min` marker
file into the Mongo data directory once mongod is confirmed running
under this release. Contents record the **minimum FCV this release
commits to preserve** (constant `6.0`) — a release-level contract, not a
live FCV reading. FCV is deliberately **not** raised to 7.0 — keeping it
at 6.0 preserves the ability to downgrade back to a 6.x Appsmith
release. Raise-FCV scaffolding and a marker-value bump can come back
when MongoDB 8 needs it.
- **`entrypoint.sh`** — adds `ensure_mongodb_fcv_compatible`, a
pre-flight check that runs before supervisord starts mongod. MongoDB 7.0
refuses to start on data with FCV < 6.0; without this check, supervisord
would retry mongod three times and give up, leaving the container in a
confusing degraded state with no clear signal to the administrator.
Reader only — never writes the marker. Only runs when there's existing
local-Mongo data (gated on `shouldPerformInitdb=0 && isUriLocal=0`
inside the function).
### Decision matrix
| Data dir | Marker | Action |
|---|---|---|
| Fresh install | n/a | Skipped — nothing to check. Fixer writes the
marker (constant `6.0`) on first real boot under supervisord. |
| Has data | Present | Fast path — proceed, zero overhead. |
| Has data | Missing | One-time `mongod --fork` probe. If it starts,
proceed (fixer writes the marker on first boot under supervisord). If it
fails, hard-fail with an actionable error pointing users to roll back to
Appsmith v1.99 first. |
Marker presence alone is what's trusted — the fixer writes it only after
mongod is confirmed running under this release, so presence is proof
this release successfully boots on this data. The value (`6.0`) is
diagnostic: future Appsmith releases can inspect it to reason about
upgrade safety.
Linear:
[APP-14867](https://linear.app/appsmith/issue/APP-14867/task-upgrade-mongo-base-image-in-appsmith-to-v7)
## Test plan
- [x] **Fresh install**: empty `/appsmith-stacks` → entrypoint skips the
FCV check (`shouldPerformInitdb=0` gate is false), `init_replica_set`
initializes the data, supervisord starts mongod, fixer writes
`.appsmith-mongo-fcv-min` with `6.0`. Second boot: marker present → fast
path, skip probe.
- [x] **Happy-path upgrade**: boot `appsmith-ce:v1.99` (last 6.x
release), let the fixer run (FCV stays at 6.0), stop. Swap to this image
and boot — entrypoint runs the probe (marker from prior image is
missing), probe succeeds, fixer writes the marker. Subsequent boots are
fast.
- [x] **Failed + remediated upgrade**: boot `appsmith-ce:v1.69` (last
mongo-5 release, pre-v1.70 cutover) to seed FCV 5.0 data. Swap to this
image → expected **hard fail** with error block pointing to v1.99
rollback. Swap to `appsmith-ce:v1.99` → fixer raises FCV 5.0 → 6.0. Swap
back to this image → probe succeeds, marker written. Verifies the error
path *and* that the remediation instructions actually work end-to-end.
- [x] **Marker-missing transitional path**: with the marker present, `rm
/appsmith-stacks/data/mongodb/.appsmith-mongo-fcv-min`, reboot.
Entrypoint should log `running one-time compatibility probe`, probe
succeeds, fixer re-writes the marker.
- [x] **Base image smoke build**: `docker build -f
deploy/docker/base.dockerfile .` succeeds on linux/arm64. Image contains
`mongodb-org 7.0.31` and `mongosh 2.8.2`.
- [x] **CE→EE sync**: cherry-pick onto `community/release` and merge
into EE `release` both apply cleanly (verified locally).
- [x] **Fresh install** smoke-tested locally with the current DP image —
probe skipped on `shouldPerformInitdb=0` gate, marker written by fixer
after supervisord starts mongod.
## Out of scope
- `deploy/helm/` chart still references Bitnami MongoDB 6.0.27 in
`Chart.yaml` / `values.yaml`. That's tracked under a separate effort.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Upgraded bundled MongoDB from 6.0 to 7.0.
* **New Features**
* Added a startup compatibility probe that detects incompatible
local/embedded MongoDB feature versions and halts startup with operator
guidance when needed.
* Added a persistent marker to record confirmed DB compatibility and
skip repeated probes on subsequent startups.
* Improved post-startup DB feature-version handling to record and
persist the committed minimum FCV.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- This is an auto-generated comment: Cypress test results -->
> [!WARNING]
> Tests have not run on the HEAD
af34f2d yet
> <hr>Tue, 05 May 2026 22:44:32 UTC
<!-- end of auto-generated comment: Cypress test results -->
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c268bce commit 9ab4a39
3 files changed
Lines changed: 121 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
337 | 411 | | |
338 | 412 | | |
339 | 413 | | |
| |||
633 | 707 | | |
634 | 708 | | |
635 | 709 | | |
| 710 | + | |
636 | 711 | | |
637 | 712 | | |
638 | 713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
6 | 33 | | |
7 | 34 | | |
8 | 35 | | |
9 | 36 | | |
10 | 37 | | |
11 | 38 | | |
12 | 39 | | |
13 | | - | |
| 40 | + | |
14 | 41 | | |
15 | 42 | | |
16 | 43 | | |
17 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
18 | 51 | | |
19 | 52 | | |
20 | | - | |
21 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
22 | 58 | | |
23 | | - | |
| 59 | + | |
24 | 60 | | |
25 | 61 | | |
26 | 62 | | |
27 | 63 | | |
28 | 64 | | |
| 65 | + | |
| 66 | + | |
29 | 67 | | |
30 | 68 | | |
31 | 69 | | |
0 commit comments