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

Execution topology didn't work with Executable tasks #3757

Closed
loicmathieu opened this issue May 16, 2024 · 0 comments
Closed

Execution topology didn't work with Executable tasks #3757

loicmathieu opened this issue May 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@loicmathieu
Copy link
Member

Describe the issue

Try for ex this flow:

id: subflow
namespace: company.myteam

tasks:
  - id: subflow
    type: io.kestra.plugin.core.flow.Subflow
    flowId: hello-world
    namespace: company.myteam

When you create an execution and try to access the topology of this execution you will end up with the following exception:

2024-05-16 16:41:29,949 ERROR io-executor-thread-9 i.m.http.server.RouteExecutor Unexpected error occurred: Error encoding object [FlowGraph(nodes=[AbstractGraph(uid=root.2D5EDk6JBf6cyALIYyUUwe, type=io.kestra.core.models.hierarchies.GraphClusterRoot, error=false), AbstractGraph(uid=root.5lulGI4p1H24anJ2MMN1sW, type=io.kestra.core.models.hierarchies.GraphClusterEnd, error=false), AbstractGraphTask(super=AbstractGraph(uid=root.subflow, type=io.kestra.core.models.hierarchies.SubflowGraphTask, error=false), task=io.kestra.core.models.tasks.TaskForExecution@169dfdda, taskRun=TaskRun(tenantId=null, id=21HhsFbYQtwMl1AJfvzhl5, executionId=3vmvlRbOrVfBjvQMWayP4I, namespace=company.myteam, flowId=subflow, taskId=subflow, parentTaskRunId=null, value=null, attempts=[TaskRunAttempt(state=State(current=SUCCESS, histories=[State.History(state=CREATED, date=2024-05-16T14:41:27.409Z), State.History(state=SUCCESS, date=2024-05-16T14:41:27.409Z)]))], outputs={state=SUCCESS, executionId=5uQFgf7vkBhyorTTn7uQZw}, state=State(current=SUCCESS, histories=[State.History(state=CREATED, date=2024-05-16T14:41:25.353Z), State.History(state=RUNNING, date=2024-05-16T14:41:25.394Z), State.History(state=SUCCESS, date=2024-05-16T14:41:27.408Z)]), iteration=null), values=[], relationType=SEQUENTIAL)], edges=[FlowGraph.Edge(source=root.2D5EDk6JBf6cyALIYyUUwe, target=root.subflow, relation=Relation(relationType=null, value=null)), FlowGraph.Edge(source=root.subflow, target=root.5lulGI4p1H24anJ2MMN1sW, relation=Relation(relationType=null, value=null))], clusters=[], flowables=null)] to JSON: class io.kestra.core.models.tasks.TaskForExecution cannot be cast to class io.kestra.core.models.tasks.ExecutableTask (io.kestra.core.models.tasks.TaskForExecution and io.kestra.core.models.tasks.ExecutableTask are in unnamed module of loader 'app') (through reference chain: io.kestra.core.models.hierarchies.FlowGraph["nodes"]->java.util.ArrayList[2]->io.kestra.core.models.hierarchies.SubflowGraphTask["executableTask"])
io.micronaut.http.codec.CodecException: Error encoding object [FlowGraph(nodes=[AbstractGraph(uid=root.2D5EDk6JBf6cyALIYyUUwe, type=io.kestra.core.models.hierarchies.GraphClusterRoot, error=false), AbstractGraph(uid=root.5lulGI4p1H24anJ2MMN1sW, type=io.kestra.core.models.hierarchies.GraphClusterEnd, error=false), AbstractGraphTask(super=AbstractGraph(uid=root.subflow, type=io.kestra.core.models.hierarchies.SubflowGraphTask, error=false), task=io.kestra.core.models.tasks.TaskForExecution@169dfdda, taskRun=TaskRun(tenantId=null, id=21HhsFbYQtwMl1AJfvzhl5, executionId=3vmvlRbOrVfBjvQMWayP4I, namespace=company.myteam, flowId=subflow, taskId=subflow, parentTaskRunId=null, value=null, attempts=[TaskRunAttempt(state=State(current=SUCCESS, histories=[State.History(state=CREATED, date=2024-05-16T14:41:27.409Z), State.History(state=SUCCESS, date=2024-05-16T14:41:27.409Z)]))], outputs={state=SUCCESS, executionId=5uQFgf7vkBhyorTTn7uQZw}, state=State(current=SUCCESS, histories=[State.History(state=CREATED, date=2024-05-16T14:41:25.353Z), State.History(state=RUNNING, date=2024-05-16T14:41:25.394Z), State.History(state=SUCCESS, date=2024-05-16T14:41:27.408Z)]), iteration=null), values=[], relationType=SEQUENTIAL)], edges=[FlowGraph.Edge(source=root.2D5EDk6JBf6cyALIYyUUwe, target=root.subflow, relation=Relation(relationType=null, value=null)), FlowGraph.Edge(source=root.subflow, target=root.5lulGI4p1H24anJ2MMN1sW, relation=Relation(relationType=null, value=null))], clusters=[], flowables=null)] to JSON: class io.kestra.core.models.tasks.TaskForExecution cannot be cast to class io.kestra.core.models.tasks.ExecutableTask (io.kestra.core.models.tasks.TaskForExecution and io.kestra.core.models.tasks.ExecutableTask are in unnamed module of loader 'app') (through reference chain: io.kestra.core.models.hierarchies.FlowGraph["nodes"]->java.util.ArrayList[2]->io.kestra.core.models.hierarchies.SubflowGraphTask["executableTask"])
	at io.micronaut.http.netty.body.NettyJsonHandler.writeTo(NettyJsonHandler.java:164)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.writeNettyMessageBody(RoutingInBoundHandler.java:377)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.encodeHttpResponse(RoutingInBoundHandler.java:355)
	at io.micronaut.http.server.netty.RoutingInBoundHandler.writeResponse(RoutingInBoundHandler.java:249)
	at io.micronaut.http.server.netty.NettyRequestLifecycle.lambda$handleNormal$0(NettyRequestLifecycle.java:94)
	at io.micronaut.http.reactive.execution.ReactorExecutionFlowImpl$1.onComplete(ReactorExecutionFlowImpl.java:121)
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:159)
	at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
	at io.micronaut.core.async.propagation.ReactivePropagation$2.onNext(ReactivePropagation.java:106)
	at io.micronaut.configuration.metrics.binder.web.WebMetricsPublisher$1.onNext(WebMetricsPublisher.java:178)
	at io.micronaut.configuration.metrics.binder.web.WebMetricsPublisher$1.onNext(WebMetricsPublisher.java:163)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
	at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82)
	at io.micronaut.core.async.propagation.ReactivePropagation$2.onNext(ReactivePropagation.java:106)
	at reactor.core.publisher.FluxSwitchMapNoPrefetch$SwitchMapInner.onNext(FluxSwitchMapNoPrefetch.java:408)
	at reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2812)
	at reactor.core.publisher.SinkOneMulticast.tryEmitValue(SinkOneMulticast.java:66)
	at reactor.core.publisher.SinkOneSerialized.tryEmitValue(SinkOneSerialized.java:38)
	at io.micronaut.http.reactive.execution.ReactorExecutionFlowImpl$2.accept(ReactorExecutionFlowImpl.java:171)
	at io.micronaut.http.reactive.execution.ReactorExecutionFlowImpl$2.accept(ReactorExecutionFlowImpl.java:164)
	at io.micronaut.core.execution.ImperativeExecutionFlowImpl.onComplete(ImperativeExecutionFlowImpl.java:132)
	at io.micronaut.core.execution.DelayedExecutionFlowImpl$OnComplete.apply(DelayedExecutionFlowImpl.java:330)
	at io.micronaut.core.execution.DelayedExecutionFlowImpl.work(DelayedExecutionFlowImpl.java:51)
	at io.micronaut.core.execution.DelayedExecutionFlowImpl.complete0(DelayedExecutionFlowImpl.java:64)
	at io.micronaut.core.execution.DelayedExecutionFlowImpl.complete(DelayedExecutionFlowImpl.java:70)
	at io.micronaut.core.execution.ExecutionFlow.lambda$async$0(ExecutionFlow.java:94)
	at io.micronaut.core.execution.ImperativeExecutionFlowImpl.onComplete(ImperativeExecutionFlowImpl.java:132)
	at io.micronaut.core.execution.ExecutionFlow.lambda$async$1(ExecutionFlow.java:87)
	at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:141)
	at io.micrometer.core.instrument.Timer.lambda$wrap$0(Timer.java:193)
	at io.micronaut.core.propagation.PropagatedContext.lambda$wrap$3(PropagatedContext.java:211)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: class io.kestra.core.models.tasks.TaskForExecution cannot be cast to class io.kestra.core.models.tasks.ExecutableTask (io.kestra.core.models.tasks.TaskForExecution and io.kestra.core.models.tasks.ExecutableTask are in unnamed module of loader 'app') (through reference chain: io.kestra.core.models.hierarchies.FlowGraph["nodes"]->java.util.ArrayList[2]->io.kestra.core.models.hierarchies.SubflowGraphTask["executableTask"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:402)
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:361)
	at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:323)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:778)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeWithType(BeanSerializerBase.java:653)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:147)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107)
	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4793)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3997)
	at io.micronaut.jackson.databind.JacksonDatabindMapper.writeValue(JacksonDatabindMapper.java:207)
	at io.micronaut.http.netty.body.NettyJsonHandler.writeTo(NettyJsonHandler.java:161)
	... 39 common frames omitted
Caused by: java.lang.ClassCastException: class io.kestra.core.models.tasks.TaskForExecution cannot be cast to class io.kestra.core.models.tasks.ExecutableTask (io.kestra.core.models.tasks.TaskForExecution and io.kestra.core.models.tasks.ExecutableTask are in unnamed module of loader 'app')
	at io.kestra.core.models.hierarchies.SubflowGraphTask.getExecutableTask(SubflowGraphTask.java:17)
	at io.kestra.core.models.hierarchies.$SubflowGraphTask$Introspection.dispatchOne(Unknown Source)
	at io.micronaut.inject.beans.AbstractInitializableBeanIntrospection$BeanPropertyImpl.get(AbstractInitializableBeanIntrospection.java:923)
	at io.micronaut.jackson.modules.BeanIntrospectionModule$BeanIntrospectionPropertyWriter.serializeAsField(BeanIntrospectionModule.java:989)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	... 52 common frames omitted

Environment

  • Kestra Version: 0.17.0-SNAPSHOT
  • Operating System (OS/Docker/Kubernetes):
  • Java Version (if you don't run kestra in Docker):
@loicmathieu loicmathieu added the bug Something isn't working label May 16, 2024
@loicmathieu loicmathieu added this to the v0.17.0 milestone May 16, 2024
@Skraye Skraye closed this as completed in f410353 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants