clusterfk / chaos-proxy

ClusterFk Chaos Proxy is an unreliable HTTP proxy you can rely on; a lightweight tool designed for chaos testing of microservices.
http://clusterfk.it
GNU General Public License v3.0
97 stars 11 forks source link

500 when encoded curly brackets are in the URL #3

Open bgvozdev opened 4 years ago

bgvozdev commented 4 years ago

curl http://127.0.0.1:8080/%7B%7D

{"timestamp":"2019-10-23T03:18:46.727+0000","status":500,"error":"Internal Server Error","message":"Invalid character '{' for PATH in \"/{}\"","path":"/%7B%7D"}
user-service-chaos-proxy_1  | 2019-10-23 03:18:46.725 ERROR 1 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Invalid character '{' for PATH in "/{}"] with root cause
user-service-chaos-proxy_1  |
user-service-chaos-proxy_1  | java.lang.IllegalArgumentException: Invalid character '{' for PATH in "/{}"
user-service-chaos-proxy_1  |   at org.springframework.web.util.HierarchicalUriComponents.verifyUriComponent(HierarchicalUriComponents.java:409) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.HierarchicalUriComponents.access$100(HierarchicalUriComponents.java:52) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.verify(HierarchicalUriComponents.java:876) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.HierarchicalUriComponents.verify(HierarchicalUriComponents.java:373) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.HierarchicalUriComponents.<init>(HierarchicalUriComponents.java:144) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.UriComponentsBuilder.buildInternal(UriComponentsBuilder.java:400) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:388) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at dev.andymacdonald.controller.ChaosController.buildUri(ChaosController.java:86) ~[classes!/:0.0.1-SNAPSHOT]
user-service-chaos-proxy_1  |   at dev.andymacdonald.controller.ChaosController.proxy(ChaosController.java:61) ~[classes!/:0.0.1-SNAPSHOT]
user-service-chaos-proxy_1  |   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_212]
user-service-chaos-proxy_1  |   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_212]
user-service-chaos-proxy_1  |   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_212]
user-service-chaos-proxy_1  |   at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_212]
user-service-chaos-proxy_1  |   at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) ~[spring-boot-actuator-2.1.5.RELEASE.jar!/:2.1.5.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) ~[spring-boot-actuator-2.1.5.RELEASE.jar!/:2.1.5.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) ~[spring-boot-actuator-2.1.5.RELEASE.jar!/:2.1.5.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.7.RELEASE.jar!/:5.1.7.RELEASE]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
user-service-chaos-proxy_1  |   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
user-service-chaos-proxy_1  |   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.19.jar!/:9.0.19]
user-service-chaos-proxy_1  |   at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
user-service-chaos-proxy_1  |
AndyMacDroo commented 4 years ago

Thanks for raising @bgvozdev - I'll need to take a look at the way encoding is happening here. Will follow up with a PR once resolved.