- I’m currently using the SonqrQube Community Edition.
- My goal is to connect YugabyteDB with the SonarQube in Kubernetes Cluster.
- I have deployed YugabyteDB on my cluster and trying to connect with SQ using “jdbcOverwrite”.
Even though it seems it was able to connect to the DB but it was “Failed to create table schema_migrations”
Would love to get the support from the SOnarCommunity.
TIA.
Hey there.
We (Sonar) don’t have any personal experience with YugabyteDB.
Is the error message in your screenshot really all that is returned (no deeper stacktrace)?
Hi,
Thanks for the reply. Here’s I’m sending all the logs I have found after deploying today again. It seems SonarQube wasn’t able to create the schema and it was restarting again and again due to this.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2022.05.31 06:54:52 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2022.05.31 06:54:53 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:34862]
2022.05.31 06:54:53 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2022.05.31 06:54:53 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2022.05.31 06:55:07 INFO es[][o.e.n.Node] version[7.17.1], pid[24], build[default/tar/e5acb99f822233d62d6444ce45a4543dc1c8059a/2022-02-23T22:20:54.153567231Z], OS[Linux/3.10.0-1160.15.2.el7.x86_64/amd64], JVM[Alpine/OpenJDK 64-Bit Server VM/11.0.14/11.0.14+9-alpine-r0]
2022.05.31 06:55:07 INFO es[][o.e.n.Node] JVM home [/usr/lib/jvm/java-11-openjdk]
2022.05.31 06:55:07 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djna.tmpdir=/opt/sonarqube/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Dcom.redhat.fips=false, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2022.05.31 06:55:11 INFO es[][o.e.p.PluginsService] no plugins loaded
2022.05.31 06:55:11 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/sdc5)]], net usable_space [3tb], net total_space [3.1tb], types [xfs]
2022.05.31 06:55:11 INFO es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2022.05.31 06:55:12 INFO es[][o.e.n.Node] node name [sonarqube], node ID [1YkNE-vxRIGk7u_9OonlSw], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2022.05.31 06:55:32 INFO es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2022.05.31 06:55:32 INFO es[][o.e.i.r.RecoverySettings] using rate limit [40mb] with [default=40mb, read=0b, write=0b, max=0b]
2022.05.31 06:55:33 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2022.05.31 06:55:34 INFO es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2022.05.31 06:55:36 INFO es[][o.e.n.Node] initialized
2022.05.31 06:55:36 INFO es[][o.e.n.Node] starting ...
2022.05.31 06:55:37 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:34862}, bound_addresses {127.0.0.1:34862}
2022.05.31 06:55:38 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
2022.05.31 06:55:38 INFO es[][o.e.c.c.Coordinator] cluster UUID [X57ig6k4Q_q51uOyYaAgWg]
2022.05.31 06:55:38 INFO es[][o.e.c.s.MasterService] elected-as-master ([1] nodes joined)[{sonarqube}{1YkNE-vxRIGk7u_9OonlSw}{Hov-VSE6S9u6gfrQAzW32Q}{127.0.0.1}{127.0.0.1:34862}{cdfhimrsw} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 25, version: 49, delta: master node changed {previous [], current [{sonarqube}{1YkNE-vxRIGk7u_9OonlSw}{Hov-VSE6S9u6gfrQAzW32Q}{127.0.0.1}{127.0.0.1:34862}{cdfhimrsw}]}
2022.05.31 06:55:38 INFO es[][o.e.c.s.ClusterApplierService] master node changed {previous [], current [{sonarqube}{1YkNE-vxRIGk7u_9OonlSw}{Hov-VSE6S9u6gfrQAzW32Q}{127.0.0.1}{127.0.0.1:34862}{cdfhimrsw}]}, term: 25, version: 49, reason: Publication{term=25, version=49}
2022.05.31 06:55:39 INFO es[][o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2022.05.31 06:55:39 INFO es[][o.e.n.Node] started
2022.05.31 06:55:39 INFO es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2022.05.31 06:55:40 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2022.05.31 06:55:40 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/opt/sonarqube]: /usr/lib/jvm/java-11-openjdk/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -javaagent:/opt/sonarqube/data/jmx_prometheus_javaagent.jar=8000:/opt/sonarqube/conf/prometheus-config.yaml -Dhttp.proxyHost=[VIP] -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=localhost|127.*|[::1] -Dhttps.proxyHost=[VIP] -Dhttps.proxyPort=3128 -cp ./lib/sonar-application-9.4.0.54424.jar:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.3.3.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process9583910856582628303properties
2022.05.31 06:55:44 INFO web[][o.s.p.ProcessEntryPoint] Starting Web Server
2022.05.31 06:55:47 INFO web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
2022.05.31 06:55:50 INFO web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.4.0.54424 / 5c36a2e19337da136080a276102eaaefce073c68
2022.05.31 06:55:50 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://yb-tservers.t001-u000003.svc.cluster.local:5433/sonardb
2022.05.31 06:55:57 INFO web[][o.s.s.p.ServerFileSystemImpl] SonarQube home: /opt/sonarqube
2022.05.31 06:55:57 INFO web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is enabled
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin C# Code Quality and Security / 8.36.1.44192 / 855387dffd60a6e903221a41ff5282452c1b742b
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Configuration detection fot Code Quality and Security / 1.2.0.267 / 4f37ba9ffb37a96d5883e52ad392ed32c5c6eaab
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Flex Code Quality and Security / 2.7.0.2865 / 9e61d9774455b25eefd0b71bf8903cb030641864
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Go Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin HTML Code Quality and Security / 3.6.0.3106 / 963bdc9f051f5dcb698b418790364231aeea04f2
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin IaC Code Quality and Security / 1.7.0.2012 / a006dbf717537ce3a87bb2b6b088597ead3273d1
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin JaCoCo / 1.1.1.1157 / 83478572b9f23efac29de15e30c7758bbb0c0e47
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Java Code Quality and Security / 7.11.0.29148 / e0695da6058ee662cb747ac920253d344609f19c
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin JavaScript/TypeScript/CSS Code Quality and Security / 9.1.0.17747 / e9a6665cfd326e7eeb36dbd112510b06f439ea34
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Kotlin Code Quality and Security / 2.9.0.1147 / 6ce439214a685d4aabde6461fd609a9a9c1df1c6
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin PHP Code Quality and Security / 3.23.1.8766 / db197ac9daccf3d305ad5e40618a65a95f3d5dde
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Python Code Quality and Security / 3.12.0.9583 / 035ca7e8a60604a221fbba55c7b113e34317d061
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Ruby Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Scala Code Quality and Security / 1.9.0.3429 / faf3c08c0ebf3a877186442cd4a0ddd50de079a8
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin Text file Code Quality and Security / 1.0.0.120 / b7539037caf5df01cc49bb7820a0c23f35196f0e
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin VB.NET Code Quality and Security / 8.36.1.44192 / 855387dffd60a6e903221a41ff5282452c1b742b
2022.05.31 06:55:59 INFO web[][o.s.s.p.ServerPluginManager] Deploy plugin XML Code Quality and Security / 2.5.0.3376 / 3b089c16cf0736c56f4fdb2fc88ddad59e7ca45d
2022.05.31 06:56:03 INFO web[][o.s.s.p.d.m.c.PostgresCharsetHandler] Verify that database charset supports UTF8
2022.05.31 06:56:04 INFO web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [http://localhost:9001]
2022.05.31 06:56:06 WARN web[][o.s.a.s.w.WebService$Action] Description is not set on action api/monitoring/metrics
2022.05.31 06:56:06 WARN web[][o.s.a.s.w.WebService$Action] Since is not set on action api/monitoring/metrics
2022.05.31 06:56:06 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/monitoring/metrics
2022.05.31 06:56:06 WARN web[][o.s.a.s.w.WebService$Action] The response example is not set on action api/system/liveness
2022.05.31 06:56:06 INFO web[][o.s.s.p.d.m.AutoDbMigration] Automatically perform DB migration on fresh install
2022.05.31 06:56:07 INFO web[][DbMigrations] Executing DB migrations...
2022.05.31 06:56:07 INFO web[][DbMigrations] #1 'Create initial schema'...
2022.05.31 06:56:07 ERROR web[][DbMigrations] #1 'Create initial schema': failure | time=120ms
2022.05.31 06:56:07 ERROR web[][DbMigrations] Executed DB migrations: failure | time=135ms
2022.05.31 06:56:07 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be-org.sonar.server.platform.db.migration.AutoDbMigration': Initialization of bean failed; nested exception is org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1 'Create initial schema' failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6a6824be-org.sonar.server.platform.db.migration.AutoDbMigration': Initialization of bean failed; nested exception is org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1 'Create initial schema' failed
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:196)
at org.sonar.server.platform.PlatformImpl.startSafeModeContainer(PlatformImpl.java:188)
at org.sonar.server.platform.PlatformImpl.doStart(PlatformImpl.java:90)
at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:44)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4763)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #1 'Create initial schema' failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:66)
at org.sonar.server.platform.db.migration.AutoDbMigration.start(AutoDbMigration.java:40)
at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
... 23 common frames omitted
Caused by: java.lang.IllegalStateException: Fail to execute CREATE TABLE active_rule_parameters (uuid VARCHAR (40) NOT NULL,value VARCHAR (4000) NULL,rules_parameter_key VARCHAR (128) NULL,active_rule_uuid VARCHAR (40) NOT NULL,rules_parameter_uuid VARCHAR (40) NOT NULL, CONSTRAINT pk_active_rule_parameters PRIMARY KEY (uuid))
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:106)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:86)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:128)
at org.sonar.server.platform.db.migration.version.v00.CreateInitialSchema.createActiveRuleParameters(CreateInitialSchema.java:171)
at org.sonar.server.platform.db.migration.version.v00.CreateInitialSchema.execute(CreateInitialSchema.java:97)
at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
... 32 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: relation "active_rule_parameters" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2675)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2365)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:355)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:490)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:408)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:329)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:315)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:291)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:286)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
at org.sonar.server.platform.db.migration.step.DdlChange$ContextImpl.execute(DdlChange.java:91)
... 38 common frames omitted
2022.05.31 06:56:07 INFO web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2022.05.31 06:56:07 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process
2022.05.31 06:56:08 INFO app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2022.05.31 06:56:08 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2022.05.31 06:56:08 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2022.05.31 06:56:08 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
It looks like the schema you’re creating the database in is not empty (either from previous attempts, or connecting to an existing database).
- Are there multiple schemas in your database? You can specify one by adding
?currentSchema=my_schema
to yoursonar.jdbc.url
- If not, I would suggest starting your DB from scratch and seeing if you get the same error message