IllegalStateException:通过 VPN 在 Sonarcube 上出现 403 错误
IllegalStateException: 403 error on Sonarcube via VPN
Sonarcube 服务器在我们公司的 VPN 服务器后面。如果我连接到 VPN,我可以毫无问题地在浏览器中访问声纳。但是从 sonarCLI 或 IntelliJ 插件连接时出现以下错误
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher[=10=](IsolatedLauncherFactory.java:76)
... 155 more
Caused by: java.lang.IllegalStateException: Status returned by url [https://sonarqube.ourtesco.com/batch/index] is not valid: [403]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:118)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
... 158 more
在连接到服务器时添加代理解决了这个问题。
Sonarcube 服务器在我们公司的 VPN 服务器后面。如果我连接到 VPN,我可以毫无问题地在浏览器中访问声纳。但是从 sonarCLI 或 IntelliJ 插件连接时出现以下错误
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher[=10=](IsolatedLauncherFactory.java:76)
... 155 more
Caused by: java.lang.IllegalStateException: Status returned by url [https://sonarqube.ourtesco.com/batch/index] is not valid: [403]
at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:118)
at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
... 158 more
在连接到服务器时添加代理解决了这个问题。