Upgrade 16.6.1 → 16.9.x on MariaDB leaves database empty: `MySQL5InnoDBDialect` no longer exists (Hibernate 7), but bundled `hibernate.properties` still recommends it
#3203
-
-
State changed as build OD-8782 (16.9.8) is successful
-
OneDev
changed state to 'Closed' 1 week ago
Previous Value Current Value Open
Closed
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
16.9.7
|
| Labels |
No labels
|
Issue Votes (0)
Summary
Upgrading a Docker installation that uses MariaDB from 16.6.1 to 16.9.7 fails at the "Restoring database with new program" step. The cause is that
org.hibernate.dialect.MySQL5InnoDBDialectcannot be loaded. The new release shipshibernate-core-7.4.8.Final, and that class no longer exists there. The dialect is still the one recommended for MySQL and MariaDB in theconf/hibernate.propertiestemplate shipped with 16.9.7.By the time the failure happens, the old program has already cleaned the database. The rollback ("Error cleaning database") then fails as well. The result is an empty database and a container that refuses to start onevery later restart with
Unable to upgrade specified installation as database is not populated yet.On my instance this happened twice. The first time (on 2026-10-19, with the image I pulled then) it went unnoticed, and the server was down for 6 days with an empty database. The logs from that attempt are gone because the container was removed. The pre-upgrade backup it left behind and the identical symptoms point to the same cause.
Environment
1dev/server:latestsha256:114926cff102b98e54138093e57c2de24b7e9b783b99e8834634fdec1e218a50release.properties: version=16.9.7, commit=bad54da1host.docker.internalhibernate-core-5.4.24.Final. Hibernate in new image:hibernate-core-7.4.8.Finalorg.mariadb.jdbc.Driver(bundledmariadb-java-client-2.3.0.jar)Relevant compose environment (as it had been running since 2026-05 without problems):
These values are what the MariaDB section of the shipped
conf/hibernate.propertiessays to use. The 16.9.7 template still contains this:The MySQL section of the template also names
MySQL5InnoDBDialect.Dialect classes present in
hibernate-core-7.4.8.Final.jar(MySQL/MariaDB family):Steps to reproduce
hibernate_dialect=org.hibernate.dialect.MySQL5InnoDBDialect, as the template recommends.docker compose stop && docker rm onedev && docker pull 1dev/server && docker compose up -dActual result
The upgrade log (trimmed; "Exporting table …" lines removed):
After this, the database contains only
o_ClusterServerando_DatabaseLock. Every later start of the container fails like this:That message gives no hint that an earlier upgrade attempt emptied the database, or that a backup can be restored from
site/db-backup/.Expected result
site/db-backup/.Workaround (confirmed working)
hibernate_dialect=org.hibernate.dialect.MariaDBDialect. This class exists in both Hibernate 5.4 (old program) and Hibernate 7.4 (new program).docker compose up -d. The upgrade then completes ("Successfully upgraded /opt/onedev"), and 16.9.7 runs with all data present.Suggested fixes
conf/hibernate.properties(MySQL and MariaDB sections) toorg.hibernate.dialect.MySQLDialect/org.hibernate.dialect.MariaDBDialect.incompatibilities.mdfor the release that moved to Hibernate 6/7. Currently there is no mention of dialect changes.Upgrade, verify that the new program can boot Hibernate with the effective configuration (or map legacy dialect names to their replacements) before runningclean-dbwith the old program.Existing issues I checked before filing
I searched the issue tracker on 2026-10-25 and found no existing report of this. Searches performed:
"dialect"~MySQL5InnoDBDialect~~upgrade~~hibernate~~dialect~ or ~MariaDB~ or ~MySQL~ or "database is not populated"OneDev MySQL5InnoDBDialect upgrade failed Hibernate "Unable to resolve name" dialectRelated but different:
MariaDBDialect, and it doesn't involve upgrades.MySQL5InnoDBDialect, caused by a missing table rather than a missing dialect class.Apologies if this duplicates an issue I missed. Some search pages showed "Connection lost or session expired" while loading.