You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
act version: 0.2.50
GOOS: darwin
GOARCH: amd64
NumCPU: 8
Docker host: DOCKER_HOST environment variable is not set
Sockets found:
/var/run/docker.sock
$HOME/.docker/run/docker.sock
Config files:
/Users/andy/.actrc:
-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
Go version: go1.21.0
Module path: command-line-arguments
Main version:
Main path:
Main checksum:
Build settings:
-buildmode: exe
-compiler: gc
-ldflags: -X main.version=0.2.50
DefaultGODEBUG: panicnil=1
CGO_ENABLED: 1
CGO_CFLAGS:
CGO_CPPFLAGS:
CGO_CXXFLAGS:
CGO_LDFLAGS:
GOARCH: amd64
GOOS: darwin
GOAMD64: v1
Docker Engine:
Engine version: 24.0.5
Engine runtime: runc
Cgroup version: 2
Cgroup driver: cgroupfs
Storage driver: overlay2
Registry URI: https://index.docker.io/v1/
OS: Docker Desktop
OS type: linux
OS version:
OS arch: x86_64
OS kernel: 5.15.49-linuxkit-pr
OS CPU: 4
OS memory: 7859 MB
Security options:
name=seccomp,profile=unconfined
name=cgroupns
Command used with act
act -j call-reusable-workflow
Describe issue
When using act with reusable workflows called with a matrix strategy, act does not create separate docker containers for each matrix combination; it tries to run them all in the same container which generates an error (see log output below).
If I run the same matrix strategy in a standalone workflow, act creates a separate docker container for each matrix combination and the workflow runs successfully.
Error: failed to create container: 'Error response from daemon: Conflict. The container name "/act-call-reusable-workflow-reusable-workflow-reusable-workflow-c7535ef5a84abfd1f2412cceca72bd226072ccb44b16a59787972320d9cb1a2d" is already in use by container "d0baad951ea56daf6bd3097af098d08b22d726733e0e4a54120fe40c357874a0". You have to remove (or rename) that container to be able to reuse that name.'
Additional information
As mentioned above, this works fine with standalone workflows.
The text was updated successfully, but these errors were encountered:
I found the problem and it looks like the fix is pretty simple.
The container name generated for reusable workflows is not unique, so each matrix run was trying to use the same container. The code was using the non-unique caller job name instead of the unique name (with the -1, -2, ... appended).
So the fix should be in runner/run_context.go function String().
Change this:
name = fmt.Sprintf("%s/%s", rc.caller.runContext.Run.JobID, name)
To this:
name = fmt.Sprintf("%s/%s", rc.caller.runContext.Name, name)
I'll open a pull request after I run a few more tests.
Bug report info
Command used with act
Describe issue
When using act with reusable workflows called with a matrix strategy, act does not create separate docker containers for each matrix combination; it tries to run them all in the same container which generates an error (see log output below).
If I run the same matrix strategy in a standalone workflow, act creates a separate docker container for each matrix combination and the workflow runs successfully.
Link to GitHub repository
https://github.com/Andy4495/act-workflow-test
Workflow content
Relevant log output
Error: failed to create container: 'Error response from daemon: Conflict. The container name "/act-call-reusable-workflow-reusable-workflow-reusable-workflow-c7535ef5a84abfd1f2412cceca72bd226072ccb44b16a59787972320d9cb1a2d" is already in use by container "d0baad951ea56daf6bd3097af098d08b22d726733e0e4a54120fe40c357874a0". You have to remove (or rename) that container to be able to reuse that name.'
Additional information
As mentioned above, this works fine with standalone workflows.
The text was updated successfully, but these errors were encountered: