You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SonarQube 10.7.0启动失败:Elasticsearch本地库加载异常

SonarQube 10.7.0启动失败问题

环境信息

  • SonarQube版本:10.7.0.96327
  • Java版本:
    java 17.0.12 2024-07-16 LTS
    Java(TM) SE Runtime Environment (build 17.0.12+8-LTS-286)
    Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)
    

问题现象

此前服务运行正常,今日启动Sonar服务时失败,Elasticsearch启动后异常退出,退出码为1。

已尝试操作

  • 检查Elasticsearch(ES)和SonarQube(SQ)日志
  • 将zstd-v1.5.6-win64添加至ES/lib目录,问题未解决

启动命令及日志详情

执行启动命令:

PS D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\bin\windows-x86-64> .\StartSonar.bat

日志输出:

Starting SonarQube...
2024.10.25 11:34:49 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\temp
2024.10.25 11:34:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:52449]
2024.10.25 11:34:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\elasticsearch]: C:\Program Files\Java\jdk-17\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\elasticsearch -Des.path.conf=D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\temp\conf\es -Des.distribution.type=tar -cp D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\elasticsearch\lib*;D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\elasticsearch\lib\cli-launcher* org.elasticsearch.launcher.CliToolLauncher
2024.10.25 11:34:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.10.25 11:34:50 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2024.10.25 11:34:50 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327]: C:\Program Files\Java\jdk-17\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\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 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.7.0.96327.jar;D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\lib\jdbc\h2\h2-2.2.224.jar org.sonar.server.app.WebServer D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\temp\sq-process8445048974899513524properties
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:/docs/sonarqube-10.7.0.96327/sonarqube-10.7.0.96327/lib/sonar-application-10.7.0.96327.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
ERROR: Elasticsearch did not exit normally - check the logs at D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\logs\sonarqube.log

ERROR: Elasticsearch died while starting up, with exit code 1
2024.10.25 11:35:02 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2024.10.25 11:35:02 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.10.25 11:35:16 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2024.10.25 11:35:16 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
PS D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\bin\windows-x86-64>

排查建议

  1. 查看Elasticsearch独立日志(路径:D:\docs\sonarqube-10.7.0.96327\sonarqube-10.7.0.96327\logs\elasticsearch.log),获取更详细的错误原因,比如文件权限、内存不足、zstd依赖不匹配等
  2. 确认zstd文件是否正确放置:需将对应版本的JNI文件(如zstd-jni-1.5.6-1-win64.dll)放入ES的lib目录,而非单纯的zstd压缩包文件
  3. 检查SonarQube的temp目录权限,确保运行服务的用户拥有读写权限
  4. 清理SonarQube的temp目录后重新启动服务
  5. 确认Java环境变量配置正确,避免多个Java版本冲突

内容的提问来源于stack exchange,提问作者user27979170

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 20:24:55