All my versions were supported and the application would not start
Five breakages in three weeks pinning a stack. Not one piece had anything wrong with it on its own: what fails is the combination, and it breaks first in the tools that inspect, not in the ones that merely use.
Pinning the versions for Lineward looked like an afternoon’s work: pick stable ones, inside their support window, write it into an architecture decision record and move on. It took me three weeks and five breakages, and not one of them was a defective piece.
1. Both supported, together they do not start
Spring Boot 4.0.2 and PostgreSQL 18.1. Both stable, both inside support. Together:
Unsupported Database: PostgreSQL 18.1That is not a warning you can ignore, it is a startup failure. The cause: that line of Boot manages a version of Flyway older than PostgreSQL 18. Flyway queries the server version on connecting, compares it against a list it carries inside the jar, and refuses.
The engine worked perfectly. So did the driver, because a driver only speaks the protocol and the protocol does not change between major versions. What was out of date was the idea the tool had of the world, and that idea travelled inside a jar.
2. The official image moved the data
The PostgreSQL 18 container refused to start with a Compose file written the way that has worked for years:
Error: in 18+, these Docker images are configured to store database data
in a format which is compatible with "pg_ctlcluster"Since 18, the image stores data in a subdirectory named after the major
version, so that an upgrade can operate inside a single mount point. The volume
goes on /var/lib/postgresql, not /var/lib/postgresql/data. And the image
detects data in the old path and refuses to continue, rather than starting and
leaving you a surprise for later, which is appreciated.
In the same session, a third instance: Keycloak 26 renamed the variables that
create the initial administrator. KEYCLOAK_ADMIN is no longer what half the
internet documents, it is now KC_BOOTSTRAP_ADMIN_USERNAME.
3. It started in 0.667 seconds and had migrated nothing
This is the worst of the five, because it raised no error.
With the first migration written and the tests green against a throwaway PostgreSQL, I started the application for real and it created no tables:
Started LinewardApplication in 0.667 secondsEmpty database. Zero mentions of Flyway in the whole log. There was no error: there was silence.
Spring Boot 4 split autoconfiguration into one module per technology.
flyway-core provides the migration engine, but the piece that wires it into
the framework lives in another artifact, and that one was not declared. Without
it nobody configures Flyway and nobody complains, because nothing is broken: it
simply does not exist.
The tests passed because they configured Flyway by hand, programmatically. That is, they tested the migration and not the startup.
In the same session the same pattern showed up again, that time loudly: Testcontainers 2.x renamed all of its modules, and the PostgreSQL artifact is now called something else. That one failed noisily, at dependency resolution, which is how they should all fail.
4. The error that names the mechanism, not the missing piece
Writing an API test against the simulator cost three chained failures, all of the same family: in Boot 4 the test client is no longer where it was, you have to ask for it with an annotation, and the class that builds it also moved to a module of its own.
The interesting one was the third. The message said:
Error processing condition on ...TestRestTemplateTestAutoConfigurationIt is pointing at the evaluation of a condition. The class that was actually
missing appeared several causes further down the trace. Autoconfiguration
evaluates conditions by reflecting over the type a method returns; if that
class is not on the classpath, what blows up is the evaluation, not the bean
creation. A missing class shows up where it is looked at, not where it is
used, and in a framework with a lot of indirection that can be very far from
the real place. The pattern to look for in the trace is ClassNotFoundException
or NoClassDefFoundError, which is the only one that names the piece.
The pattern
| Breakage | The piece was | What failed |
|---|---|---|
| Flyway and PostgreSQL 18 | Supported | The version list inside the jar |
| PostgreSQL 18 image | Supported | The volume path convention |
| Keycloak 26 variables | Supported | The name of the variable |
| Flyway autoconfiguration | Supported | A module nobody declared |
| Testcontainers 2 modules | Supported | The name of the artifact |
Two things come out of this.
The risk surface of a stack is the product of its versions, not the list. Verifying piece by piece gives false reassurance, because every piece is correct. What has to be verified is the combinations, and that is only done by starting it.
A major database version breaks the tools that inspect it first (migrations, administrative clients, test containers) and not the ones that merely use it. That produced the policy the project has written down: the criterion for a major bump is not the database’s release date, it is that the tools which inspect it declare it supported.
And the uncomfortable one
In the second case, the error message itself carried the cause, the recommended fix and the link to the discussion. Searching for it online would have cost me more time than reading it.
Almost every published Compose example uses the old path, and will keep using it for years. The collective knowledge of the internet ages faster than the official documentation, and copying a two year old example is riskier than reading today’s error.