Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ryuk failed to start (with lima) #5043

Closed
varpa89 opened this issue Feb 13, 2022 · 4 comments
Closed

Ryuk failed to start (with lima) #5043

varpa89 opened this issue Feb 13, 2022 · 4 comments

Comments

@varpa89
Copy link

varpa89 commented Feb 13, 2022

Mac Os BigSur 11.6.3 Intel
org.testcontainers:postgresql:1.16.3

I use lima 0.8.2 with docker

Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.17.5
 Git commit:        e91ed5707e
 Built:             Sun Dec 12 06:28:24 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:41 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

DOCKER_HOST=unix:///Users/varpa89/.lima/default/sock/docker.sock
Looks like when Testcontainers tries to run Ryuk it uses wrong Docker daemon or I understand it wrong?

At the end I have

Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"No such container: 8de66959ff20ff4f6a16b5f08e7bac732eae1b91b62b7ff3d816e666c4c82945"}

Detailed startup logs of Spring Boot aplication

2022-02-13 20:05:17.069  INFO 99607 --- [    Test worker] o.t.d.DockerClientProviderStrategy       : Found Docker environment with Environment variables, system properties and defaults. Resolved dockerHost=unix:///Users/varpa89/.lima/default/sock/docker.sock
2022-02-13 20:05:17.070  INFO 99607 --- [    Test worker] org.testcontainers.DockerClientFactory   : Docker host IP address is localhost
2022-02-13 20:05:17.181  INFO 99607 --- [    Test worker] org.testcontainers.DockerClientFactory   : Connected to docker: 
  Server Version: 20.10.12
  API Version: 1.41
  Operating System: Ubuntu 21.10
  Total Memory: 3919 MB
2022-02-13 20:05:17.185  INFO 99607 --- [    Test worker] o.t.utility.ImageNameSubstitutor         : Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2022-02-13 20:05:17.248  INFO 99607 --- [    Test worker] o.t.utility.RegistryAuthLocator          : Failure when attempting to lookup auth config. Please ignore if you don't have images in an authenticated registry. Details: (dockerImageName: testcontainers/ryuk:0.3.3, configFile: /Users/varpa89/.docker/config.json. Falling back to docker-java default behaviour. Exception message: /Users/varpa89/.docker/config.json (No such file or directory)
2022-02-13 20:05:18.665  WARN 99607 --- [    Test worker] o.testcontainers.utility.ResourceReaper  : Ryuk container cannot be inspected and probably had a problem starting. Ryuk's logs:
2022/02/13 19:05:18 Pinging Docker...
panic: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

goroutine 1 [running]:
main.main()
	/go/src/github.com/testcontainers/moby-ryuk/main.go:36 +0x457

2022-02-13 20:05:19.676 ERROR 99607 --- [    Test worker] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
java.lang.IllegalStateException: Ryuk failed to start
@handcarbon
Copy link

handcarbon commented Feb 14, 2022

Setting these env variables worked for me (using Colima), so TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE might be working for lima also.

TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
DOCKER_HOST=unix:///Users/my.user/.colima/docker.sock

Most likely related to this
#5034

@kiview
Copy link
Member

kiview commented Feb 14, 2022

@siim-romanov 's setting should work for you, I will therefore close the. Feel free to let us know, if you still encounter problems.

@dnatic09
Copy link

dnatic09 commented Feb 21, 2022

@siim-romanov 's setting should work for you, I will therefore close the. Feel free to let us know, if you still encounter problems.

I actually symlinked my home-directory-colima-docker.sock to /var/run/docker.sock

/var/run/docker.sock disappeared and never came back after I uninstalled Docker Desktop.

EDIT: I deleted my symlink and used the recommended environment variables. No positive change/impact.

@abenabderrahmane
Copy link

Thanks @siim-romanov . Setting env variable TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE did the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants