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

WS api/tests/list should return 404 when 'testFileId' is unknown

    Details

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

      Description

      The query http://localhost/api/tests/list?testFileId=<UNKNOWN> is failing with an error 500.
      It should instead fail with an error 404.

      Here's the stacktrace :

      2017.01.13 10:09:23 ERROR web[AVlzivBn9opnLh2ZBMhc][o.s.s.w.WebServiceEngine] Fail to process request http://172.30.2.252:12475/api/tests/list?testFileId=2a792d03-aea2-4ef7-9c67-9ac06d99c5c3.
      org.sonar.db.RowNotFoundException: Component with uuid '2a792d03-aea2-4ef7-9c67-9ac06d99c5c3.' not found
              at org.sonar.db.component.ComponentDao.selectOrFailByUuid(ComponentDao.java:67)
              at org.sonar.server.test.ws.ListAction.checkComponentUuidPermission(ListAction.java:248)
              at org.sonar.server.test.ws.ListAction.searchTestsByTestFileUuid(ListAction.java:237)
              at org.sonar.server.test.ws.ListAction.searchTests(ListAction.java:206)
              at org.sonar.server.test.ws.ListAction.handle(ListAction.java:145)
              at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:108)
              at org.sonar.server.ws.WebServiceFilter.doFilter(WebServiceFilter.java:74)
              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:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:83)
              at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:66)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.sonar.server.platform.web.SecurityServletFilter.doHttpFilter(SecurityServletFilter.java:73)
              at org.sonar.server.platform.web.SecurityServletFilter.doFilter(SecurityServletFilter.java:49)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:55)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.sonar.server.platform.web.requestid.RequestIdFilter.doFilter(RequestIdFilter.java:63)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:62)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
              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:88)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
              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:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: