SonarQube 7.1 - Debian-Installation – Verbindung abgelehnt

SonarQube 7.1 - Debian-Installation – Verbindung abgelehnt

Ich habe Probleme beim ersten Ausführen von SonarQube 7.1. In den Protokollen ist immer noch der folgende Fehler zu sehen:

./sonar.sh console

org.elasticsearch.transport.ConnectTransportException: [][127.0.0.1:9001] connect_timeout[30s]
    at org.elasticsearch.transport.netty4.Netty4Transport.connectToChannels(Netty4Transport.java:362)
    at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:570)
    at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:117)
    at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351)
    at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:407)
    at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:357)
    at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledNodeSampler.run(TransportClientNodesService.java:390)
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:9001
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:352)
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:632)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    ... 1 common frames omitted
Caused by: java.net.ConnectException: Connection refused
    ... 10 common frames omitted

Ich versuche, es auf Ubuntu 19.10 und Debian 10 auszuführen. Warum eine so veraltete Version? Weil ich herausfinden muss, wie ich es auf die neueste Version aktualisieren kann. Deshalb erstelle ich eine Testumgebung dafür. Vor langer Zeit hat jemand die aktuelle Produktionsversion erstellt, seitdem hat sie niemand mehr angerührt :)

Was bisher getan wurde: – Ich habe ufw und iptables angehalten und deaktiviert. – Die Java-Version ist fast dieselbe wie in der Produktion.

sonarqube@sonarqube-srv:/$ java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
sonar configuration looks like this:
sonarqube@sonarqube-srv:/$ grep "^[^#;]" /opt/sonarqube-7.1/conf/sonar.properties 
sonar.web.javaOpts=-Xmx2048m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.web.host=127.0.0.1
sonar.web.context=/sonarqube
sonar.web.port=9000
sonar.ce.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.search.javaOpts=-Xms512m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError
sonar.search.port=9001
sonar.search.host=127.0.0.1
sonar.log.level=DEBUG
sonar.log.level.app=DEBUG
sonar.log.level.web=DEBUG
sonar.log.level.ce=DEBUG
sonar.log.level.es=DEBUG
sonar.log.rollingPolicy=time:yyyy-MM-dd
sonar.log.maxFiles=7
sonar.web.accessLogs.enable=true
sonar.telemetry.enable=false

Wenn ich ./sonar.sh start statt ./sonar.sh console ausführe, erhalte ich einen Fehler wie diesen:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fe83110eb21, pid=5723, tid=0x00007fe848814700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_231-b11) (build 1.8.0_231-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 21 C1 java.lang.String.getChars(II[CI)V (62 bytes) @ 0x00007fe83110eb21 [0x00007fe83110eb00+0x21]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/sonarqube-7.1/elasticsearch/hs_err_pid5723.log

Antwort1

Ich hatte diesen Fehler schon einmal. Die Lösung für mich war:

  1. Stellen Sie sicher, dass der Benutzer, der Sonar ausführt, über Berechtigungen für den Sonar-Stammordner verfügt. Sie können dies tun, indem Sie Folgendes ausführen:sudo chown -R <sonar-user>:<sonar-user-group> <sonar installation dir>
  2. Falls nicht benötigt, löschen Sie die Temp- und Protokollordner im Sonar-Installationsverzeichnis (oder benennen Sie sie um).

verwandte Informationen