Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-9013

Error 500 is generated when creating a custom rule from unknown template rule

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4
    • Component/s: Rules, Web API
    • Labels:

      Description

      The api/rules/create WS should return 404 when an unknown template rule key is provided.

      Here's the stacktrace when using api/rules/create?template_key=UNKNOWN

      > org.sonar.db.RowNotFoundException: Rule with key 'UNKNOWN' does not exist
      > 	at org.sonar.db.rule.RuleDao.selectOrFailByKey(RuleDao.java:51)
      > 	at org.sonar.server.rule.RuleCreator.create(RuleCreator.java:75)
      > 	at org.sonar.server.rule.ws.CreateAction.handle(CreateAction.java:151)
      > 	at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:103)
      > 	at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:86)
      > 	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.RedirectFilter.doFilter(RedirectFilter.java:61)
      > 	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(ThreadPoolExecutor.java:1142)
      > 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      > 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      > 	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

            People

            • Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              julien.lancelot Julien Lancelot
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: