Git Product home page Git Product logo

chaos-monkey-spring-boot's Introduction

Apache License 2 Build Status codecov Maven Central Contributor Covenant

Open in Gitpod VS Code DevContainer

Chaos Monkey for Spring Boot

inspired by Chaos Engineering at Netflix

This project provides a Chaos Monkey for Spring Boot applications and will try to attack your running Spring Boot App.

Everything from getting started to advanced usage is explained in the Documentation for Chaos Monkey for Spring Boot

Introduction

If you're not familiar with the principles of chaos engineering yet, check out this blog post and enter the world of chaos engineering.

Chaos Engineering – withstanding turbulent conditions in production

Get familiar with the Chaos Monkey for Spring Boot in the following video, available on YouTube:

Chaos Monkey for Spring Boot

What is the goal of Chaos Monkey?

Inspired by PRINCIPLES OF CHAOS ENGINEERING, with a focus on Spring Boot, Chaos Monkey wants to test applications better and especially during operation.

After writing many unit and integration tests, a code coverage from 70% to 80%, this unpleasant feeling remains, how our baby behaves in production?

Many questions remain unanswered:

  • Will our fallbacks work?
  • How does the application behave with network latency?
  • What if one of our services breaks down?
  • Service Discovery works, but is our Client-Side-Load-Balancing also working?

As you can see, there are many more questions and open topics you have to deal with.

That was the start of Chaos Monkey for Spring Boot.

How does it work?

If Spring Boot Chaos Monkey is on your classpath and activated with profile name chaos-monkey, it will automatically hook into your application.

Now you can activate watchers, which look for classes to assault. There are also runtime assaults, which attack your whole application.

Be social and communicative!

If you start to implement Chaos Engineering at your company, then you must be a very social and communicative person. Why? Because you will get to know many of your colleagues personally in a very short time when your chaos experiments strike.

Check your resilience

Are your services already resilient and can handle failures? Don´t start a chaos experiment if not!

Implement active application monitoring

Check your monitoring and check if you can see the overall state of your system. There are many great tools out there to get a pleasant feeling about your entire system.

Define steady states

Define a metric to check a steady state of your service and of course your entire system. Start small with a service that is not critical.

Do not start in production

Of course, you can start in production, but keep in mind...

The best place on earth is...production!
Josh Long

...so let's keep production as the best place on earth and look for our first experiences on another stage. If all goes well, and you're confident, run it in production.

Documentation

Documentation

Help

We are using GitHub issues to track bugs, improvements and new features (for more information see Contributions). If you have a general question on how to use Chaos Monkey for Spring Boot, please ask on Stack Overflow using the tag #spring-boot-chaos-monkey.

Contributions

Chaos Monkey is open source and welcomes contributions from everyone. The contribution guideline is where you should begin in order to best understand how to contribute to this project.

Releases

Releases

chaos-monkey-spring-boot's People

Contributors

alexfincham avatar based2 avatar caps-looking avatar cdm-philipe-costa avatar chaosmonkeybot avatar checketts avatar chrispy404 avatar dependabot[bot] avatar f43nd1r avatar fletchgqc avatar kevin-peters avatar maiksensi avatar matthewberk avatar mattk-vmw avatar mbouchenoire avatar mmerla avatar ottlinger avatar renovate[bot] avatar riggs333 avatar sequarius avatar singhgarima avatar smreddy2004 avatar snieking avatar tiarebalbi avatar tuxdevelop avatar ultcyber avatar wonwoo avatar wtfjoke avatar yann-p avatar zenglawrence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chaos-monkey-spring-boot's Issues

Use the project in Microservices packages as war

Hi,

In some scenarios, the Spring boot applications are packages as war files to be executed in one application server. For that scenarios, Does exist some way to use the project?

Many thanks in advance

Juan Antonio

Enabled Exception and Kill Assault with disabled Latency assault wont work as expected

When checking for assault configuration following combination is evaluated the wrong way:

chaos.monkey.assaults.latencyActive=true
chaos.monkey.assaults.exceptionsActive=false
chaos.monkey.assaults.killApplicationActive=true

Both the checks for isLatencyAndKillAppActive() and isExceptionAndKillAppActive() in ChaosMonkey evaluate to true for this combination so that the latter check is never reached.

Regarding the assaultlevel for applications spawning thread internally

I have the boot application and which controller is calling the ervice it is spawning the async thread
which in turn spawning the parallel threads with below configurations:

async.config.core.pool.size=20
async.config.max.pool.size=20
async.config.queue.capacity=20

parallel.call.config.core.pool.size=30
parallel.call.config.max.pool.size=30
parallel.call.config.queue.capacity=30

Now , when I am running the load on this application with the assault level as 10 , i am not getting the 10% failure rate.

Is there any calculation which will decide the failure rate for the application , say suppose if I put the assault level as 10 then should it not cause the 10% failure rate?

memoryAssault

Hi,
I saw in your source code that there was a memoryAssault function. I managed to use it, but don't really understand how it works, especially how the memoryFillIncrementFraction and memoryFillTargetFraction parameters are used. Is there any documentation ? Or could you give me a brief explanation on it ?

Default settings don't work as documented

To reproduce:

  • Add chaos-monkey-spring-boot v2.0.2 dependency to maven
  • Add following application properties:
    spring.profiles.active=chaos-monkey
    chaos.monkey.enabled=true
    chaos.monkey.assaults.level=1
    
  • Start application and do something which uses a service.
    • Expected result: action successful with latency
    • Actual result: normal functionality
  • Add following application properties:
chaos.monkey.watcher.service=true
  • Start application and do something which uses a service.
    • Expected result: action successful with latency
    • Actual result: action successful with latency

Chaos Monkey integration with webflux and reactor core

Hi,
we try using version 2.0.2 version of chaos mokey with our application. ### We are using Spring Webflux (reactive web programing) + Reactor core (Reactor Netty), the spring boot version is (2.1.5.RELEASE) but I am getting exception from the service, without chaos monkey dependency it is working fine. I am suspecting whether Chaos Monkey supports reactive programming or not. Below are the exception can you please help.

[DEBUG] org.springframework.context.annotation.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@15d943d, started on Tue Jun 25 11:09:47 GST 2019
[ERROR] org.springframework.boot.SpringApplication - Application run failed
org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryConfiguration$EmbeddedNetty': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:82)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:67)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.emirates.ocsl.profileservice.Application.main(Application.java:30)

Custom Exception support

Application may handle the specific exception when interacting with its down stream layers/components, to increase application resiliency. But the current Exception Assault public class ExceptionAssault implements ChaosMonkeyAssault will throw RuntimeException only during attack, it will be hard for application level error handling. It would be good to have capability to specify exception type at experiment step, and the attack can raise it during the trial running.

let me know your thought, and I'm happy to contribute on it if the idea is agreeable.

Same value for latencyRangeStart and latencyRangeEnd on LatencyAssault causes runtime error

Currently its not possible to set latencyRangeStart and latencyRangeEnd to the same value to force a fixed instead of a ranged delay.

Even worse, this becomes apparent during runtime:

java.lang.IllegalArgumentException: bound must be greater than origin at java.util.concurrent.ThreadLocalRandom.nextInt(ThreadLocalRandom.java:378) at de.codecentric.spring.boot.chaos.monkey.assaults.LatencyAssault.attack(LatencyAssault.java:53)
A wrong configuration should be checked on property creation time (e.g. startup).
Using "workarounds" like setting 1000 and 1001 feels strange, so it should also be possible to set a fixed delay (same values).

Merge request incoming! ;)

Facing issue with @Component Watcher

I am using SB Chaos monkey 2.0.1 and SPring context 5.0. Getting the below error on app startup with @component watcher = true.

org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryConfiguration$EmbeddedNetty': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Unsatisfied dependency expressed through method 'setConverters' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.stream.config.SpelExpressionConverterConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:82) ~[spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-5.0.12.RELEASE.jar:5.0.12.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:67) ~[spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-2.0.8.RELEASE.jar:2.0.8.RELEASE]

Is Chaos Monkey Latency Assault causing IOExceptions with broken pipe?

When using Spring Boot Chaos Monkey Latency Assault I'm getting IOExceptions with the message Broken Pipe. It is only in test environment and it doesn't chrash my service but the it is harder to read the log and it does use some memory saving all the logs. Did I mess up any configuration? I only get this when using Chaos Monkey.
Here is my configuration:

spring:
  profiles:
    active: chaos-monkey
..
chaos:
  monkey:
    enabled: true
    watcher:
      rest-controller: true
      repository: true
      service: true
    assaults:
      level: 10
      latency-active: true

This is the error log:

org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:321) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:284) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.cloud.sleuth.instrument.web.TraceServletOutputStream.flush(TraceServletOutputStream.java:128) ~[spring-cloud-sleuth-core-1.3.2.RELEASE.jar!/:1.3.2.RELEASE]
	at com.fasterxml.jackson.core.json.UTF8JsonGenerator.flush(UTF8JsonGenerator.java:1054) ~[jackson-core-2.8.10.jar!/:2.8.10]
	at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:953) ~[jackson-databind-2.8.10.jar!/:2.8.10]
	at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:286) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:231) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:174) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81) ~[spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:113) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) ~[spring-boot-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110) ~[spring-boot-actuator-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.cloud.sleuth.instrument.web.TraceFilter.doFilter(TraceFilter.java:164) ~[spring-cloud-sleuth-core-1.3.2.RELEASE.jar!/:1.3.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) [spring-boot-actuator-1.5.10.RELEASE.jar!/:1.5.10.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar!/:4.3.14.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
Caused by: java.io.IOException: Broken pipe
	at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[na:1.8.0_111]
	at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[na:1.8.0_111]
	at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_111]
	at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_111]
	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[na:1.8.0_111]
	at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:157) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doWrite(NioEndpoint.java:1267) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.SocketWrapperBase.doWrite(SocketWrapperBase.java:670) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.SocketWrapperBase.flushBlocking(SocketWrapperBase.java:607) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.tomcat.util.net.SocketWrapperBase.flush(SocketWrapperBase.java:597) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.http11.Http11OutputBuffer$SocketOutputBuffer.flush(Http11OutputBuffer.java:646) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.http11.filters.ChunkedOutputFilter.flush(ChunkedOutputFilter.java:169) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.http11.Http11OutputBuffer.flush(Http11OutputBuffer.java:252) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.http11.Http11Processor.flush(Http11Processor.java:1560) [tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:285) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.coyote.Response.action(Response.java:173) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:317) ~[tomcat-embed-core-8.5.27.jar!/:8.5.27]
	... 61 common frames omitted

Reorg Assaults

Assault attacks are not choosen well, they are not fired correct, if all 3 are active.

KillAppAssault is not working

Hello,

we are using Jetty servlet stack together with Spring webflux.
If I use the KillAppAssault, i will get an error by the Thread.sleep(5000);

The error is:

13:02:16.148] [b34539e37b4747a78b70754a9e1dfb45] [INFO ] [tp1662417126-54] [org.eclipse.jetty.server.session        ] : node0 Stopped scavenging
[13:02:16.151] [b34539e37b4747a78b70754a9e1dfb45] [INFO ] [tp1662417126-54] [o.e.j.s.h.ContextHandler.application    ] : Destroying Spring FrameworkServlet 'dispatcherServlet'
[13:02:16.152] [b34539e37b4747a78b70754a9e1dfb45] [INFO ] [tp1662417126-54] [o.e.jetty.server.handler.ContextHandler ] : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@10f384a2{application,/,[file:///AppData/Local/Temp/jetty-docbase.8177349965831428657.8090/],UNAVAILABLE}
java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at my.MyResource.query(MyResource.java:71)
	at my.MyResource$$FastClassBySpringCGLIB$$3bcb8e2c.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at my.MyResource$$EnhancerBySpringCGLIB$$491d4ce9.query(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:645)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:873)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at com.bosch.bci.spring.tracing.CorrelationIdMirrorServletRequestFilter.doFilter(CorrelationIdMirrorServletRequestFilter.java:41)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at my.RequestBodySizeLimiter.doFilterInternal(RequestBodySizeLimiter.java:39)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at my.TenantIdValidator.doFilter(TenantIdValidator.java:85)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at com.bosch.bci.foundation.web.filter.DefaultRedirectHandler.doFilter(DefaultRedirectHandler.java:57)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter.doFilter(OAuth2ClientContextFilter.java:60)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:209)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.cloud.sleuth.instrument.web.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:50)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at brave.servlet.TracingFilter.doFilter(TracingFilter.java:86)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at my.RequestRejectedHandler.doFilter(RequestRejectedHandler.java:50)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:505)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
	at java.lang.Thread.run(Thread.java:748)

Anybody an Idea?

Latency Assault on the service layer which calls legacy SOAP/Rest Clients

I have the boot app with the chaos monkey enabled. I have induced the latency by using the properties

chaos.monkey.assaults.latencyRangeStart=3000 chaos.monkey.assaults.latencyRangeEnd=15000 chaos.monkey.assaults.latencyActive=true

Now, this is inducing the latency on the controller layer, But I have called various legacy endpoints(SOAP and Rest) in the service layer. Theseproperties are not inducing any latency on these backend clients.
Is there any other property that can induce the latency on the Soap/rest clients?

Receiving Timeouts from Chaos-monkey for my Application

I don't think this is a real issue. But, maybe I don't have a full understanding of how it works or what should have happened if I run my SpringBoot with ChaosMonkey. I have read the documentation but cannot fully understand how do I prove it is working or not. Can you please give us or explain to us what really happens when our Controllers, Service, Repository classes are intercepted and how was the problem found.

For me when I run my application and the demo app attached to this project I - I receive Chaos Monkey -timeout. Don't know what that is? Can you please help me, figure out.

Component Scan and instead of Spring Profile

Hey,
Have you thought about using a custom annotation, that enables scanning for components in this library? Instead of using a special spring profile.

The benefit would be, that everyone could define their own profiles and it's the solution chosen by most other libraries.

eg. @EnableCircuitBreaker from Hystrix

I'd like to try contributing this if you're open for it :)

Spring boot version 1.5.2.RELEASE is supported by chaos-monkey-spring-boot 1.0.1?

Hi Team,

is spring boot version 1.5.2.RELEASE is supported by chaos-monkey-spring-boot 1.0.1, we are seeing below error when trying to run the app by activating chaos monkey.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.EndpointConfiguration': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [de.codecentric.spring.boot.chaos.monkey.configuration.EndpointConfiguration$$EnhancerBySpringCGLIB$$bd1c4f5a]: No default constructor found; nested exception is java.lang.NoSuchMethodException: de.codecentric.spring.boot.chaos.monkey.configuration.EndpointConfiguration$$EnhancerBySpringCGLIB$$bd1c4f5a.<init>()

How to run the library externally?

Good afternoon,

I am doing a POC about the library running in this way:

java -cp ./target/spring-boot-chaos-poc-0.1.0-SNAPSHOT.jar \
-Dloader.path=chaos-monkey-spring-boot-2.0.0.jar \
org.springframework.boot.loader.PropertiesLauncher \
--spring.profiles.active=chaos-monkey

and if the property: chaos.monkey.watcher.controller: true appear in the configuration, the execution fails.

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-09-04 13:49:33.839 ERROR 70696 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'controllerAspect' defined in class path resource [de/codecentric/spri
ng/boot/chaos/monkey/configuration/ChaosMonkeyConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalSt
ateException: Failed to introspect Class [de.codecentric.spring.boot.chaos.monkey.watcher.SpringControllerAspect] from ClassLoader [org.springframework.boot.
loader.LaunchedURLClassLoader@17dca04]

...
...

Caused by: java.lang.NoClassDefFoundError: org/aspectj/lang/ProceedingJoinPoint
        at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_181]
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[na:1.8.0_181]
        at java.lang.Class.getDeclaredMethods(Unknown Source) ~[na:1.8.0_181]
        at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) ~[spring-core-5.0.8.RELEASE.jar!/:5.0.8.RELEASE]
        ... 30 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.ProceedingJoinPoint
        at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_181]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_181]
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93) ~[spring-boot-chaos-poc-0.1.0-SNAPSHOT.jar:0.1.0-
SNAPSHOT]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_181]


You can test it in the POC. I have isolated the scenario in this branch:
https://github.com/jabrena/spring-boot-chaos-poc/tree/feature/codecentric

How to run the example:

./runChaos.sh

Many thanks in advance

Juan Antonio

Chaos Monkey is disabled and continue injecting Exceptions

I have an app that use:
Spring boot version: 2.1.3.RELEASE,
Chaos Monkey: 2.0.0

i want to understand how Chaos monkey works, when i disable "chaos" by endpoint at runtime, i continue calling some Rest Services, i can get some "chaos monkey" exceptions even some latency remains that, but latency disappear after some calls but exceptions continue for more time

thanks

Replace profile chaos-monkey with property based

To activate/deactivate the Chaos Monkey at runtime, I want to switch from Spring Profile to a property base control.
We need to be able to turn Chaos Monkey on and off at any time. Only in this way are our chaos experiments under control and can be stopped at any time. Reduce the blast radius...!

Please vote up or down and share your thoughts!

chaos-monkey with spring-cloud-starter-netflix-hystrix

When I enable chaos-monkey with spring-cloud-netflix-hystrix I'm getting the below error during Spring boot startup. Without netflix-hystrix it works fine.

2018-10-29 14:53:04.207 INFO 77719 --- [ main] Application : The following profiles are active: chaos-monkey
2018-10-29 14:53:04.224 INFO 77719 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@68df9280: startup date [Mon Oct 29 14:53:04 MST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@c33b74f
2018-10-29 14:53:05.035 INFO 77719 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=fa61d064-389d-3aa4-ab1e-880a6fc12488
2018-10-29 14:53:05.374 INFO 77719 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$25a00ce0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-10-29 14:53:05.441 WARN 77719 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?
2018-10-29 14:53:05.452 INFO 77719 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-10-29 14:53:05.460 ERROR 77719 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at Application.main(Application.java:13) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:587) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1254) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:214) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
... 8 common frames omitted

This is my pom.xml dependencies.

org.springframework.boot spring-boot-starter-web 2.1.0.RC1
    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>chaos-monkey-spring-boot</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        <version>2.1.0.M1</version>
    </dependency>

Chaos Monkey for Spring boot not working with java11

Seems chaos-monkey-for-spring-boot is currently not working with java11. We should change that at some point. (Guess I would mark this as a feature request)

Basically two tests are failing:

Results :

Failed tests:   allowInterruptionOfAssaultDuringHoldPeriod(de.codecentric.spring.boot.chaos.monkey.assaults.MemoryAssaultIntegrationTest): Memory did not reach half exhaustion before timeout

Tests in error: 
  initializationError(de.codecentric.spring.boot.chaos.monkey.component.ChaosMonkeySchedulerTest): java.lang.reflect.InvocationTargetException
  initializationError(de.codecentric.spring.boot.chaos.monkey.assaults.LatencyAssaultTest): java.lang.reflect.InvocationTargetException

Tests run: 87, Failures: 1, Errors: 2, Skipped: 0

How to reproduce:

  • use java11 locally and run mvn test

Ability to attack on only specific apis

Example say we have three apis /getproductdetails, saveproductdetails,/deleteproductdetails etc..now can we have the ability to attack on specific apis only not sure whether we have this feature as of now.

Are response attacks supported?

I'm sorry if this is not an appropriate channel for questions, but I couldn't find another one.

I'm currently trying to comprehend chaos-monkey-spring-boot features and I noticed only attacks for requests. Are response attacks supported? It looks like, for example, that latency attack could be handy for responses too since it can simulate correct execution of business logic (including transactions) results of which arrive at the client with delay or not at all.

Tnx

Serialization problem when request "chaosmonkey" Endpoint

Spring boot version: 2.1.3.RELEASE
Chaos Monkey: 2.0.1

Getting this error when request
GET --> http://localhost:7001/chaos/actuator/chaosmonkey

{ "code": "500", "message": "Type definition error: [simple type, class org.springframework.aop.framework.DefaultAdvisorChainFactory]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.aop.framework.DefaultAdvisorChainFactory and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeySettings[\"assaultProperties\"]->de.codecentric.spring.boot.chaos.monkey.configuration.AssaultProperties$$EnhancerBySpringCGLIB$$b9e4d763[\"CGLIB$CALLBACK_0\"]->org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor[\"advised\"]->org.springframework.aop.framework.ProxyFactory[\"advisorChainFactory\"])" }

Add support for triggering attacks through a management api while app is running?

I would love to be able to trigger and turn-off attacks at runtime as this would then allow me to run temporary experiments against the system without restarting applications to load new configuration parameters around chaos.

I was thinking of something along the lines of a runtime switch to enable the management API:

chaos.monkey.api.enabled

There will likely be limitations about what can be triggered, depending on what has been enabled.

chaos-monkey-spring-boot is not runnning

Hi - Please check/suggest/help. Thanks.

cd /usr/share/chaos/chaos-monkey-spring-boot-master/chaos-monkey-spring-boot/
mvn clean install
BUILD SUCCESS

cd /usr/share/chaos/chaos-monkey-spring-boot-master/chaos-monkey-spring-boot/target
java -jar chaos-monkey-spring-boot-2.0.1-SNAPSHOT.jar --spring.profiles.active=chaos-monkey
Issue: no main manifest attribute, in chaos-monkey-spring-boot-2.0.1-SNAPSHOT.jar

Regards
Venkat

unable to hit chaosmonkey endpoints

I am using:

de.codecentric
chaos-monkey-spring-boot
1.5.0

I need to use this version as we are using springboot 1.5 in our application

Here is my basic config:
spring:
profiles: chaos-monkey
chaos:
monkey:
enabled: true
watcher:
controller: false
restController: false
service: false
repository: true
component: false
assaults:
level: 3
latencyActive: false
exceptionsActive: true
killApplicationActive: false
latencyRangeStart: 3000
latencyRangeEnd: 6000

When I hit any of the POST or GET chaosMonkey endpoints either from the browser or via curl i get 404 Not found in response

inadequate step by step documentation

Hi codecentric team,

I am trying to explore chaos monkey for spring boot microservice which I have deployed on Pivotal web service. I deploy microservice with 'cf push' command and it reads definition from manifest.yml file.
If I have to implement chaos monkey then can you please provide detailed steps in my setup?
I do not have : application.properties and application.yml inside my app. So how do I employ this tool?
Also if I enable dependency in pom.xml - where do I copy chaos monkey library inside my app?
I am sorry for these questions - I am a newbie in this field. Appreciate your help on this.

Thanks - Sachin

Demo app not running

when starting demo app
getting error as below.

No changes was done on the code.

no main manifest attribute, in chaos-monkey-demo-app-2.0.0-SNAPSHOT.jar

Relaxed binding is not used in conditions

I've configured chaos.monkey.watcher.rest-controller: true ( intellij completed 'rest-controller' for me, so I may be not only one with this issue :) ) and it turned out that code inside de.codecentric.spring.boot.chaos.monkey.conditions.AttackRestControllerCondition does not fetch it - it returns false because context.getEnvironment().getProperty("chaos.monkey.watcher.restController") seems to not take relaxed binding into consideration.

I'm not sure if it's because core of spring does not use relaxed binding or it's some other issue.

Add some more helper templates

It would be nice to have:

  • Contribution Guidelines (noting to update docs and release notes),
  • Code of Conduct,
  • PR template (to make sure there is an issue for that particular PR)

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency

We are trying to use this code in our Spring boot application. We use pivotal cloud foundry to deploy the code. When we have this in the application.yml:
spring:
profiles:
active: chaos-monkey
chaos:
monkey:
enabled: true

And also when we add watcher and try to re-stage or start the application. We are seeing errors:--

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?

Config errors

With spring boot 1.4 i am getting the config errors. Upgraded the project to 1.5 but the config error does not go away . If i remove the chaos monkey jar from pom.xml file then runtime error goes away.

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.wipro.coe.microservices.web.config.WebConfig]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration$DifferentManagementContextConfiguration due to org/springframework/boot/web/reactive/context/ConfigurableReactiveWebApplicationContext not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)

Support for annotations in pom.xml jar dependencies

I'm using chaos-monkey-for-spring-boot 1.5.0 with Spring boot 1.5.x

I have a SB application which contains a data access layer jar in it's pom.xml.

The application calls the dal methods to reach out to downstream db/ldap components via the Autowired classes from the DAL dependency, which is @repository annotated.

How can I inject latency after the DAL dependency methods are called?

Currently, I have set watcher properties as below:
"watcherProperties":{ "controller": true, "restController": false, "service": true, "repository": true, "component": false }
The application contains chaos-monkey-for-spring-boot pom dependency but the dal dependency doesn't.

MemoryAssault not working on systems with more than 32GB RAM

Expected Behavior

When setting up a memory assault I expect it to work in the following:

  • Docs tell me what I need to consider when using this type of attack (like that there is a grain of error for such attacks, and that they need to be fine-tuned from system to system).

Current Behavior

  • On systems with more RAM than 32GB memory assault does not work propery (available heap and memory fill percent do not correlate as expected)

Possible Solution

  • Refactor the corresponding attack to be more concise and easier to understand. Refactor it so that it does one thing and one thing only.
  • Add docs so with good examples so that it is clear to a possible user on what to expect from that attack.

Steps to Reproduce

  • Use current snapshot build
  • Run for example on java 11 >= 32GB RAM
  • run MemoryAssaultIntegrationTests

Assault level max

We love this library! Would you mind if we submitted a pr to raise the assult level max from 10 to 1000? Thanks!

Supporting metrics features from v2.0.1 on v1.5.0.

Would the metric features on version 2.0.1 be replicated to version 1.5.0? Some applications are running on spring boot 1.5.0, and would take long to migrate to version 2.0 due to their complexity before they are able to use chaos-monkey-spring-boot. Would be great if you share your plans/thoughts on this.

I have an error using this path("/actuator/chaosmonkey");Is there a serialization problem?

{
"timestamp": "2019-06-03T12:31:34.711+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Type definition error: [simple type, class org.springframework.validation.beanvalidation.MethodValidationInterceptor]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.validation.beanvalidation.MethodValidationInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeySettings["assaultProperties"]->de.codecentric.spring.boot.chaos.monkey.configuration.AssaultProperties$$EnhancerBySpringCGLIB$$6141c1b["advisors"]->org.springframework.aop.support.DefaultPointcutAdvisor[0]->org.springframework.aop.support.DefaultPointcutAdvisor["advice"])",
"path": "/actuator/chaosmonkey"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.