# Keycloak operator 25.0.0 upgrade instance fails on db migration

**URL:** <https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427>\
**Category:** Configuring the server\
**Tags:** database\
**Created:** [June 10, 2024, 3:43pm UTC](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427 "2024-06-10T15:43:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lauer](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lauer/32/10623_2.png) [@lauer](https://forum.keycloak.org/u/lauer)\
**Post date:** [June 10, 2024, 3:43pm UTC](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427/1 "2024-06-10T15:43:39Z")

</div>

So our KeyCloak operator automatic updated to v25.0.0, and hereafter our deployed instance container stopped working.

```auto
{
    "timestamp": "2024-06-10T15:38:07.803176109Z",
    "sequence": 9868,
    "loggerClassName": "org.jboss.logging.Logger",
    "loggerName": "org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler",
    "level": "ERROR",
    "message": "Error details:",
    "threadName": "main",
    "threadId": 1,
    "mdc": {},
    "ndc": "",
    "hostName": "keycloak-prod-0",
    "processName": "QuarkusEntryPoint",
    "processId": 1,
    "exception": {
        "refId": 1,
        "exceptionType": "org.keycloak.models.ModelException",
        "message": "Incorrect state of migration. You are trying to run server version '25.0.0' against a database which was migrated to snapshot version '999.0.0'. Databases that have been migrated to a snapshot version can't be migrated to a released version of Keycloak or to a more recent snapshot version.",
        "frames": [
            {
                "class": "org.keycloak.storage.datastore.DefaultMigrationManager",
                "method": "migrate",
                "line": 151
            },
            <snip>
        ]
    }
}

```

How can I solve this migration errors in DB? It gues it was running v24 before.

Also, when the container starts, it have this warning.

```auto
Changes detected in configuration. Updating the server image.
Updating the configuration and installing your custom providers, if any. Please wait.
2024-06-10 15:37:55,940 WARN [org.key.qua.run.cli.Picocli] (main) The following used options or option values are DEPRECATED and will be removed or their behaviour changed in a future release:
	- proxy: Use proxy-headers.
Consult the Release Notes for details.
2024-06-10 15:38:00,503 INFO [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 3977ms
Server configuration updated and persisted. Run the following command to review the configuration:

	kc.sh show-config

Next time you run the server, just run:

	kc.sh --verbose start --optimized

```

---

<div class="post-metadata">

**Author:** ![lauer](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lauer/32/10623_2.png) [@lauer](https://forum.keycloak.org/u/lauer)\
**Post date:** [June 11, 2024, 1:00pm UTC](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427/2 "2024-06-11T13:00:48Z")

</div>

I solved this by login to the postgresql database and deleted the 999 version migration from migration\_model.

---

<div class="post-metadata">

**Author:** ![lauer](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/lauer/32/10623_2.png) [@lauer](https://forum.keycloak.org/u/lauer)\
**Post date:** [June 11, 2024, 1:01pm UTC](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427/3 "2024-06-11T13:01:28Z")

</div>

also note this fixed bug: [Entry 999.0.0 in MIGRATION\_MODEL prevents future migrations of the database · Issue #27941 · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/issues/27941)
