[GH-ISSUE #2486] Cloudbeaver fails to load management database after restart #813

Closed
opened 2026-03-07 20:55:05 +03:00 by kerem · 0 comments
Owner

Originally created by @LifetimeMistake on GitHub (Mar 20, 2024).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/2486

Describe the bug
I'm attempting to run Cloudbeaver with Docker Compose. Upon starting the container it initializes successfully and I can go through the setup phase in the web UI. After entering a license key everything seems to be working (I can add users, connections, etc.). However, after restarting the container, the server fails to reload the database, leading to a crash.

Curiously, this occurs regardless of the driver being used to store the mangement DB (I tried H2, mysql and postgres, giving me the same result) or whether I complete the setup phase or not.

To Reproduce
Steps to reproduce the behavior:

  1. Start a fresh instance of Cloudbeaver EE in Docker.
  2. Wait for the database migration to complete and the web server to start
  3. Restart the container
  4. Observe the crash with an error related to database schema migration

Screenshots
N/A

Additional context
This error occurs regardless of the driver being used to store the internal database (

I tried running Cloudbeaver from the 23, 24, ea, and latest branches all resulting in the same crash.

Another weird quirk occurs when I don't bind mount /opt/cloudbeaver/workspace to a persistent location and configure Cloudbeaver to store the management and metadata databases in an external provider (such as MySQL or Postgres). Performing the above steps results in a successful start and no database migration (sounds fair?). However, all the data is gone and I'm forced to go through the setup again. Connecting to the MySQL/Postgres db I can see that there is definitely some data being stored in both the management and metadata databases so I'm unsure why clearing the workspace (which only seems to contain the H2 embedded databases?) would cause this.

Here's the error I get when restarting a fresh Cloudbeaver instance:

20-03-2024 22:35:11.673 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - Initialize QMDB...
20-03-2024 22:35:11.700 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - 	Initiate connection pool with management database (PostgreSQL; jdbc:postgresql://<database host redacted>/cloudbeaver-metadata?ssl-mode=verify-full&sslrootcert=/run/secrets/ca_cert)
20-03-2024 22:35:11.792 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - QMDB connected
20-03-2024 22:35:12.198 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - 	Check QMDB deployment
20-03-2024 22:35:12.255 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - 	QMDB server started (PostgreSQL 14.11 (Debian 14.11-1.pgdg120+2))
20-03-2024 22:35:12.263 [main] DEBUG c.d.m.l.e.LicenseServiceEmbedded - 	Initialize license manager for cloudbeaver-ee
20-03-2024 22:35:12.264 [DBeaver: CloudBeaver license verifier] INFO  i.c.server.ee.LicenseCheckJob - Check license status
20-03-2024 22:35:12.267 [DBeaver: CloudBeaver license verifier] ERROR c.d.m.l.e.LicenseServiceEmbedded - No license found for CloudBeaver EE Server
20-03-2024 22:35:12.273 [main] DEBUG i.c.s.auth.ReverseProxyConfigurator - Reverse proxy provider disabled, migration not needed
20-03-2024 22:35:12.274 [main] DEBUG i.c.s.a.WebServiceBindingAwsConfigurator - IAM provider disabled, migration not needed
20-03-2024 22:35:12.294 [main] DEBUG i.c.service.security.db.CBDatabase - Initiate management database
20-03-2024 22:35:12.300 [main] DEBUG i.c.service.security.db.CBDatabase - 	Initiate connection pool with management database (PostgreSQL; /opt/cloudbeaver/workspace)
20-03-2024 22:35:12.302 [main] ERROR io.cloudbeaver.server.CBApplication - Error initializing database
org.jkiss.dbeaver.DBException: Error updating management database schema
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:226)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:65)
	at io.cloudbeaver.server.ee.CBApplicationEE.createGlobalSecurityController(CBApplicationEE.java:63)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:529)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:350)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:240)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
Caused by: java.lang.IllegalStateException: Connection factory returned null from createConnection
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357)
	at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:889)
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:424)
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:349)
	at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:190)
	... 18 common frames omitted

A weird thing that I noticed is that QMDB seems to connect successfully, printing the database URI to the logs:
Initiate connection pool with management database (PostgreSQL; jdbc:postgresql://<database host redacted>/cloudbeaver-metadata?ssl-mode=verify-full&sslrootcert=/run/secrets/ca_cert)

Meanwhile the management database prints /opt/cloudbeaver/workspace instead, while still listing the correct driver:
Initiate connection pool with management database (PostgreSQL; /opt/cloudbeaver/workspace)

I'd be happy to provide any relevant snippets of the cloudbeaver configuration file, my compose deployment or the environment variables I'm setting. Hope to hear from you guys soon

Originally created by @LifetimeMistake on GitHub (Mar 20, 2024). Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/2486 **Describe the bug** I'm attempting to run Cloudbeaver with Docker Compose. Upon starting the container it initializes successfully and I can go through the setup phase in the web UI. After entering a license key everything seems to be working (I can add users, connections, etc.). However, after restarting the container, the server fails to reload the database, leading to a crash. Curiously, this occurs regardless of the driver being used to store the mangement DB (I tried H2, mysql and postgres, giving me the same result) or whether I complete the setup phase or not. **To Reproduce** Steps to reproduce the behavior: 1. Start a fresh instance of Cloudbeaver EE in Docker. 2. Wait for the database migration to complete and the web server to start 3. Restart the container 4. Observe the crash with an error related to database schema migration **Screenshots** N/A **Additional context** This error occurs regardless of the driver being used to store the internal database ( I tried running Cloudbeaver from the `23`, `24`, `ea`, and `latest` branches all resulting in the same crash. Another weird quirk occurs when I don't bind mount `/opt/cloudbeaver/workspace` to a persistent location and configure Cloudbeaver to store the management and metadata databases in an external provider (such as MySQL or Postgres). Performing the above steps results in a successful start and no database migration (sounds fair?). However, all the data is gone and I'm forced to go through the setup again. Connecting to the MySQL/Postgres db I can see that there is definitely some data being stored in both the management and metadata databases so I'm unsure why clearing the workspace (which only seems to contain the H2 embedded databases?) would cause this. Here's the error I get when restarting a fresh Cloudbeaver instance: ``` 20-03-2024 22:35:11.673 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - Initialize QMDB... 20-03-2024 22:35:11.700 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - Initiate connection pool with management database (PostgreSQL; jdbc:postgresql://<database host redacted>/cloudbeaver-metadata?ssl-mode=verify-full&sslrootcert=/run/secrets/ca_cert) 20-03-2024 22:35:11.792 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - QMDB connected 20-03-2024 22:35:12.198 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - Check QMDB deployment 20-03-2024 22:35:12.255 [main] DEBUG com.dbeaver.ee.qm.db.impl.QMDBModel - QMDB server started (PostgreSQL 14.11 (Debian 14.11-1.pgdg120+2)) 20-03-2024 22:35:12.263 [main] DEBUG c.d.m.l.e.LicenseServiceEmbedded - Initialize license manager for cloudbeaver-ee 20-03-2024 22:35:12.264 [DBeaver: CloudBeaver license verifier] INFO i.c.server.ee.LicenseCheckJob - Check license status 20-03-2024 22:35:12.267 [DBeaver: CloudBeaver license verifier] ERROR c.d.m.l.e.LicenseServiceEmbedded - No license found for CloudBeaver EE Server 20-03-2024 22:35:12.273 [main] DEBUG i.c.s.auth.ReverseProxyConfigurator - Reverse proxy provider disabled, migration not needed 20-03-2024 22:35:12.274 [main] DEBUG i.c.s.a.WebServiceBindingAwsConfigurator - IAM provider disabled, migration not needed 20-03-2024 22:35:12.294 [main] DEBUG i.c.service.security.db.CBDatabase - Initiate management database 20-03-2024 22:35:12.300 [main] DEBUG i.c.service.security.db.CBDatabase - Initiate connection pool with management database (PostgreSQL; /opt/cloudbeaver/workspace) 20-03-2024 22:35:12.302 [main] ERROR io.cloudbeaver.server.CBApplication - Error initializing database org.jkiss.dbeaver.DBException: Error updating management database schema at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:226) at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:65) at io.cloudbeaver.server.ee.CBApplicationEE.createGlobalSecurityController(CBApplicationEE.java:63) at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:529) at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:350) at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:240) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588) at org.eclipse.equinox.launcher.Main.run(Main.java:1459) at org.eclipse.equinox.launcher.Main.main(Main.java:1432) Caused by: java.lang.IllegalStateException: Connection factory returned null from createConnection at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357) at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:889) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:424) at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:349) at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134) at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:190) ... 18 common frames omitted ``` A weird thing that I noticed is that QMDB seems to connect successfully, printing the database URI to the logs: `Initiate connection pool with management database (PostgreSQL; jdbc:postgresql://<database host redacted>/cloudbeaver-metadata?ssl-mode=verify-full&sslrootcert=/run/secrets/ca_cert)` Meanwhile the management database prints `/opt/cloudbeaver/workspace` instead, while still listing the correct driver: `Initiate connection pool with management database (PostgreSQL; /opt/cloudbeaver/workspace)` I'd be happy to provide any relevant snippets of the cloudbeaver configuration file, my compose deployment or the environment variables I'm setting. Hope to hear from you guys soon
kerem 2026-03-07 20:55:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#813
No description provided.