Oteemo / charts

Helm chart repository
https://oteemo.github.io/charts
MIT License
181 stars 231 forks source link

Sonarqube pod keeps failing after connecting to DB as logs stated #332

Closed Leke-Ariyo closed 2 years ago

Leke-Ariyo commented 2 years ago

Hi Everyone, I have been trying to install SonarQube on a kubernetes cluster, But sonarqube-sonarqube pod still keeps on failing and from the logs it states that it could not connect to the Database of which I confirmed wasn't initially there and then I created it. I also connected to it and restarted the pod but it still leaves me with the same logs and the pod still keeps failing.

I should also state that I am not using the included postgresql instead I am pointing it to a pgsql that has been setup by zalando postgres-operator

postgres=# \l
                                  List of databases
    Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
------------+----------+----------+-------------+-------------+-----------------------
 postgres   | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | 
 postgresql | owner    | UTF8     | en_US.utf-8 | en_US.utf-8 | 
 sonarDB    | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | 
 template0  | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | =c/postgres          +
            |          |          |             |             | postgres=CTc/postgres
 template1  | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | =c/postgres          +
            |          |          |             |             | postgres=CTc/postgres
(5 rows)

postgres=# \c sonarDB
psql (14.0 (Ubuntu 14.0-1.pgdg18.04+1), server 12.8 (Ubuntu 12.8-1.pgdg18.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
You are now connected to database "sonarDB" as user "postgres".
sonarDB=# 
sonarDB=# 

Here are the logs:

2022.02.01 06:04:33 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -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, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
99
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
98
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
97
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [mapper-extras]
96
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
95
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
94
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [repository-url]
93
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
92
2022.02.01 06:04:34 INFO  es[][o.e.p.PluginsService] no plugins loaded
91
2022.02.01 06:04:35 WARN  es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
90
2022.02.01 06:04:36 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
89
2022.02.01 06:04:36 INFO  es[][o.e.n.Node] initialized
88
2022.02.01 06:04:36 INFO  es[][o.e.n.Node] starting ...
87
2022.02.01 06:04:36 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
86
2022.02.01 06:04:36 INFO  es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
85
2022.02.01 06:04:39 INFO  es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{K-SPbtvZTICEWsPgAx79_w}{lWmfa89wRNyuQ1zS0gVmFA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
84
2022.02.01 06:04:39 INFO  es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{K-SPbtvZTICEWsPgAx79_w}{lWmfa89wRNyuQ1zS0gVmFA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{K-SPbtvZTICEWsPgAx79_w}{lWmfa89wRNyuQ1zS0gVmFA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
83
2022.02.01 06:04:39 INFO  es[][o.e.n.Node] started
82
2022.02.01 06:04:39 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
81
2022.02.01 06:04:39 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
80
2022.02.01 06:04:39 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /opt/java/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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.16.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process17865666693590123234properties
79
2022.02.01 06:04:40 INFO  web[][o.s.p.ProcessEntryPoint] Starting web
78
2022.02.01 06:04:40 INFO  web[][o.a.t.u.n.NioSelectorPool] Using a shared selector for servlet write/read
77
2022.02.01 06:04:41 INFO  web[][o.e.p.PluginsService] no modules loaded
76
2022.02.01 06:04:41 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]
75
2022.02.01 06:04:41 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
74
2022.02.01 06:04:41 INFO  web[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
73
2022.02.01 06:04:41 INFO  web[][o.s.s.e.EsClientProvider] Connected to local Elasticsearch: [127.0.0.1:9001]
72
2022.02.01 06:04:41 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 8.5.1.38104 / 568d59cd4cc6521467703887ba4bc2861cf6f3f1
71
2022.02.01 06:04:41 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://%!s(<nil>):5432/sonarDB
70
2022.02.01 06:04:41 ERROR web[][o.s.s.p.PlatformImpl] Web server startup failed
69
java.lang.IllegalStateException: Fail to connect to database
68
    at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:86)
67
    at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
66
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
65
    at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
64
    at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
63
    at org.picocontainer.behaviors.Stored.start(Stored.java:110)
62
    at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
61
    at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
60
    at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
59
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
58
    at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
57
    at org.sonar.server.platform.platformlevel.PlatformLevel1.start(PlatformLevel1.java:166)
56
    at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:213)
55
    at org.sonar.server.platform.PlatformImpl.startLevel1Container(PlatformImpl.java:172)
54
    at org.sonar.server.platform.PlatformImpl.init(PlatformImpl.java:86)
53
    at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)
52
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689)
51
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155)
50
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
49
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
48
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
47
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
46
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
45
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
44
    at java.base/java.lang.Thread.run(Thread.java:834)
43
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
42
    at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:118)
41
    at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:83)
40
    ... 24 common frames omitted
39
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (The connection attempt failed.)
38
    at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:669)
37
    at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:544)
36
    at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
35
    at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
34
    at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:317)
33
    at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:115)
32
    ... 25 common frames omitted
31
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
30
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315)
29
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
28
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
27
    at org.postgresql.Driver.makeConnection(Driver.java:465)
26
    at org.postgresql.Driver.connect(Driver.java:264)
25
    at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:55)
24
    at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:355)
23
    at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:115)
22
    at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:665)
21
    ... 30 common frames omitted
20
Caused by: java.net.UnknownHostException: %!s(<nil>)
19
    at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
18
    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
17
    at java.base/java.net.Socket.connect(Socket.java:609)
16
    at org.postgresql.core.PGStream.createSocket(PGStream.java:231)
15
    at org.postgresql.core.PGStream.<init>(PGStream.java:95)
14
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:98)
13
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
12
    ... 38 common frames omitted
11
2022.02.01 06:04:41 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[_client_][[timer]]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/java.lang.Thread.sleep(Native Method)\n app//org.elasticsearch.threadpool.ThreadPool$CachedTimeThread.run(ThreadPool.java:574)
10
2022.02.01 06:04:41 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[_client_][scheduler][T#1]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/jdk.internal.misc.Unsafe.park(Native Method)\n java.base@11.0.8/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)\n java.base@11.0.8/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)\n java.base@11.0.8/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)\n java.base@11.0.8/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n java.base@11.0.8/java.lang.Thread.run(Thread.java:834)
9
2022.02.01 06:04:41 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[_client_][transport_worker][T#1]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/sun.nio.ch.EPoll.wait(Native Method)\n java.base@11.0.8/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:120)\n java.base@11.0.8/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124)\n java.base@11.0.8/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:136)\n app//io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)\n app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:765)\n app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:413)\n app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)\n java.base@11.0.8/java.lang.Thread.run(Thread.java:834)
8
2022.02.01 06:04:41 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[_client_][generic][T#1]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/jdk.internal.misc.Unsafe.park(Native Method)\n java.base@11.0.8/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)\n java.base@11.0.8/java.util.concurrent.LinkedTransferQueue.awaitMatch(LinkedTransferQueue.java:743)\n java.base@11.0.8/java.util.concurrent.LinkedTransferQueue.xfer(LinkedTransferQueue.java:684)\n java.base@11.0.8/java.util.concurrent.LinkedTransferQueue.take(LinkedTransferQueue.java:1366)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)\n java.base@11.0.8/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n java.base@11.0.8/java.lang.Thread.run(Thread.java:834)
7
2022.02.01 06:04:41 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[_client_][transport_worker][T#2]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n java.base@11.0.8/sun.nio.ch.EPoll.wait(Native Method)\n java.base@11.0.8/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:120)\n java.base@11.0.8/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124)\n java.base@11.0.8/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:136)\n app//io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:62)\n app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:765)\n app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:413)\n app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:909)\n java.base@11.0.8/java.lang.Thread.run(Thread.java:834)
6
2022.02.01 06:04:42 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
5
2022.02.01 06:04:42 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
4
2022.02.01 06:04:42 INFO  app[][o.s.a.SchedulerImpl] Process[web] is stopped
3
2022.02.01 06:04:42 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 143
2
2022.02.01 06:04:42 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
1
2022.02.01 06:04:42 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped