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

Đang mở
#10,788 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
docker, github-actions, java
Lĩnh vực
ci-cd, testing-qa

Hướng nghiên cứu

Bắt đầu với DockerClientProviderStrategy.getFirstValidStrategy và DockerClientFactory.getOrInitializeStrategy, các điểm vào được nêu trong stack trace. So sánh các lần chạy GitHub Actions được liên kết và log Docker/Testcontainers của chúng để xác định lý do một môi trường hợp lệ đôi khi bị bỏ sót. Được coi là hoàn tất khi nguyên nhân có thể tái hiện và hành vi đã được sửa hoặc được ghi lại rõ ràng, kèm theo việc xác minh trên GitHub Actions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Java
Star
8.8k
Fork
2k
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của testcontainers/testcontainers-java

Tất cả issue của testcontainers/testcontainers-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.