Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while accessing Cloudbeaver #3021

Open
ghost opened this issue Oct 22, 2024 · 12 comments
Open

Error while accessing Cloudbeaver #3021

ghost opened this issue Oct 22, 2024 · 12 comments

Comments

@ghost
Copy link

ghost commented Oct 22, 2024

Describe the bug
The server pod is running without any issues, there's no errors on the logs as to make it that anything failed. However, the login functionality is not working even when using the credentials in the config. So the pod/container starts, asks for login but then it says login failed, specifically indicating that the user has no password and that the credentials are invalid.

22-10-2024 14:26:45.342 [qtp940905579-45] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=420cdffa025e13fec7430f9c1bf3876c, dt.span_id=3bfbf1fb454e2d18] - API > sessionPermissions
22-10-2024 14:26:45.347 [qtp940905579-44] DEBUG i.c.model.session.WebSession - Update session lifetime 1xo0b7fd0cny9odc6j276fguy7 for user null
22-10-2024 14:27:02.246 [qtp940905579-47] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=724b520da3e87823522406102e575708, dt.span_id=a80b833146c23f77] - API > authLogin
22-10-2024 14:27:02.253 [qtp940905579-47] DEBUG i.c.s.s.CBEmbeddedSecurityController [!dt dt.trace_sampled=true, dt.trace_id=724b520da3e87823522406102e575708, dt.span_id=a80b833146c23f77] - Local auth validation error
org.jkiss.dbeaver.DBException: User has no password (login restricted)
	at io.cloudbeaver.auth.provider.local.LocalAuthProvider.validateLocalAuth(LocalAuthProvider.java:64)
	at io.cloudbeaver.service.security.CBEmbeddedSecurityController.findOrCreateExternalUserByCredentials(CBEmbeddedSecurityController.java:2409)
	at io.cloudbeaver.service.security.CBEmbeddedSecurityController.finishAuthentication(CBEmbeddedSecurityController.java:2150)
	at io.cloudbeaver.service.security.CBEmbeddedSecurityController.authenticate(CBEmbeddedSecurityController.java:1561)
	at io.cloudbeaver.service.auth.impl.WebServiceAuthImpl.authLogin(WebServiceAuthImpl.java:91)
	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:569)
	at io.cloudbeaver.service.WebServiceBindingBase$ServiceInvocationHandler.invoke(WebServiceBindingBase.java:170)
	at jdk.proxy8/jdk.proxy8.$Proxy14.authLogin(Unknown Source)
	at io.cloudbeaver.service.auth.WebServiceBindingAuth.lambda$0(WebServiceBindingAuth.java:39)
	at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:533)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:497)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:438)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:397)
	at graphql.execution.ExecutionStrategy.getAsyncFieldValueInfo(ExecutionStrategy.java:335)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:57)
	at graphql.execution.Execution.executeOperation(Execution.java:180)
	at graphql.execution.Execution.execute(Execution.java:116)
	at graphql.GraphQL.execute(GraphQL.java:546)
	at graphql.GraphQL.lambda$parseValidateAndExecute$13(GraphQL.java:476)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471)
	at graphql.GraphQL.lambda$executeAsync$9(GraphQL.java:429)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.executeAsync(GraphQL.java:418)
	at graphql.GraphQL.execute(GraphQL.java:359)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeQuery(GraphQLEndpoint.java:263)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeSingleQuery(GraphQLEndpoint.java:207)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.doPost(GraphQLEndpoint.java:190)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:653)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:824)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
	at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:703)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at io.cloudbeaver.server.servlets.ProxyResourceHandler.handle(ProxyResourceHandler.java:56)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeHandler.handle(WebSocketUpgradeHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
	at org.eclipse.jetty.server.Server.handle(Server.java:181)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:648)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:403)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:840)
22-10-2024 14:27:02.304 [qtp940905579-47] ERROR i.c.service.WebServiceBindingBase [!dt dt.trace_sampled=true, dt.trace_id=724b520da3e87823522406102e575708, dt.span_id=a80b833146c23f77] - Unexpected error during gql request
io.cloudbeaver.DBWebException: User authentication failed:
Invalid user credentials
	at io.cloudbeaver.service.auth.impl.WebServiceAuthImpl.authLogin(WebServiceAuthImpl.java:114)
	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:569)
	at io.cloudbeaver.service.WebServiceBindingBase$ServiceInvocationHandler.invoke(WebServiceBindingBase.java:170)
	at jdk.proxy8/jdk.proxy8.$Proxy14.authLogin(Unknown Source)
	at io.cloudbeaver.service.auth.WebServiceBindingAuth.lambda$0(WebServiceBindingAuth.java:39)
	at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:533)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:497)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:438)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:397)
	at graphql.execution.ExecutionStrategy.getAsyncFieldValueInfo(ExecutionStrategy.java:335)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:57)
	at graphql.execution.Execution.executeOperation(Execution.java:180)
	at graphql.execution.Execution.execute(Execution.java:116)
	at graphql.GraphQL.execute(GraphQL.java:546)
	at graphql.GraphQL.lambda$parseValidateAndExecute$13(GraphQL.java:476)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471)
	at graphql.GraphQL.lambda$executeAsync$9(GraphQL.java:429)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.executeAsync(GraphQL.java:418)
	at graphql.GraphQL.execute(GraphQL.java:359)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeQuery(GraphQLEndpoint.java:263)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeSingleQuery(GraphQLEndpoint.java:207)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.doPost(GraphQLEndpoint.java:190)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:653)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:824)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
	at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:703)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at io.cloudbeaver.server.servlets.ProxyResourceHandler.handle(ProxyResourceHandler.java:56)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeHandler.handle(WebSocketUpgradeHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
	at org.eclipse.jetty.server.Server.handle(Server.java:181)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:648)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:403)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.jkiss.dbeaver.DBException: Invalid user credentials
	at io.cloudbeaver.model.session.WebSessionAuthProcessor.authenticateSession(WebSessionAuthProcessor.java:79)
	at io.cloudbeaver.service.auth.impl.WebServiceAuthImpl.authLogin(WebServiceAuthImpl.java:109)
	... 59 common frames omitted
Caused by: org.jkiss.dbeaver.DBException: Invalid user credentials
	at io.cloudbeaver.model.session.WebSessionAuthProcessor.authenticateSession(WebSessionAuthProcessor.java:67)
	... 60 common frames omitted
22-10-2024 14:27:02.305 [qtp940905579-47] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=724b520da3e87823522406102e575708, dt.span_id=a80b833146c23f77] - GraphQL call failed at '/authInfo'
io.cloudbeaver.DBWebException: User authentication failed:
Invalid user credentials
	at io.cloudbeaver.service.auth.impl.WebServiceAuthImpl.authLogin(WebServiceAuthImpl.java:114)
	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:569)
	at io.cloudbeaver.service.WebServiceBindingBase$ServiceInvocationHandler.invoke(WebServiceBindingBase.java:170)
	at jdk.proxy8/jdk.proxy8.$Proxy14.authLogin(Unknown Source)
	at io.cloudbeaver.service.auth.WebServiceBindingAuth.lambda$0(WebServiceBindingAuth.java:39)
	at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:533)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:497)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:438)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:397)
	at graphql.execution.ExecutionStrategy.getAsyncFieldValueInfo(ExecutionStrategy.java:335)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:57)
	at graphql.execution.Execution.executeOperation(Execution.java:180)
	at graphql.execution.Execution.execute(Execution.java:116)
	at graphql.GraphQL.execute(GraphQL.java:546)
	at graphql.GraphQL.lambda$parseValidateAndExecute$13(GraphQL.java:476)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471)
	at graphql.GraphQL.lambda$executeAsync$9(GraphQL.java:429)
	at com.dynatrace.agent.introspection.threading.completable.FunctionWrapper.apply(FunctionWrapper.java:22)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at graphql.GraphQL.executeAsync(GraphQL.java:418)
	at graphql.GraphQL.execute(GraphQL.java:359)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeQuery(GraphQLEndpoint.java:263)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.executeSingleQuery(GraphQLEndpoint.java:207)
	at io.cloudbeaver.server.graphql.GraphQLEndpoint.doPost(GraphQLEndpoint.java:190)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:653)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:824)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:436)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
	at org.eclipse.jetty.ee10.servlet.SessionHandler.handle(SessionHandler.java:703)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at io.cloudbeaver.server.servlets.ProxyResourceHandler.handle(ProxyResourceHandler.java:56)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeHandler.handle(WebSocketUpgradeHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1060)
	at org.eclipse.jetty.server.Server.handle(Server.java:181)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:648)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:403)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.jkiss.dbeaver.DBException: Invalid user credentials
	at io.cloudbeaver.model.session.WebSessionAuthProcessor.authenticateSession(WebSessionAuthProcessor.java:79)
	at io.cloudbeaver.service.auth.impl.WebServiceAuthImpl.authLogin(WebServiceAuthImpl.java:109)
	... 59 common frames omitted
