kestra-io / kestra

Orchestration and automation platform to execute millions of scheduled and event-driven workflows declaratively in code and from the UI
https://kestra.io
Apache License 2.0
9.11k stars 595 forks source link

Task Runner fails sometimes on Python Commands and Script tasks #4137

Closed wrussell1999 closed 2 months ago

wrussell1999 commented 3 months ago

Describe the issue

Trying https://kestra.io/blueprints/225-run-multiple-python-scripts-in-parallel-on-aws-ecs-fargate-with-aws-batch

Fails on the Script task with id run_python_script. Error:

kestra-1    | 2024-06-25 16:58:28,087 INFO  worker_30    flow.third.run_python_script [namespace: overview_video] [flow: third] [task: run_python_script] [execution: 6234d2mTm5rD4AOuMb3bIg] [taskrun: 3T97DKYWEouw8CGZqOrlLq] Type Commands started
kestra-1    | 2024-06-25 16:58:28,466 ERROR WorkerThread f.t.6.3T97DKYWEouw8CGZqOrlLq 'java.nio.file.Path io.kestra.core.runners.RunContext.resolve(java.nio.file.Path)'
kestra-1    | java.lang.NoSuchMethodError: 'java.nio.file.Path io.kestra.core.runners.RunContext.resolve(java.nio.file.Path)'
kestra-1    |   at io.kestra.plugin.aws.runner.Batch.lambda$run$1(Batch.java:299)
kestra-1    |   at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
kestra-1    |   at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
kestra-1    |   at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
kestra-1    |   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
kestra-1    |   at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
kestra-1    |   at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
kestra-1    |   at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
kestra-1    |   at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
kestra-1    |   at io.kestra.plugin.aws.runner.Batch.run(Batch.java:303)
kestra-1    |   at io.kestra.plugin.scripts.exec.scripts.runners.CommandsWrapper.run(CommandsWrapper.java:161)
kestra-1    |   at io.kestra.plugin.scripts.python.Commands.run(Commands.java:269)
kestra-1    |   at io.kestra.plugin.scripts.python.Commands.run(Commands.java:19)
kestra-1    |   at io.kestra.core.runners.WorkerTaskThread.doRun(WorkerTaskThread.java:76)
kestra-1    |   at io.kestra.core.runners.AbstractWorkerThread.run(AbstractWorkerThread.java:57)

Even when the script is changed to be just print("Hello, World"), it still fails.

I changed the type to Commands and it also fails when executing a Python file with the same error as above. However, it works with Commands if the commands property has the same value as the run_command task in the same example.

Screenshot 2024-06-25 at 18 22 15

Environment

wrussell1999 commented 3 months ago

I will try to reproduce on the latest version rather than snapshot

loicmathieu commented 3 months ago

You will not be able to reproduce it on latest ;)

This is certainly due to an old version of the plugin, we refactor a lot of code lately so if you have a version of the plugin not compiled against the latest version of Kestra it can happen.

loicmathieu commented 3 months ago

Reinstalling the plugin should be enought.

loicmathieu commented 2 months ago

@wrussell1999 did you try to reinstall the plugin and test again?

wrussell1999 commented 2 months ago

@wrussell1999 did you try to reinstall the plugin and test again?

I was able to get this working on latest-full. I will check if it works on develop-full too.

wrussell1999 commented 2 months ago

I was able to get this to run on the develop-full with this example. Closing this as resolved now!