[GH-ISSUE #501] Test containers cannot be used in local workflow execution (Scala / SBT project) #344

Closed
opened 2026-03-01 21:42:32 +03:00 by kerem · 5 comments
Owner

Originally created by @pbartusch on GitHub (Jan 23, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/501

Hi,

I encountered a problem using act while testing the deployment workflow of my project (https://github.com/querqy/smui/) locally. I already came across the following issues, describing how to use a "full" local build container:

Steps to reproduce:

Unexpected behaviour:

Setting the experimental mode for the docker service in the build environment fails:

[dockerhub-deployment/test-build-push] ⭐  Run Docker restart (with experimental status)
| rm: cannot remove '/etc/docker/daemon.json': No such file or directory
| { "experimental": true }
| docker: unrecognized service
[dockerhub-deployment/test-build-push]   ❌  Failure - Docker restart (with experimental status)
Error: exit with `FAILURE`: 1

On github that step performs well.

Even, when commenting out this step (as experimental seems to be activated for that build container), the tests from the project that rely on test containers will fail (e.g. MysqlCompatibilitySpec and PostgresCompatibilitySpec).

| [warn] o.t.u.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: alpine:3.5, configFile: /root/.docker/config.json. Falling back to docker-java default behaviour. Exception message: /root/.docker/config.json (No such file or directory)
| [info] MysqlCompatibilitySpec:
| [info] models.MysqlCompatibilitySpec *** ABORTED ***
| [info]   com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: alpine:3.5"}
| [info]   at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:270)
| [info]   at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:254)
| [info]   at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.post(OkHttpInvocationBuilder.java:125)
| [info]   at com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:33)
| [info]   at com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:13)
| [info]   at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
| [info]   at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
| [info]   at com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:1139)
| [info]   at org.testcontainers.DockerClientFactory.runInsideDocker(DockerClientFactory.java:252)
| [info]   at org.testcontainers.DockerClientFactory.runInsideDocker(DockerClientFactory.java:244)
| [info]   ...

Again, on github that step performs well.

I saw the same error when using the full suffixed build system:

act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04-full

My impression is that the github build environment (container) and the container act uses, differ too much for the described use case.

Originally created by @pbartusch on GitHub (Jan 23, 2021). Original GitHub issue: https://github.com/nektos/act/issues/501 Hi, I encountered a problem using `act` while testing the deployment workflow of my project (https://github.com/querqy/smui/) locally. I already came across the following issues, describing how to use a "full" local build container: * https://github.com/nektos/act/issues/107 * https://github.com/nektos/act/issues/112 *Steps to reproduce:* * Checkout: https://github.com/querqy/smui/ * `cd` into it * `act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04` *Unexpected behaviour:* Setting the experimental mode for the docker service in the build environment fails: ``` [dockerhub-deployment/test-build-push] ⭐ Run Docker restart (with experimental status) | rm: cannot remove '/etc/docker/daemon.json': No such file or directory | { "experimental": true } | docker: unrecognized service [dockerhub-deployment/test-build-push] ❌ Failure - Docker restart (with experimental status) Error: exit with `FAILURE`: 1 ``` On github that step performs well. Even, when commenting out this step (as experimental seems to be activated for that build container), the tests from the project that rely on test containers will fail (e.g. `MysqlCompatibilitySpec` and `PostgresCompatibilitySpec`). ``` | [warn] o.t.u.RegistryAuthLocator - Failure when attempting to lookup auth config (dockerImageName: alpine:3.5, configFile: /root/.docker/config.json. Falling back to docker-java default behaviour. Exception message: /root/.docker/config.json (No such file or directory) | [info] MysqlCompatibilitySpec: | [info] models.MysqlCompatibilitySpec *** ABORTED *** | [info] com.github.dockerjava.api.exception.NotFoundException: {"message":"No such image: alpine:3.5"} | [info] at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:270) | [info] at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.execute(OkHttpInvocationBuilder.java:254) | [info] at org.testcontainers.dockerclient.transport.okhttp.OkHttpInvocationBuilder.post(OkHttpInvocationBuilder.java:125) | [info] at com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:33) | [info] at com.github.dockerjava.core.exec.CreateContainerCmdExec.execute(CreateContainerCmdExec.java:13) | [info] at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21) | [info] at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35) | [info] at com.github.dockerjava.core.command.CreateContainerCmdImpl.exec(CreateContainerCmdImpl.java:1139) | [info] at org.testcontainers.DockerClientFactory.runInsideDocker(DockerClientFactory.java:252) | [info] at org.testcontainers.DockerClientFactory.runInsideDocker(DockerClientFactory.java:244) | [info] ... ``` Again, on github that step performs well. I saw the same error when using the `full` suffixed build system: `act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04-full` My impression is that the github build environment (container) and the container `act` uses, differ too much for the described use case.
kerem 2026-03-01 21:42:32 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@github-actions[bot] commented on GitHub (Feb 23, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:783776235 --> @github-actions[bot] commented on GitHub (Feb 23, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@McPringle commented on GitHub (Apr 28, 2023):

GitHub actions with a Maven build using the Testcontainers framework work fine on GitHub itself but fail using act:

| [WARNING] Can not connect to Ryuk at 172.17.0.1:18499
| java.net.ConnectException: Connection refused
|     at sun.nio.ch.Net.pollConnect (Native Method)
|     at sun.nio.ch.Net.pollConnectNow (Net.java:672)
|     at sun.nio.ch.NioSocketImpl.timedFinishConnect (NioSocketImpl.java:542)
|     at sun.nio.ch.NioSocketImpl.connect (NioSocketImpl.java:597)
|     at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:327)
|     at java.net.Socket.connect (Socket.java:633)
|     at org.testcontainers.utility.RyukResourceReaper.lambda$null$0 (RyukResourceReaper.java:92)
|     at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady (RateLimiter.java:27)
|     at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$1 (RyukResourceReaper.java:88)
|     at java.lang.Thread.run (Thread.java:833)
| [ERROR] Timed out waiting for Ryuk container to start. Ryuk's logs:
| 2023/04/28 13:09:26 Pinging Docker...
| 2023/04/28 13:09:26 Docker daemon is available!
| 2023/04/28 13:09:26 Starting on port 8080...
| 2023/04/28 13:09:26 Started!
| [WARNING] Can not connect to Ryuk at 172.17.0.1:18499
| java.net.ConnectException: Connection refused
|     at sun.nio.ch.Net.pollConnect (Native Method)
|     at sun.nio.ch.Net.pollConnectNow (Net.java:672)
|     at sun.nio.ch.NioSocketImpl.timedFinishConnect (NioSocketImpl.java:542)
|     at sun.nio.ch.NioSocketImpl.connect (NioSocketImpl.java:597)
|     at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:327)
|     at java.net.Socket.connect (Socket.java:633)
|     at org.testcontainers.utility.RyukResourceReaper.lambda$null$0 (RyukResourceReaper.java:92)
|     at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady (RateLimiter.java:27)
|     at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$1 (RyukResourceReaper.java:88)
|     at java.lang.Thread.run (Thread.java:833)
| [ERROR] Timed out waiting for Ryuk container to start. Ryuk's logs:
| 2023/04/28 13:09:26 Pinging Docker...
| 2023/04/28 13:09:26 Docker daemon is available!
| 2023/04/28 13:09:26 Starting on port 8080...
| 2023/04/28 13:09:26 Started!

Command used:

act -s GITHUB_TOKEN=ghp_XXXXXXXXXXXXXXXX

Steps to reproduce:

$> git clone https://github.com/McPringle/alfons.git
$> cd alfons
$> act -s GITHUB_TOKEN=ghp_YOUR_TOKEN

Actual behavior: job failed
Expected behavior: job successful, like on GitHub

<!-- gh-comment-id:1527555617 --> @McPringle commented on GitHub (Apr 28, 2023): GitHub actions with a Maven build using the Testcontainers framework work fine on GitHub itself but fail using *act*: ``` | [WARNING] Can not connect to Ryuk at 172.17.0.1:18499 | java.net.ConnectException: Connection refused | at sun.nio.ch.Net.pollConnect (Native Method) | at sun.nio.ch.Net.pollConnectNow (Net.java:672) | at sun.nio.ch.NioSocketImpl.timedFinishConnect (NioSocketImpl.java:542) | at sun.nio.ch.NioSocketImpl.connect (NioSocketImpl.java:597) | at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:327) | at java.net.Socket.connect (Socket.java:633) | at org.testcontainers.utility.RyukResourceReaper.lambda$null$0 (RyukResourceReaper.java:92) | at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady (RateLimiter.java:27) | at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$1 (RyukResourceReaper.java:88) | at java.lang.Thread.run (Thread.java:833) | [ERROR] Timed out waiting for Ryuk container to start. Ryuk's logs: | 2023/04/28 13:09:26 Pinging Docker... | 2023/04/28 13:09:26 Docker daemon is available! | 2023/04/28 13:09:26 Starting on port 8080... | 2023/04/28 13:09:26 Started! | [WARNING] Can not connect to Ryuk at 172.17.0.1:18499 | java.net.ConnectException: Connection refused | at sun.nio.ch.Net.pollConnect (Native Method) | at sun.nio.ch.Net.pollConnectNow (Net.java:672) | at sun.nio.ch.NioSocketImpl.timedFinishConnect (NioSocketImpl.java:542) | at sun.nio.ch.NioSocketImpl.connect (NioSocketImpl.java:597) | at java.net.SocksSocketImpl.connect (SocksSocketImpl.java:327) | at java.net.Socket.connect (Socket.java:633) | at org.testcontainers.utility.RyukResourceReaper.lambda$null$0 (RyukResourceReaper.java:92) | at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady (RateLimiter.java:27) | at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$1 (RyukResourceReaper.java:88) | at java.lang.Thread.run (Thread.java:833) | [ERROR] Timed out waiting for Ryuk container to start. Ryuk's logs: | 2023/04/28 13:09:26 Pinging Docker... | 2023/04/28 13:09:26 Docker daemon is available! | 2023/04/28 13:09:26 Starting on port 8080... | 2023/04/28 13:09:26 Started! ``` Command used: ``` act -s GITHUB_TOKEN=ghp_XXXXXXXXXXXXXXXX ``` Steps to reproduce: ``` $> git clone https://github.com/McPringle/alfons.git $> cd alfons $> act -s GITHUB_TOKEN=ghp_YOUR_TOKEN ``` Actual behavior: job failed Expected behavior: job successful, like on GitHub
Author
Owner

@cltec commented on GitHub (Apr 16, 2024):

Same here, action working on github but failing in act using the "medium" configuration

<!-- gh-comment-id:2059138405 --> @cltec commented on GitHub (Apr 16, 2024): Same here, action working on github but failing in act using the "medium" configuration
Author
Owner

@tschuehly commented on GitHub (Apr 29, 2024):

Same issue here.

<!-- gh-comment-id:2083241532 --> @tschuehly commented on GitHub (Apr 29, 2024): Same issue here.
Author
Owner

@TNorden commented on GitHub (Sep 11, 2024):

I struggled with this for a while and found a solution

act --env TESTCONTAINERS_HOST_OVERRIDE=`ipconfig getifaddr en0` -W .github/workflows/test.yml
<!-- gh-comment-id:2344539500 --> @TNorden commented on GitHub (Sep 11, 2024): I struggled with this for a while and found a solution ``` act --env TESTCONTAINERS_HOST_OVERRIDE=`ipconfig getifaddr en0` -W .github/workflows/test.yml ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#344
No description provided.