Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

TaskDefinition validation error doesn't print actual value that is being validated #3611

@charybr

Description

@charybr

Describe the bug
TaskDefinition validation error doesn't print actual value that is being validated

Details

javax.validation.ConstraintViolationException: updateTaskDef.taskDefinition.retryCount: TaskDef retryCount: 10 must be <=10

2023-05-11 04:50:23.849 ERROR 25 --- [nio-8080-exec-9] c.n.c.r.c.ApplicationExceptionMapper     : Error ConstraintViolationException url: '/api/metadata/taskd
efs'

javax.validation.ConstraintViolationException: updateTaskDef.taskDefinition.retryCount: TaskDef retryCount: 10 must be <=10
        at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:120) ~[spring-context-5.3.19.jar!
/:5.3.19]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.19.jar!/:5.3.19]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.19.jar!/:5.3.19]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.19.jar!/:5.3.19]
        at com.netflix.conductor.service.MetadataServiceImpl$$EnhancerBySpringCGLIB$$d3d36b98.updateTaskDef(<generated>) ~[conductor-core-3.13.6.jar!/:3.13.6]
        at com.netflix.conductor.rest.controllers.MetadataResource.registerTaskDef(MetadataResource.java:104) ~[conductor-rest-3.13.6.jar!/:3.13.6]
        at jdk.internal.reflect.GeneratedMethodAccessor215.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.19.jar!/:5.3.19]
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.19.jar!/:5.3.19]
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[sprin
g-webmvc-5.3.19.jar!/:5.3.19]

This is coming from

@Max(value = 10, message = "TaskDef retryCount: {value} must be <=10")

@protofield(id = 3)
@min(value = 0, message = "TaskDef retryCount: {value} must be >= 0")
@max(value = 10, message = "TaskDef retryCount: {value} must be <=10")
private int retryCount = 3; // Default

Conductor version: 3.13.6
Persistence implementation: Dynomite
Queue implementation: Dynoqueues
Lock: noop_lock
Workflow definition: NA
Task definition: NA
Event handler definition: NA

To Reproduce

Expected behavior
Error should print both max value and value that is being validated. Something like

javax.validation.ConstraintViolationException: updateTaskDef.taskDefinition.retryCount: TaskDef retryCount: 12 must be <= 10

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions