"Does the customer have a custom Keycloak extension?" is the wrong first question. We upgraded Keycloak with a custom extension installed, across five major versions. The upgrade succeeded. The extension stopped working. Nothing failed. That silence is the problem.
Having a custom SPI is not, by itself, a risk. Two things decide it: which API your code touches, and which kind of provider it is. One of the four kinds fails without so much as an error in the request.
The environment
Keycloak official image, start against external Postgres 16.15, single node. 1,002 users, 2 realms. Hetzner CCX33 (8 vCPU, 30 GB RAM), JVM -Xms1g -Xmx4g. Providers built against 25.0.6 (or 21.1.2), loaded on 26.7.1, crossing the 26.0.0 API-removal boundary. A lab; the numbers are ours and reproducible.
First, the good news
We built an event listener that uses only stable SPI, compiled it against 21.1.2, and loaded it on 26.7.1. It delivered user and admin events correctly. Five major versions in between, and 907 public API signatures removed across that span. Yet the same source compiles unchanged against 21.1.2, 25.0.6, 26.0.0 and 26.7.1, and runs on all of them.
That number matters. Most of a 907-signature removal list costs you nothing, because your extension never calls most of those methods. "The customer has a custom SPI" is not, on its own, a reason to expect trouble. The trouble is in the intersection of two things: the signatures Keycloak removed, and the signatures your jar actually references.
And the removal list is not where intuition puts it. We diffed the public surface of five artifacts across every hop of the ladder:
| Hop | Signatures removed |
|---|---|
| 26.7.0 → 26.7.1 (patch) | 0 |
| 26.0.0 → 26.7.1 (one major) | 400 |
| 21.1.2 → 26.7.1 (five majors) | 907 |
| a typical minor hop | 17 to 137 |
Patch releases remove nothing. Minor releases remove real surface. One hop, 26.2.0 → 26.3.0, removed 137, in the same band as a major boundary. Staying inside a major buys nothing. Only the patch level does.
The two axes of risk: which API, and which artifact
"Which API" is not the only question. We found a second axis while building fixtures for the other provider types.
Which artifact the SPI lives in. Keycloak marks some SPIs "internal - may change without notice." Event listeners trigger that warning (KC-SERVICES0047), so do authenticators, and so do protocol mappers. All three live in keycloak-server-spi-private, the artifact with no compatibility promise. User federation (UserStorageProvider) does not trigger it. It is a public SPI.
But the user-storage SPI has a trap of its own. Its FQN never changed; its artifact did. org.keycloak.storage.UserStorageProvider shipped in keycloak-model-legacy through 23.0.7, moved to keycloak-model-storage at 24.0.0, and keycloak-model-legacy stopped being published at 25.0.0. A user-federation provider built for ≤23 breaks its build on the 23→24 hop: the old coordinate still resolves at 24.x but no longer carries the class. At 25 it stops resolving at all. No import changes to warn you. Same class name, new coordinates.
So the assessment question is not "do they have extensions" but two finer ones: which signatures their jars reference, and which artifact those SPIs live in.
The silent failure
The provider that actually broke was an event listener that called KeycloakModelUtils.runJobInTransactionWithResult(...), a three-argument helper present in 25.0.6 and removed in 26.0.0, replaced by a four-argument overload. A listener that wants its own transaction to forward an event would plausibly reach for exactly that.
We built it against 25.0.6 and loaded the jar on 26.7.1. Startup was indistinguishable from success:
- the server started in 15 seconds
- the provider loaded and printed its init line
- it appeared in
/admin/serverinfoalongside the built-in listeners - the readiness check passed
Every check an operator runs during a maintenance window passed. Then the first event arrived:
ERROR KC-SERVICES0085: Failed to send type to lab.LabBrittleEventListener:
java.lang.NoSuchMethodError: KeycloakModelUtils.runJobInTransactionWithResult(...)
And the blast radius was nil, which is the problem. The admin request that triggered the event returned 201. The group was created. The token endpoint returned 200. The container stayed up. Keycloak's own admin_event_entity kept recording normally, 1,015 rows, so anyone auditing Keycloak's audit trail sees a complete one. If that listener was shipping your authentication events to a SIEM, the events stopped and your dashboard says everything is fine.
The same mistake, four provider types, four different outcomes
A natural question: is the listener special, or is this how all extensions die? We built the identical removed-API call into one of each provider type: event listener, authenticator, user-storage provider, protocol mapper. We loaded them all on 26.7.1. The matrix splits two ways.
First, the load-vs-use half: none of the four fails at load. Keycloak never invokes a provider's work method during startup, so a removed API that only the work method reaches never breaks the upgrade itself. All four start clean, register, and pass readiness. The breakage is deferred to first use, in every case.
Second, the silent-vs-loud half, which does not generalize:
| Provider type | Fails at | Visibility |
|---|---|---|
| event listener | first event | silent, the request succeeds |
| authenticator | first login | loud, HTTP 500 |
| user-storage | first lookup | loud, HTTP 500 |
| protocol mapper | first token | loud, HTTP 500 |
The difference is not the provider; it is where Keycloak calls it. Authentication and user-lookup and token-issuance paths propagate the NoSuchMethodError out as an uncaught server error: HTTP 500, a real failure someone investigates. Event dispatch swallows the exception, so the login keeps succeeding while the audit events silently stop.
A smoke test that asks "can users still log in?" catches a broken authenticator, a broken user-federation provider and a broken protocol mapper, and misses the one failure that is actually invisible: the listener.
Why it is lazy, and why that makes it worse
Java links a method the first time it is called. A removed call sitting in init() breaks loudly at startup, and that is the lucky case, because you find it during the window. A removed call sitting in the request path breaks quietly, hours later, under load. By then the window is closed and the change looks unrelated.
/admin/serverinfo is the trap in the middle. It proves the class loaded; it says nothing about whether it works. Every broken fixture in the matrix was listed there, healthy, right up until the moment it was invoked.
What to check after the upgrade
- Fire one real event, one real login, and one real token. A readiness
probe reaches none of them. Then grep the log for
KC-SERVICES0085andNoSuchMethodError(andAbstractMethodError). That, not "does it start", is the check. - For the listener specifically, verify it produced output, because "users can log in" does not touch it. A listener's own log line, or a fresh event in whatever it forwards to, is the only evidence it is alive.
- Run the assessment the cheap way first: rebuild the extension against the
target version and let the compiler answer. It cost one build to turn "might break" into
no suitable method found, with a file and line number. Then diff signatures (spi-api-diff), inspect what the jars reference (jdeps/javap), and intersect. Only the intersection is work. Our tame fixture crossed five majors and 907 removals with an empty one.
What we did not test
- A removed API called from
init()rather than a work method. We did not run it. The mechanism predicts it fails at startup, which is the safe case. - Behavioural breakage. A method that survives with changed semantics is invisible to a signature diff, and is the harder class we did not measure.
- The token-transform surface a mapper depends on lives in
keycloak-services, which our diff tool does not yet cover, so mapper breakage is under-counted the same way user-storage was before the model-artifact fix. - Postgres only, single node, 25.0.6-built jars on 26.7.1.
Keycloak Advisory Watch - one email per advisory batch, within 72 hours of publication, listing the patched versions per maintained minor line. Double opt-in, no tracking pixels, no click tracking, public archive. Subscribe.
Self-hosted Keycloak is one of the things we keep patched, upgraded and owned for teams that run it but have nobody to run it. Talk to us about your project.
Sources: 2026-08-25-s7-custom-spi, api-removals-by-hop, 2026-08-26-provider-types, 2026-08-26-provider-types-protocol-mapper-brittle, 2026-08-26-provider-types-brittle-protocol-mapper, 2026-08-26-userstorage-artifact-split-narrowed.