1

我正在尝试通过 HTTP 安装和卸载 SonarQube 插件。

如果我打电话http://localhost:9000/api/plugins/installed,我会按预期获得已安装插件的列表:

 {"plugins": [
    {
    "key": "csharp",
    "name": "C#",
    "description": "Enables scanning of C# source files",
    "version": "5.7.0.612",
    "license": "GNU LGPL 3",
    "organizationName": "SonarSource",
    "organizationUrl": "http://www.sonarsource.com",
    "homepageUrl": "http://redirect.sonarsource.com/plugins/csharp.html",
    "issueTrackerUrl": "https://jira.sonarsource.com/browse/SONARCS",
    "implementationBuild": "6c7d5830a41c62429eade2ead6e3fdf12a388856"
},
...

但是,如果我尝试使用请求卸载 csharp 插件

POST /api/plugins/uninstall?key=csharp

我明白了

{"errors": [{"msg": "An error has occurred. Please contact your administrator"}]}

在 web.log 文件中,我看到以下异常:

2017.05.26 17:32:07 INFO  web[AVxFChf8uJOZQnKwAAGX][o.s.s.p.ServerPluginRepository] Uninstalling plugin C# [csharp]
2017.05.26 17:32:07 ERROR web[AVxFChf8uJOZQnKwAAGX][o.s.s.w.WebServiceEngine] Fail to process request http://localhost:9000/api/plugins/uninstall?key=csharp
java.lang.IllegalStateException: Fail to uninstall plugin C# [csharp]
    at org.sonar.server.plugins.ServerPluginRepository.uninstall(ServerPluginRepository.java:309)
    at org.sonar.server.plugins.ws.UninstallAction.handle(UninstallAction.java:65)
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:103)
    at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:85)
    at org.sonar.server.platform.web.MasterServletFilter$GodFilterChain.doFilter(MasterServletFilter.java:126)
    at org.sonar.server.platform.web.MasterServletFilter.doFilter(MasterServletFilter.java:95)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:76)
    at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:72)
    at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:48)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:60)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Source 'C:\Users\me\Programme\sonarqube-6.3.1\extensions\plugins\sonar-csharp-plugin-5.7.0.612.jar' does not exist
    at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2819)
    at org.apache.commons.io.FileUtils.moveFileToDirectory(FileUtils.java:2871)
    at org.sonar.server.plugins.ServerPluginRepository.uninstall(ServerPluginRepository.java:307)
    ... 43 common frames omitted

这是一个错误还是我必须做一些不同的事情?

4

1 回答 1

1

api/plugins/uninstall当为同一个插件多次调用Web 服务时,这是一个错误。更多详细信息,请访问https://jira.sonarsource.com/browse/SONAR-9333

于 2017-05-26T16:04:40.920 回答