问题描述
我为 sonarqube 拉取了最新的 docker 镜像,镜像运行良好。 sonarqube 服务器正在侦听 localhost:9000。当我运行 dotnet sonarscanner begin
来分析 asp.net Core 3.1 项目时,一段时间后,出现超时错误。下面是命令的日志
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories...
18:47:29.653 Updating build integration targets...
18:49:09.803 Failed to request and parse 'http://localhost:9000/api/server/version': The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
18:49:09.811 The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
18:49:09.814 Pre-processing failed. Exit code: 1
API 请求通过 Postman 工作正常。失败的原因是什么?
解决方法
在我尝试将端口 9000 更改为 8000 并重试后,它成功了!
ports:
- "8000:9000"