kestra-io / kestra-io/plugin-scripts
Plugin "io.kestra.plugin.scripts.groovy.Script" does not support setting taskRunner property
- Dominant language
- Java
- Stars
- 19
- Forks
- 33
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 9
Description
### Describe the issue
The plugin `io.kestra.plugin.scripts.groovy.Script` appears to not support the `taskRunner` property.
## Info
I am running script tasks using rootless Podman. Podman exposes a suitable Unix socket that I set as a default for all script tasks:
### Config
```yaml
kestra:
plugins:
defaults:
- type: io.kestra.plugin.scripts.
values:
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
host: unix:///run/user/978/podman/podman.sock
```
### Flow
```yaml
tasks:
- id: groovy_hello
type: io.kestra.plugin.scripts.groovy.Script
script: |
println "Hello from Groovy!"
```
## Issue
This works for the `Script` task within the shell, Node, and Python plugins. The Groovy plugin's `Script` task, however, [will unconditionally hard-code the task runner to be a newly-constructed Docker task runner instance](https://github.com/kestra-io/plugin-scripts/blob/main/plugin-script-groovy/src/main/java/io/kestra/plugin/scripts/groovy/Script.java#L112). This means that the Kestra worker executing this task will look for the Docker API in the default place and not find it.
There's a comment on the line that I linked which indicates this was done for a reason, my best guess is it is somehow related to a file permission issue on the mounted script file created from the task YAML. This may be related to some foible of the default Groovy image somehow.
Removing that specific `withTaskRunner()` invocation and then building and deploying the plugin gives this output when I run it:
```
2026-03-09T21:01:21.797144Z DEBUG Using task runner 'io.kestra.plugin.scripts.runner.docker.Docker'
2026-03-09T21:01:21.799356Z TRACE Provided 0 input(s).
2026-03-09T21:01:21.801559Z TRACE Provided 1 input(s).
2026-03-09T21:01:30.798090Z TRACE Image pulled [groovy:latest]
2026-03-09T21:01:30.832380Z TRACE Container created: 1a81854fc493444b4d1e7a7b7a8220ed2958703c45938013ac4c6d24ba2a3a80
2026-03-09T21:01:30.838502Z TRACE Volume created: 2aae0d3eea595b7fa89fe837e6852dec430992a94f6131c830739c3d8b1a5949
2026-03-09T21:01:31.253989Z DEBUG Starting command with container id 1a81854fc493444b4d1e7a7b7a8220ed2958703c45938013ac4c6d24ba2a3a80 [/bin/sh -c set -e
groovy /tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy]
2026-03-09T21:01:31.509284Z ERROR WARNING: Using incubator modules: jdk.incubator.vector
2026-03-09T21:01:32.010205Z ERROR Caught: java.lang.RuntimeException: /tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy can not be read. Check the read permission of the file "/tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy" (/tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy).
2026-03-09T21:01:32.010463Z ERROR java.lang.RuntimeException: /tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy can not be read. Check the read permission of the file "/tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy" (/tmp/6LMvPiieCpni5ptjilESOv/13253427352392741890.groovy).
2026-03-09T21:01:32.489481Z TRACE Container deleted: 1a81854fc493444b4d1e7a7b7a8220ed2958703c45938013ac4c6d24ba2a3a80
2026-03-09T21:01:32.495759Z TRACE Volume deleted: 2aae0d3eea595b7fa89fe837e6852dec430992a94f6131c830739c3d8b1a5949
2026-03-09T21:01:32.496231Z TRACE Captured 0 output file(s).
2026-03-09T21:01:32.509886Z ERROR io.kestra.core.models.tasks.runners.TaskException: Command failed with exit code 1
2026-03-09T21:01:32.509886Z ERROR Command failed with exit code 1
2026-03-09T21:01:32.509886Z TRACE io.kestra.core.models.tasks.RunnableTaskException: io.kestra.core.models.tasks.runners.TaskException: Command failed with exit code 1
at io.kestra.plugin.scripts.exec.scripts.runners.CommandsWrapper.run(CommandsWrapper.java:200)
at io.kestra.plugin.scripts.groovy.Script.run(Script.java:115)
at io.kestra.plugin.scripts.groovy.Script.run(Script.java:25)
at io.kestra.worker.WorkerTaskCallable.doCall(WorkerTaskCallable.java:81)
at io.kestra.worker.AbstractWorkerCallable.call(AbstractWorkerCallable.java:64)
at io.kestra.worker.WorkerSecurityService.callInSecurityContext(WorkerSecurityService.java:10)
at io.kestra.worker.DefaultWorker.lambda$callJob$19(DefaultWorker.java:991)
at io.kestra.core.trace.NoopTracer.inCurrentContext(NoopTracer.java:15)
at io.kestra.worker.DefaultWorker.callJob(DefaultWorker.java:987)
at io.kestra.worker.DefaultWorker.runAttempt(DefaultWorker.java:933)
at io.kestra.worker.DefaultWorker.run(DefaultWorker.java:727)
at io.kestra.worker.DefaultWorker.handleTask(DefaultWorker.java:378)
at io.kestra.worker.DefaultWorker.lambda$run$8(DefaultWorker.java:294)
at io.micrometer.core.instrument.internal.TimedRunnable.run(TimedRunnable.java:49)
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: io.kestra.core.models.tasks.runners.TaskException: Command failed with exit code 1
at io.kestra.plugin.scripts.runner.docker.Docker.run(Docker.java:597)
at io.kestra.plugin.scripts.exec.scripts.runners.CommandsWrapper.run(CommandsWrapper.java:180)
... 16 more
```
I likely won't have the bandwidth to troubleshoot this further on my own time, but may in the future.
### Environment
- Kestra Version: v1.2.6
- Groovy plugin version: v1.4.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in plugin-script-groovy/src/main/java/io/kestra/plugin/scripts/groovy/Script.java around line 112, then compare taskRunner handling with the shell, Node, and Python script plugins. Reproduce the Groovy task using the documented Podman socket configuration and investigate the mounted script permission failure. Done means the Groovy Script task honors the configured runner and executes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, groovy, java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100