Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Bad Request when trying Close an incident #28

Open
irom77 opened this issue Aug 22, 2022 · 0 comments
Open

Getting Bad Request when trying Close an incident #28

irom77 opened this issue Aug 22, 2022 · 0 comments

Comments

@irom77
Copy link

irom77 commented Aug 22, 2022

Description

Getting _Bad Request: _{"success":false,"title":null,"message":"Bad Request","hints":[],"error_code":"generic"} when trying to close an incident in SOAR using resilient-lib , see below (incident_id is str).

res = close_incident(
            res_client=res_client,
            incident_id=incident_id,
            kwargs={"resolution_id": "Not an Issue", "resolution_summary": "Lookup table updated",
                    "remediation_plan":"No Action Required", "business_unit":"IT - Information Security", 
                    "escalation":"None", "location":"Corp"}, 
            handle_names=True
        )

Resilient-lib version is 41.0.1976 and Resilient itself 42.2.41

Describe How to Reproduce

Close incident with parameters above or similar

/usr/share/co3/logs/client.log

I can see in client.log Invalid class com.co3.json.handle.ObjectHandleList value: (class=class java.lang.String, value=No Action Required). The value "No Action Required" of is valid for "remediation_plan"

12:07:46.036 [http-nio-443-exec-28] INFO  [] com.co3.web.rest.Co3ExceptionMapperBase - Mapping exception to REST

java.lang.IllegalStateException: Invalid class com.co3.json.handle.ObjectHandleList value:  (class=class java.lang.String, value=No Action Required)
        at com.co3.dto.PatchValueDTO.newUnexpectedValueException(PatchValueDTO.java:346)
        at com.co3.dto.PatchValueDTO.convertValue(PatchValueDTO.java:327)
        at com.co3.dto.PatchValueDTO.getIds(PatchValueDTO.java:89)
        at com.resilient.util.PatchValueDTOUtil.getPatchValueDTOValue(PatchValueDTOUtil.java:32)
        at com.co3.web.services.PatchService.patch(PatchService.java:257)
        at com.co3.web.services.IncidentPatchService.patch(IncidentPatchService.java:69)
        at com.co3.web.services.IncidentPatchService.patchIncident(IncidentPatchService.java:87)
        at com.co3.web.services.IncidentPatchService.patchIncident(IncidentPatchService.java:131)
        at com.co3.web.rest.IncidentREST.patchIncident(IncidentREST.java:229)
        at com.co3.guice.RESTGuiceModule.lambda$bindTimerInterceptor$6(RESTGuiceModule.java:162)
        at com.co3.guice.RESTGuiceModule$$Lambda$48/0x00000000a50fe000.invoke(Unknown Source)
        at com.co3.guice.RESTGuiceModule.lambda$bindOpenTracingInterceptor$7(RESTGuiceModule.java:194)
        at com.co3.guice.RESTGuiceModule$$Lambda$47/0x00000000a50fdbd0.invoke(Unknown Source)
        at com.co3.guice.RESTGuiceModule.lambda$bindValidateSessionInterceptor$5(RESTGuiceModule.java:151)
        at com.co3.guice.RESTGuiceModule$$Lambda$46/0x00000000a50fd910.invoke(Unknown Source)
        at com.co3.guice.RESTGuiceModule.lambda$bindTwoFactorAuthInterceptor$4(RESTGuiceModule.java:135)
        at com.co3.guice.RESTGuiceModule$$Lambda$45/0x00000000a50fd5f0.invoke(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor2603.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:508)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
        at com.co3.json.serialize.OutputFormatServletFilter.doFilter(OutputFormatServletFilter.java:132)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.co3.web.servlet.Co3ServletFilterBase.handleAuthenticatedRequests(Co3ServletFilterBase.java:409)
        at com.co3.web.servlet.Co3ServletFilterBase.doFilterImpl(Co3ServletFilterBase.java:374)
        at com.co3.web.servlet.Co3ServletFilterBase.lambda$doFilterWithRetry$3(Co3ServletFilterBase.java:318)
        at com.co3.web.servlet.Co3ServletFilterBase$$Lambda$564/0x00000000a8299d20.run(Unknown Source)
        at net.jodah.failsafe.Functions.lambda$toSupplier$10(Functions.java:240)
        at net.jodah.failsafe.Functions$$Lambda$566/0x00000000a829a760.get(Unknown Source)
        at net.jodah.failsafe.Functions.lambda$get$0(Functions.java:48)
        at net.jodah.failsafe.Functions$$Lambda$567/0x00000000a829ab60.get(Unknown Source)
        at net.jodah.failsafe.RetryPolicyExecutor.lambda$supply$0(RetryPolicyExecutor.java:62)
        at net.jodah.failsafe.RetryPolicyExecutor$$Lambda$568/0x00000000a829b860.get(Unknown Source)
        at net.jodah.failsafe.RetryPolicyExecutor.lambda$supply$0(RetryPolicyExecutor.java:62)
        at net.jodah.failsafe.RetryPolicyExecutor$$Lambda$568/0x00000000a829b860.get(Unknown Source)
        at net.jodah.failsafe.FallbackExecutor.lambda$supply$0(FallbackExecutor.java:43)
        at net.jodah.failsafe.FallbackExecutor$$Lambda$569/0x00000000a829bcc0.get(Unknown Source)
        at net.jodah.failsafe.Execution.executeSync(Execution.java:129)
        at net.jodah.failsafe.FailsafeExecutor.call(FailsafeExecutor.java:376)
        at net.jodah.failsafe.FailsafeExecutor.run(FailsafeExecutor.java:210)
        at com.co3.web.servlet.Co3ServletFilterBase.doFilterWithRetry(Co3ServletFilterBase.java:318)
        at com.co3.web.servlet.Co3ServletFilterBase.doFilter(Co3ServletFilterBase.java:280)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.co3.web.filter.DbQueryLoggerFilter.doFilter(DbQueryLoggerFilter.java:42)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.co3.web.filter.HttpFilter.doFilter(HttpFilter.java:38)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.co3.web.filter.PreprocessRequestFilter.doFilter(PreprocessRequestFilter.java:41)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
        at com.co3.tomcat.valves.RequestAccessLogValve.invoke(RequestAccessLogValve.java:84)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:772)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:451)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1201)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1782)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1741)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:825)
Caused by: java.lang.IllegalArgumentException: Cannot deserialize instance of `com.co3.json.handle.ObjectHandleList<com.co3.json.handle.ObjectHandle>` out of VALUE_STRING token
at [Source: UNKNOWN; line: -1, column: -1]
        at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4234)
        at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4165)
        at com.co3.dto.PatchValueDTO.convertValue(PatchValueDTO.java:325)
        ... 89 common frames omitted
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.co3.json.handle.ObjectHandleList<com.co3.json.handle.ObjectHandle>` out of VALUE_STRING token
at [Source: UNKNOWN; line: -1, column: -1]
        at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
        at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1468)
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1242)
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1190)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:337)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:270)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:250)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
        at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:4229)
        ... 91 common frames omitted

 



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant