Sharmadha S created ATLAS-4840:
----------------------------------
Summary: Audit aging : When invalid action is provided for audit
ageout , Atlas throws 500
Key: ATLAS-4840
URL: https://issues.apache.org/jira/browse/ATLAS-4840
Project: Atlas
Issue Type: Bug
Components: atlas-core
Reporter: Sharmadha S
+_*PROBLEM STATEMENT:*_+
When invalid action is provided for audit action , Atlas throws 500
_*+STEPS TO REPRODUCE:+*_
Post the following payload to ageout
{code:java}
{"auditAgingEnabled": true,
"defaultAgeoutEnabled": false,
"createEventsAgeoutAllowed": false,
"auditSweepoutEnabled": false,
"ignoreDefaultAgeoutTTL": false,
"customAgeoutAuditCount": 5,
"customAgeoutActionTypes": "INVALID_ACTION"}{code}
*_+CURRENT BEHAVIOUR:+_*
Atlas throws 500 with exception
{code:java}
ava.lang.IllegalArgumentException: No enum constant
org.apache.atlas.model.audit.EntityAuditEventV2.EntityAuditActionV2.INVALID_ACTION
{code}
*_+EXPECTED BEHAVIOUR:+_*
Atlas to throw 400 bad request or 404 action not found
{*}+OCCURRENCE+{*}:
Consistently reproducible.
_*+LOG ARTIFACTS:+*_
Atlas logs :
{code:java}
2023-10-17 09:40:14,933 ERROR org.apache.atlas.web.errors.ExceptionMapperUtil:
[etp776484396-171 - 14eb7b5e-1e3b-4c49-89df-15ace96b9b9c]: Error handling a
request: a686b52e776a3b22
java.lang.IllegalArgumentException: No enum constant
org.apache.atlas.model.audit.EntityAuditEventV2.EntityAuditActionV2.INVALID_ACTION
at
org.apache.atlas.repository.audit.AtlasAuditReductionService.getValidActionTypes(AtlasAuditReductionService.java:321)
~[atlas-repository-2.1.0.7.2.18.0-406.jar:2.1.0.7.2.18.0-406]
at
org.apache.atlas.repository.audit.AtlasAuditReductionService.buildAgeoutCriteriaForAllAgingTypes(AtlasAuditReductionService.java:195)
~[atlas-repository-2.1.0.7.2.18.0-406.jar:2.1.0.7.2.18.0-406]
at
org.apache.atlas.web.resources.AdminResource.ageoutAuditData(AdminResource.java:869)
~[atlas-webapp-2.1.0.7.2.18.0-406.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[?:1.8.0_382]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:1.8.0_382]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:1.8.0_382]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_382]
at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
~[jersey-server-1.19.4.jar:1.19.4]
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
~[jersey-servlet-1.19.4.jar:1.19.4]
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
~[jersey-servlet-1.19.4.jar:1.19.4]
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
~[jersey-servlet-1.19.4.jar:1.19.4]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
~[javax.servlet-api-3.1.0.jar:3.1.0]{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)