gpt4 book ai didi

docker - 错误:无法访问SonarQube服务器[http://localhost:9000]

转载 作者:行者123 更新时间:2023-12-02 18:53:41 27 4
gpt4 key购买 nike

我运行Jenkins,对每个docker进行声纳,然后在sonarqube docker中安装声纳扫描仪。我在浏览器localhost:9000中检查了sonarqube
我在jenkins中配置了sonarqube和github repo,并且在jenkins中构建了项目,但出现错误MSG

Started by user user
Building in workspace /bitnami/jenkins/workspace/refrigerator-manager
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/dean-
kim/refrigerator-manager # timeout=10
Fetching upstream changes from https://github.com/dean-
kim/refrigerator-manager
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress https://github.com/dean-
kim/refrigerator-manager +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} #
timeout=10
Checking out Revision 619639b2a173a3aa58ec05c13442168f7a8e49dd
(refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 619639b2a173a3aa58ec05c13442168f7a8e49dd
Commit message: "fix sonar-project.properties file"
> git rev-list --no-walk 619639b2a173a3aa58ec05c13442168f7a8e49dd #
timeout=10
[refrigerator-manager] $ /sonar-scanner-3.1.0.1141-linux/bin/sonar-
scanner -Dsonar.host.url=http://localhost:9000 ******** -
Dsonar.projectName=Refrigerator-manager -Dsonar.projectVersion=1.0 -
Dsonar.sourceEncoding=UTF-8 -Dsonar.projectKey=my:project -
Dsonar.host.url=http://localhost:9000 -
Dsonar.sources=refrigeratior_manager -
Dsonar.projectBaseDir=/bitnami/jenkins/workspace/refrigerator-manager
INFO: Scanner configuration file: /sonar-scanner-3.1.0.1141-
linux/conf/sonar-scanner.properties
INFO: Project root configuration file:
/bitnami/jenkins/workspace/refrigerator-manager/sonar-
project.properties
INFO: SonarQube Scanner 3.1.0.1141
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 4.9.41-moby amd64
INFO: User cache: /home/tomcat/.sonar/cache
ERROR: SonarQube server [http://localhost:9000] can not be reached
INFO: -----------------------------------------------------------------
-------
INFO: EXECUTION FAILURE
INFO: -----------------------------------------------------------------
-------
INFO: Total time: 0.441s
INFO: Final Memory: 3M/59M
INFO: -----------------------------------------------------------------
-------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to execute SonarQube
ERROR: Caused by: Fail to get bootstrap index from server
ERROR: Caused by: Failed to connect to localhost/127.0.0.1:9000
ERROR: Caused by: Connection refused (Connection refused)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full
debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the
SonarScanner succedeed?
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

这是我的github存储库项目根目录中的sonar-project.properties。
sonar.projectKey=my:project
sonar.projectName=Refrigerator-manager
sonar.projectVersion=1.0

sonar.sources=refrigeratior_manager

sonar.host.url=http://localhost:9000

这是我的sonarqube的 Jenkins 系统配置

enter image description here

这是我的詹纳斯声纳扫描仪的全局工具配置

enter image description here

这是我的Jenkins项目配置,用于执行声纳扫描仪

enter image description here

我几天前在Google上搜索了解决此问题的方法,但找不到解决方案。

最佳答案

从Jenkins进行构建时,您的声纳扫描仪是否正在运行?
如果不是,它将抛出以上消息,因为jenkins试图监听端口9000,但那里什么也没有。

关于docker - 错误:无法访问SonarQube服务器[http://localhost:9000],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50165985/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com