testcontainers / testcontainers/testcontainers-java

Timed out waiting for Ryuk container to start - Ubuntu 20.04.3, Docker 20.10.12, 1.16.3

Aperta
#4,954 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Java
Stelle
8.7k
Fork
1.9k
Merge medio
2g 17h
PR unite (30g)
9

Descrizione

Hi,
I am using Webdriver Containers for Selenium test.

When the tests are running on my local machine everything works fine.

However when I run the same tests on a jenkins agent following errors are thrown:

00:12:41.410 [main] INFO  o.t.d.DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
00:12:41.621 [main] INFO  o.t.d.DockerClientProviderStrategy - Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
00:12:41.622 [main] INFO  o.testcontainers.DockerClientFactory - Docker host IP address is localhost
00:12:41.639 [main] INFO  o.testcontainers.DockerClientFactory - Connected to docker:
  Server Version: 20.10.12
  API Version: 1.41
  Operating System: Ubuntu 20.04.3 LTS
  Total Memory: 64220 MB
00:12:41.641 [main] INFO  o.t.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
00:13:12.080 [main] ERROR o.t.utility.ResourceReaper - Timed out waiting for Ryuk container to start. Ryuk's logs:
2022/01/27 00:12:42 Pinging Docker...
2022/01/27 00:12:42 Docker daemon is available!
2022/01/27 00:12:42 Starting on port 8080...
2022/01/27 00:12:42 Started! 

As of the start of each test following error is thrown:

FAILED: java.lang.IllegalStateException: Could not connect to Ryuk at localhost:49210

Specification of the server:
Ubuntu 20.04.3
Docker 20.10.12
Testcontainers 1.16.3
OpenJDK 16.0.1

It seems that the container starts correctly:

CONTAINER ID   IMAGE                       COMMAND   CREATED         STATUS         PORTS                                         NAMES
3f263aa0e454   testcontainers/ryuk:0.3.3   "/app"    5 seconds ago   Up 4 seconds   0.0.0.0:49209->8080/tcp, :::49209->8080/tcp   testcontainers-ryuk-3cb3f86e-546d-4ae0-9d37-c0ce13659bf1

Disabling ryuk with TESTCONTAINERS_RYUK_DISABLED=true doesn't` solve the problem. When disabling ryuk selenium and vnc-recorder are started but there are also errors thrown:

00:35:10.486 [main] INFO  o.t.d.DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
00:35:10.697 [main] INFO  o.t.d.DockerClientProviderStrategy - Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
00:35:10.698 [main] INFO  o.testcontainers.DockerClientFactory - Docker host IP address is localhost
00:35:10.715 [main] INFO  o.testcontainers.DockerClientFactory - Connected to docker:
  Server Version: 20.10.12
  API Version: 1.41
  Operating System: Ubuntu 20.04.3 LTS
  Total Memory: 64220 MB
00:35:10.715 [main] INFO  o.testcontainers.DockerClientFactory - Checking the system...
00:35:10.715 [main] INFO  o.testcontainers.DockerClientFactory - ✔︎ Docker server version should be at least 1.6.0
00:35:10.717 [main] INFO  o.t.utility.ImageNameSubstitutor - Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
00:35:11.193 [main] INFO  o.testcontainers.DockerClientFactory - ✔︎ Docker environment should have more than 2GB free disk space
00:35:11.537 [main] INFO  o.t.containers.SeleniumUtils - Selenium API version 3.141.59 detected on classpath
00:35:11.553 [main] INFO  ?.141.59] - Creating container for image: selenium/standalone-chrome-debug:3.141.59
00:35:12.372 [main] INFO  ?.141.59] - Container selenium/standalone-chrome-debug:3.141.59 is starting: c8d62a89d143f988ea7d82d21517583aa84fb0d0b635eef4c4a1d4549e0d6ed8
00:35:14.950 [main] INFO  ?.141.59] - Container selenium/standalone-chrome-debug:3.141.59 started in PT3.404032216S
00:35:14.951 [main] INFO  ?.2.0] - Creating container for image: testcontainers/vnc-recorder:1.2.0
00:35:14.976 [main] INFO  ?.2.0] - Container testcontainers/vnc-recorder:1.2.0 is starting: 223d9db7a3401544ae0ea9d624f849d2c36bf7ffe18367daa9e8139df8511d25
00:35:15.330 [main] INFO  ?.2.0] - Container testcontainers/vnc-recorder:1.2.0 started in PT0.379303582S
org.rnorth.ducttape.TimeoutException: Timeout waiting for result with exception
Caused by: java.lang.RuntimeException:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'hostname', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-96-generic', java.version: '16.0.1'
Driver info: driver.version: RemoteWebDriver
Caused by: org.openqa.selenium.remote.UnreachableBrowserException:
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'hostname', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-96-generic', java.version: '16.0.1'
Driver info: driver.version: RemoteWebDriver
Caused by: java.net.SocketException: Connection reset

Any ideas what could be the cause?
Thanks in advance for the support!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il fallimento sul Jenkins agent e confrontando la sua rete Docker con quella della macchina locale, usando i log di Ryuk e Selenium/VNC mostrati nell’issue. Traccia la porta Ryuk mappata e il percorso di connessione del browser; il lavoro è completato quando viene identificata la causa specifica dell’agent e viene confermato che le sessioni Ryuk e Selenium si connettono in modo affidabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, java
Ambito
devops, networking, testing-qa
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.