Sonarqube server is unreachable sometimes during the week via azure devops pipeline

Make sure to tell us:

  • What version are you upgrading from?
    From Version 8.9.1 to 9.9.1
  • System information (Operating system, Java version, Database provider/version)
    Windows server 2016, Java 17.0.7, Microsoft SQL Server/14.00.3456
  • What’s the issue you’re facing?

Dear Team,

Sometimes the sonarqube server is unreachable via our azure devops pipeline with the below error:
##[error][SQ] API GET '/api/server/version' failed, error was: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"10.160.xx.xx","port":9000}
I have to rerun the batch file on the server then it becomes available again.

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\bin\windows-x86-64>startsonar.bat
Starting SonarQube...
2023.07.03 06:42:49 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp
2023.07.03 06:42:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 12x.x.x.1:9084, TCP: 12x.x.x.1:37450]
2023.07.03 06:42:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\elasticsearch]: C:\Program Files\Java\jdk-17\bin\java -XX:+UseG1GC -Djava.io.tmpdir=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp -XX:ErrorFile=D:\LogFiles\SonarQubeDEV\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=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\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 -Delasticsearch -Des.path.home=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\elasticsearch -Des.path.conf=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2023.07.03 06:42:50 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.07.03 06:43:08 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.07.03 06:43:08 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595]: C:\Program Files\Java\jdk-17\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.1.69595.jar;D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.server.app.WebServer D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp\sq-process6799032941920575112properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/D:/Programmas/SonarQube%20Dev/sonarqube-developer-9.9.1.69595/lib/sonar-application-9.9.1.69595.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2023.07.03 06:43:35 INFO  app[][o.s.a.SchedulerImpl] Process[web] is up
2023.07.03 06:43:35 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[COMPUTE_ENGINE] from [D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595]: C:\Program Files\Java\jdk-17\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.lang=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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.9.1.69595.jar;D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\lib\jdbc\mssql\mssql-jdbc-11.2.2.jre17.jar org.sonar.ce.app.CeServer D:\Programmas\SonarQube Dev\sonarqube-developer-9.9.1.69595\temp\sq-process16832494696218960136properties
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/D:/Programmas/SonarQube%20Dev/sonarqube-developer-9.9.1.69595/lib/sonar-application-9.9.1.69595.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2023.07.03 06:43:48 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
2023.07.03 06:43:48 INFO  app[][o.s.a.SchedulerImpl] SonarQube is operational

Web.log

2023.07.03 10:25:06 INFO  web[][o.a.c.h.Http11Processor] Error parsing HTTP request header\n Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x020x000x010x000x010xfc0x030x03}IB0xe3$-0xb5'0x9a0xc120xa00x18S0x970xe50xa60x91$c0x97B0xecP0xc10x89Q_0x190xde0xb6_ ]. HTTP method names must be tokens
	at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:407)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:262)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:833)
2023.07.03 10:25:06 ERROR web[][o.a.c.h.Http11Processor] Error processing request
java.lang.NullPointerException: Cannot invoke "String.replaceFirst(String, String)" because the return value of "javax.servlet.http.HttpServletRequest.getRequestURI()" is null
	at org.sonar.server.platform.web.SecurityServletFilter.addSecurityHeaders(SecurityServletFilter.java:70)
	at org.sonar.server.app.SecureErrorReportValve.invoke(SecureErrorReportValve.java:36)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:833)

Kind Regards,
Kenaz

Hi Kenaz,

Welcome to the community!

I wouldn’t expect the bad-URL errors you’ve shown to interfere with server performance. Are there any other errors in any of your server logs?

 
Ann

Hi,

The issue has been resolved.
It was related to the sonarqube services on the server.

Kind Regards,
Kenaz