[Bug]: Inconsistent "As no valid configuration was found, execution cannot continue. " on GitHub Actions runner

未關閉
#10,788 3 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
38/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
冷清
技術堆疊
docker, github-actions, java
領域
ci-cd, testing-qa

研究方向

從 DockerClientProviderStrategy.getFirstValidStrategy 和 DockerClientFactory.getOrInitializeStrategy 開始,它們是堆疊追蹤中列出的進入點。比較連結的 GitHub Actions 執行記錄及其 Docker/Testcontainers 記錄,以確定為什麼有效環境會間歇性地被遺漏。完成的標準是原因可重現,且行為已修正或得到明確記錄,同時在 GitHub Actions 上完成驗證。

由索引模型根據 Issue 內容生成。

描述

type/bug
Module

Core

Testcontainers version

1.21.3

Using the latest Testcontainers version?

Yes

Host OS

ubuntu-22.04

Host Arch

x86

Docker version
Client: Docker Engine - Community
 Version:           28.0.4
 API version:       1.48
 Go version:        go1.23.7
 Git commit:        b8034c0
 Built:             Tue Mar 25 15:07:11 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.0.4
  API version:      1.48 (minimum version 1.24)
  Go version:       go1.23.7
  Git commit:       6430e49
  Built:            Tue Mar 25 15:07:11 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
What happened?

I have a Gradle build service that uses Testcontainers.
When running tests locally, everything works reliably.

However, when running the same tests on GitHub Actions, I will inconsistently get "Could not find a valid Docker environment." errors.
It is inconsistent between runs; if I "Re-run jobs" enough times I can eventually produce a run that works.

The attached Gradle Build Scans are from the GHA workflows targeting the same commit, the only difference was a retry.

Note: Run 2 (when Testcontainers did start) has failing tests. These are unrelated, the important part is that the tests were successfully able to run.

Relevant log output
Could not find a valid Docker environment. Please check configuration. Attempted configurations were:	
As no valid configuration was found, execution cannot continue.	
See https://java.testcontainers.org/on_failure.html for more details.

Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration	
at org.testcontainers.dockerclient.DockerClientProviderStrategy.lambda$getFirstValidStrategy$7(DockerClientProviderStrategy.java:274)	
at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrategy.java:265)	
at org.testcontainers.DockerClientFactory.getOrInitializeStrategy(DockerClientFactory.java:154)	
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:196)	
at org.testcontainers.DockerClientFactory$1.getDockerClient(DockerClientFactory.java:108)	
at com.github.dockerjava.api.DockerClientDelegate.authConfig(DockerClientDelegate.java:109)	
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:321)	
at com.mussonindustrial.ignition.embr.e2e.env.TestEnvironmentService$start$1.accept(TestEnvironmentService.kt:54)	
at com.mussonindustrial.ignition.embr.e2e.env.TestEnvironmentService$start$1.accept(TestEnvironmentService.kt:54)
Additional Information
Run Result GitHub Actions Attempt Gradle Build Scan
1) Initial Run Testcontainers failed to start Link Gradle Build Scan
2) After a Retry Testcontainers started Link Gradle Build Scan
主要語言
Java
星號
8.8k
分支
2k
平均合併
2 天 1 小時
30 天內合併 PR
11

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

testcontainers/testcontainers-java 的其他 Issue

查看 testcontainers/testcontainers-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。