Caused by: org.jkiss.dbeaver.DBException: Invalid user credentials
	at io.cloudbeaver.model.session.WebSessionAuthProcessor.authenticateSession(WebSessionAuthProcessor.java:67)
	... 60 common frames omitted
22-10-2024 14:27:19.711 [qtp940905579-43] DEBUG i.c.s.websockets.CBEventsWebSocket - Socket Closed: [1001] null
22-10-2024 14:27:20.421 [qtp940905579-43] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=da7e90b98b0e2455dcc92aab8d87a81c, dt.span_id=5404c3c482be46ae] - API > serverConfig
22-10-2024 14:27:20.502 [qtp940905579-47] INFO  i.c.s.w.CBJettyWebSocketManager - Websocket created for session: 1xo0b7fd0cny9odc6j276fguy7
22-10-2024 14:27:20.503 [qtp940905579-47] DEBUG i.c.s.websockets.CBEventsWebSocket - EventWebSocket connected to the 1xo0b7fd0cny9odc6j276fguy7 session
22-10-2024 14:27:20.741 [qtp940905579-47] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=386773ed8ba511502e716d479a8c1822, dt.span_id=a079c9681ca2faf6] - API > openSession
22-10-2024 14:27:20.826 [qtp940905579-43] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=8071ef1fb6a2d0cd265c3c21c7b7b5dd, dt.span_id=e01188836f51c062] - API > getActiveUser
22-10-2024 14:27:21.050 [qtp940905579-47] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=471806c2bd72ff639bf9efda73150e1e, dt.span_id=472943e888bb55a4] - API > getAuthProviders
22-10-2024 14:27:21.131 [qtp940905579-43] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=2e9c42c94b82de530ca0b0132c2965a2, dt.span_id=5ba6f10934329cd9] - API > sessionPermissions
22-10-2024 14:27:21.220 [qtp940905579-47] DEBUG i.c.server.graphql.GraphQLEndpoint [!dt dt.trace_sampled=true, dt.trace_id=207385c6c3a0717065460c86afe26cdd, dt.span_id=9a9789b46efbb582] - API > getProductInfo
22-10-2024 14:27:21.430 [qtp940905579-43] DEBUG i.c.model.session.WebSession - Update session lifetime 1xo0b7fd0cny9odc6j276fguy7 for user null
22-10-2024 14:31:48.481 [qtp940905579-43] DEBUG i.c.model.session.WebSession - Update session lifetime 1xo0b7fd0cny9odc6j276fguy7 for user null
22-10-2024 14:36:52.709 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session '1ssxdrt6vhze3120hxau6ztng24'
22-10-2024 14:36:52.709 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session '1gp7hi10g6tun1t11ht3xd298s5'
22-10-2024 14:36:52.709 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session '1tnwzifidbpvrap3uvohdt7yu6'
22-10-2024 14:36:52.709 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session 'yingh7m3h0ub1p1liiz1m17ly2'
22-10-2024 14:36:52.709 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session '1a2lnn8px3hdi115uuhecpd3nw3'
22-10-2024 14:41:53.471 [DBeaver: Web session monitor] DEBUG i.c.s.session.WebSessionManager - > Expire session '1xo0b7fd0cny9odc6j276fguy7'
22-10-2024 14:41:53.473 [qtp940905579-43] ERROR i.c.s.websockets.CBEventsWebSocket - null
java.nio.channels.ClosedChannelException: null
	at org.eclipse.jetty.websocket.core.internal.WebSocketSessionState.onEof(WebSocketSessionState.java:168)
	at org.eclipse.jetty.websocket.core.WebSocketCoreSession.onEof(WebSocketCoreSession.java:229)
	at org.eclipse.jetty.websocket.core.WebSocketConnection.fillAndParse(WebSocketConnection.java:474)
	at org.eclipse.jetty.websocket.core.WebSocketConnection.onFillable(WebSocketConnection.java:332)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:840)
22-10-2024 14:41:53.473 [qtp940905579-43] DEBUG i.c.s.websockets.CBEventsWebSocket - Socket Closed: [1006] Session Closed

Here're the credentials:

"admin": {
  "adminName": "cbadmin",
  "adminPassword": "cbadmin20",
  "teams": [
    {
      "subjectId": "admin",
      "teamName": "Admin",
      "description": "Administrative access. Has total and full authority.",
      "permission": ["public", "admin"]
    }
  ]
}

Also, this is what I get when I get onto the gql console as a response, which I understand is correct since I can't login in the first place.

image

I'm attaching my settings and logs as files as well so you can check bootstrapping and other logs.

@ghost ghost added bug Something isn't working wait for review labels Oct 22, 2024
@ghost
Copy link
Author

ghost commented Oct 22, 2024

@EvgeniaBzzz
Copy link
Contributor

Hi @andres-chavez-bi
What is your goal? Do you want just to predefine the admin user?

You can use environment variables. It will also skip initial server configuration.

docker run --name cloudbeaver --rm -ti -e CB_SERVER_NAME=test -e CB_SERVER_URL=http://localhost:8978/ -e CB_ADMIN_NAME=test_admin -e CB_ADMIN_PASSWORD=Str0NGPa55word dbeaver/[product_version]:[product_branch]

@ghost
Copy link
Author

ghost commented Oct 23, 2024

Hi @EvgeniaBzzz my goal is to have a cloudbeaver server running in an Openshift environment. I am currently testing with a predefined admin user, yes, at some point I'd like to test and check SAML authentication for the users (also the admins). As for now though, a predefined is fine for me.
I'm currently using Helm to orchestrate the deployment of the pod(container) in openshift. I hope this helps.
What I don't understand is why, even when providing local authentication and predefined admin credentials, they will not work while trying to login into the server. Thanks and let me know if you need mroe information.

@EvgeniaBzzz
Copy link
Contributor

The Admin should be defined in a separate config, not in .cloudbeaver.conf.

  • You cannot simply edit the default initial-data.conf.
  • Create your own config file that will be accessible from the container, and add adminName, adminPassword.
  • Specify the path to it as a variable in .cloudbeaver.conf. Path to the default file for example:

initialDataConfiguration: "${CLOUDBEAVER_DB_INITIAL_DATA/initial-data.conf}"

Please note that the initial data will only be applied during the server's initial startup.

@ghost
Copy link
Author

ghost commented Oct 25, 2024

Hi @EvgeniaBzzz I finally got my config correctly initialized, I've used the cloudbeaver.conf file, pointing to the self created init file for the admin credentials like you mentioned: initialDataConfiguration: "conf/db-init.conf"

Here's my config:

apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudbeaver-server-config
  labels:
    app: christoffbeaver
data:
  cloudbeaver.conf: |
    {
        server: {
            serverPort: 8978,
            serverHost: "0.0.0.0",
            serverName: "CloudBeaver Sample Server",
            workspaceLocation: "workspace",
            contentRoot: "web",
            driversLocation: "drivers",
            rootURI: "/",
            serviceURI: "/api/",
            productConfiguration: "conf/product.conf",
            expireSessionAfterPeriod: 600000,
            develMode: false,

            sm: {
                enableBruteForceProtection: "${CLOUDBEAVER_BRUTE_FORCE_PROTECTION_ENABLED:true}",
                expiredAuthAttemptInfoTtl: 60,
                maxFailedLogin: "${CLOUDBEAVER_MAX_FAILED_LOGINS:10}",
                minimumLoginTimeout: "${CLOUDBEAVER_MINIMUM_LOGIN_TIMEOUT:1}",
                blockLoginPeriod: "${CLOUDBEAVER_BLOCK_PERIOD:300}",
                passwordPolicy: {
                    minLength: "${CLOUDBEAVER_POLICY_MIN_LENGTH:8}",
                    requireMixedCase: "${CLOUDBEAVER_POLICY_REQUIRE_MIXED_CASE:true}",
                    minNumberCount: "${CLOUDBEAVER_POLICY_MIN_NUMBER_COUNT:1}",
                    minSymbolCount: "${CLOUDBEAVER_POLICY_MIN_SYMBOL_COUNT:0}"
                }
            },

            database: {
                driver: "h2:h2_embedded_v2",
                url: "jdbc:h2:${workspace}/.data/cb.h2.dat",
                initialDataConfiguration: "conf/db-init.conf",
                pool: {
                    minIdleConnections: 4, 
                    maxIdleConnections: 10,
                    maxConnections: 100,
                    validationQuery: "SELECT 1"
                }
            }
        },
        app: {
            anonymousAccessAllowed: true,
            anonymousUserTeam: "user",
            supportsCustomConnections: false,
            publicCredentialsSaveEnabled: true,
            adminCredentialsSaveEnabled: true,
            resourceManagerEnabled: true,
            systemVariablesResolvingEnabled: "${CLOUDBEAVER_SYSTEM_VARIABLES_RESOLVING_ENABLED:false}",

            resourceQuotas: {
                dataExportFileSizeLimit: 10000000,
                resourceManagerFileSizeLimit: 500000,
                sqlMaxRunningQueries: 100,
                sqlResultSetRowsLimit: 100000,
                sqlResultSetMemoryLimit: 2000000,
                sqlTextPreviewMaxLength: 4096,
                sqlBinaryPreviewMaxLength: 261120
            },
            defaultNavigatorSettings: {
                showSystemObjects: true,
                showUtilityObjects: false,
                showOnlyEntities: false,
                mergeEntities: false,
                hideFolders: false,
                hideSchemas: false
            },
            plugins: {

            },
            enabledAuthProviders: [
                "local"
            ],
            enabledDrivers: [
                "h2:h2_embedded_v2"
            ],
            disabledDrivers: [
                "sqlite:sqlite_jdbc",
                "h2:h2_embedded"
            ]

        }

    }

But now I'm facing a db initialization error:

25-10-2024 08:57:31.169 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Process [ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL]
25-10-2024 08:57:31.169 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Execute migration query: ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
25-10-2024 08:57:31.177 [main] ERROR o.j.d.m.sql.schema.SQLSchemaManager - Error during sql migration
org.h2.jdbc.JdbcSQLSyntaxErrorException: Duplicate column name "UPDATE_TIME"; SQL statement:
ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL [42121-214]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
	at org.h2.message.DbException.get(DbException.java:223)
	at org.h2.message.DbException.get(DbException.java:199)
	at org.h2.table.Table.setColumns(Table.java:487)
	at org.h2.table.TableBase.<init>(TableBase.java:73)
	at org.h2.mvstore.db.MVTable.<init>(MVTable.java:139)
	at org.h2.mvstore.db.Store.createTable(Store.java:219)
	at org.h2.schema.Schema.createTable(Schema.java:776)
	at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:454)
	at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:339)
	at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:242)
	at org.h2.command.CommandContainer.update(CommandContainer.java:169)
	at org.h2.command.Command.executeUpdate(Command.java:252)
	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:252)
	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:209)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
25-10-2024 08:57:31.178 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Trying to apply the migration again
25-10-2024 08:57:31.179 [main] WARN  o.j.d.m.sql.schema.SQLSchemaManager - Error updating CB schema version from 1 to 2
org.h2.jdbc.JdbcSQLSyntaxErrorException: Duplicate column name "UPDATE_TIME"; SQL statement:
ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL [42121-214]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
	at org.h2.message.DbException.get(DbException.java:223)
	at org.h2.message.DbException.get(DbException.java:199)
	at org.h2.table.Table.setColumns(Table.java:487)
	at org.h2.table.TableBase.<init>(TableBase.java:73)
	at org.h2.mvstore.db.MVTable.<init>(MVTable.java:139)
	at org.h2.mvstore.db.Store.createTable(Store.java:219)
	at org.h2.schema.Schema.createTable(Schema.java:776)
	at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:454)
	at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:339)
	at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:242)
	at org.h2.command.CommandContainer.update(CommandContainer.java:169)
	at org.h2.command.Command.executeUpdate(Command.java:252)
	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:252)
	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:215)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
25-10-2024 08:57:31.180 [main] WARN  o.j.d.m.sql.schema.SQLSchemaManager - CB migration has been rolled back
25-10-2024 08:57:31.185 [main] DEBUG i.c.service.security.db.CBDatabase - Shutdown database
25-10-2024 08:57:31.203 [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:236)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
Caused by: org.jkiss.dbeaver.DBException: Error updating CB schema version
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:143)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	... 19 common frames omitted
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Duplicate column name "UPDATE_TIME"; SQL statement:
ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL [42121-214]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:502)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:477)
	at org.h2.message.DbException.get(DbException.java:223)
	at org.h2.message.DbException.get(DbException.java:199)
	at org.h2.table.Table.setColumns(Table.java:487)
	at org.h2.table.TableBase.<init>(TableBase.java:73)
	at org.h2.mvstore.db.MVTable.<init>(MVTable.java:139)
	at org.h2.mvstore.db.Store.createTable(Store.java:219)
	at org.h2.schema.Schema.createTable(Schema.java:776)
	at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:454)
	at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:339)
	at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:242)
	at org.h2.command.CommandContainer.update(CommandContainer.java:169)
	at org.h2.command.Command.executeUpdate(Command.java:252)
	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:252)
	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:215)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	... 20 common frames omitted
25-10-2024 08:57:31.245 [Framework stop - Equinox Container: 86e53db4-218b-47da-8f9b-cd6faab49a67] DEBUG io.cloudbeaver.server.CBPlatform - Shutdown Core...
25-10-2024 08:57:31.245 [Framework stop - Equinox Container: 86e53db4-218b-47da-8f9b-cd6faab49a67] DEBUG o.j.d.registry.BasePlatformImpl - Dispose navigator model
25-10-2024 08:57:31.298 [Framework stop - Equinox Container: 86e53db4-218b-47da-8f9b-cd6faab49a67] DEBUG io.cloudbeaver.server.CBPlatform - Shutdown completed in 52ms

here's my init db config (from the file I created):

apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudbeaver-db-init-config
  labels:
    app: christoffbeaver
data:
  db-init.conf: |
    {
        adminName: "cbadmin",
        adminPassword: "cbadmin20",
        teams: [
            {
                subjectId: "admin",
                teamName: "Admin",
                description: "Administrative access. Has total and full authority.",
                permission: ["public", "admin"]
            },
            {
                subjectId: "user",
                teamName: "User",
                description: "Standard user",
                permission: ["public"]
            }
        ]
    }

Thank you so much for your help!!

@EvgeniaBzzz
Copy link
Contributor

@andres-chavez-bi
What version of CloudBeaver are you using?
Please try deleting .db files from workspace/.data (or move them elsewhere if you have data in this workspace)

@ghost
Copy link
Author

ghost commented Oct 25, 2024

Hi @EvgeniaBzzz I'm using 24.2.1

FROM dbeaver/cloudbeaver:24.2.1

RUN groupadd cloudbeaver
RUN useradd -ms /bin/bash -g cloudbeaver cloudbeaver
RUN chown -R cloudbeaver ./

USER cloudbeaver

I think the problem is my PV retain policy, I need to check on that, because from what I see, my Helm chart is correctly removing the PVC when uninstalling it, but when redeploying info seems to be there (as shown on the error)

Would it make sense to skip initialization for those objects that are already created to be skipped (or overwritten if config has changed). Maybe it might help in scenarios where this happens, not only on my case but on all K8s and openshift deployments. Since the cloudbeaver db is on bootstrap mode, you still need to initialize it, even if objects are still there, but it's just a suggestion.

I will look into it and comeback with feedback. Thanks again.

@ghost
Copy link
Author

ghost commented Oct 28, 2024

Hi @EvgeniaBzzz so I've checked and our pv's and pvc's have a RetainPolicy set to "Delete". I also did a test: I openend the container and found that the trace file was there, I deleted it, and tried to run the "run_server.sh" script and it failed again with the same error (Duplicate columns). Also, I've tried to delete the db data file so maybe it can recreate it, but no luck there as well. I'm uploading the trace file for you to check on the error.
cb_h2db_trace_log.txt
Please let me know if I can give more information so we can find a possible cause of the issue, also my settings are also uploaded maybe there's something I missed or did wrong.
cb_conf.txt

I'm also attaching the pv is not available after the deployment is deleted (uninstalled using helm):

image

LAstly, I've also updated to Cloudbeaver 24.2.2 and the same happens.

Is there anything else we can try? Thanks!

@EvgeniaBzzz
Copy link
Contributor

@andres-chavez-bi
Looks like when you start the server, it tries to migrate changes. But your CB database is corrupted, so you get that error.

Could you, please, try to start server in a new workspace. Also you could try to delete the whole .data folder (make a backup if you have any important data).

@ghost
Copy link
Author

ghost commented Oct 30, 2024

Hi @EvgeniaBzzz since these are tests, I am deleting the Openshift (K8s) components everytime before I deploy the application. So, data folder and all components of the application are deleted everytime.

I have also deleted the .data folder entirely, as mentioned in my previous comment, and ran the run_server script and the issue is still present.

I have also tried to deploy the server on a different namespace, to avoid any duplicates of any kind and the issue persists, here's the snippet of the logs on the new namespace, as you can see, it's also complaining about duplicate columns.

image

Again, db corruption might not be possible since I delete all my components for every test I perform to avoid any duplicity of any kind. Also I've checked that my env variables are not messing with any configuration:

image

Do you have any other suggestions? Do I need to provide more information to help find the issue? Thanks!

@ghost
Copy link
Author

ghost commented Nov 4, 2024

Hello @EvgeniaBzzz I have tried to use SQLlite as a database, and the error is exactly the same (I'm using cloudbeaver 24.2.2)

4-11-2024 10:39:54.475 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Process [ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL]
04-11-2024 10:39:54.475 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Execute migration query: ALTER TABLE CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
04-11-2024 10:39:54.477 [main] ERROR o.j.d.m.sql.schema.SQLSchemaManager - Error during sql migration
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (duplicate column name: UPDATE_TIME)
	at org.sqlite.core.DB.newSQLException(DB.java:1179)
	at org.sqlite.core.DB.newSQLException(DB.java:1190)
	at org.sqlite.core.DB.throwex(DB.java:1150)
	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
	at org.sqlite.core.NativeDB.prepare(NativeDB.java:132)
	at org.sqlite.core.DB.prepare(DB.java:264)
	at org.sqlite.jdbc3.JDBC3Statement.lambda$execute$0(JDBC3Statement.java:53)
	at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:459)
	at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:42)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:209)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
04-11-2024 10:39:54.479 [main] DEBUG o.j.d.m.sql.schema.SQLSchemaManager - Trying to apply the migration again
04-11-2024 10:39:54.479 [main] WARN  o.j.d.m.sql.schema.SQLSchemaManager - Error updating CB schema version from 1 to 2
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (duplicate column name: UPDATE_TIME)
	at org.sqlite.core.DB.newSQLException(DB.java:1179)
	at org.sqlite.core.DB.newSQLException(DB.java:1190)
	at org.sqlite.core.DB.throwex(DB.java:1150)
	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
	at org.sqlite.core.NativeDB.prepare(NativeDB.java:132)
	at org.sqlite.core.DB.prepare(DB.java:264)
	at org.sqlite.jdbc3.JDBC3Statement.lambda$execute$0(JDBC3Statement.java:53)
	at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:459)
	at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:42)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:215)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
04-11-2024 10:39:54.489 [main] WARN  o.j.d.m.sql.schema.SQLSchemaManager - CB migration has been rolled back
04-11-2024 10:39:54.498 [main] DEBUG i.c.service.security.db.CBDatabase - Shutdown database
04-11-2024 10:39:54.501 [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:236)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createAndInitDatabaseInstance(EmbeddedSecurityControllerFactory.java:83)
	at io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory.createSecurityService(EmbeddedSecurityControllerFactory.java:51)
	at io.cloudbeaver.server.CBApplicationCE.createGlobalSecurityController(CBApplicationCE.java:70)
	at io.cloudbeaver.server.CBApplication.initializeSecurityController(CBApplication.java:448)
	at io.cloudbeaver.server.CBApplication.startServer(CBApplication.java:297)
	at io.cloudbeaver.model.app.BaseWebApplication.start(BaseWebApplication.java:203)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	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:569)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.invokeFramework(DBeaverLauncher.java:650)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.basicRun(DBeaverLauncher.java:610)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.run(DBeaverLauncher.java:1461)
	at org.jkiss.dbeaver.launcher.DBeaverLauncher.main(DBeaverLauncher.java:1434)
Caused by: org.jkiss.dbeaver.DBException: Error updating CB schema version
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:143)
	at io.cloudbeaver.service.security.db.CBDatabase.initialize(CBDatabase.java:232)
	... 19 common frames omitted
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (duplicate column name: UPDATE_TIME)
	at org.sqlite.core.DB.newSQLException(DB.java:1179)
	at org.sqlite.core.DB.newSQLException(DB.java:1190)
	at org.sqlite.core.DB.throwex(DB.java:1150)
	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
	at org.sqlite.core.NativeDB.prepare(NativeDB.java:132)
	at org.sqlite.core.DB.prepare(DB.java:264)
	at org.sqlite.jdbc3.JDBC3Statement.lambda$execute$0(JDBC3Statement.java:53)
	at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:459)
	at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3Statement.java:42)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:182)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.executeScript(SQLSchemaManager.java:215)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.upgradeSchemaVersion(SQLSchemaManager.java:161)
	at org.jkiss.dbeaver.model.sql.schema.SQLSchemaManager.updateSchema(SQLSchemaManager.java:132)
	... 20 common frames omitted
04-11-2024 10:39:54.507 [Framework stop - Equinox Container: 721654f2-0454-4e81-b8eb-4ea5e2114f93] DEBUG io.cloudbeaver.server.CBPlatform - Shutdown Core...
04-11-2024 10:39:54.508 [Framework stop - Equinox Container: 721654f2-0454-4e81-b8eb-4ea5e2114f93] DEBUG o.j.d.registry.BasePlatformImpl - Dispose navigator model
04-11-2024 10:39:54.576 [Framework stop - Equinox Container: 721654f2-0454-4e81-b8eb-4ea5e2114f93] DEBUG io.cloudbeaver.server.CBPlatform - Shutdown completed in 69ms

I think the issue might be somewhere else, can you help me out, is there something I can check to see what it might be? I'm attaching the full logs again for you to review.
Uploading sqllite_error.txt…

@EvgeniaBzzz
Copy link
Contributor

We need more time to investigate your case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants