quarkus: Dev Services for Postgresql not working with Rancher
Describe the bug
Last week I got a new laptop - a 2021 MacBook M1Pro. Since then whenever I try to use Dev Services for Postgresql (either in Quarkus Dev mode or when running tests) it seems to be broken with some kind of race condition between the starting of the Postgres container & the creation of the username/password). When Hibernate kicks in to create the tables its getting an authentication error, as if the user hasn’t yet been created. I’m hoping my new machine isn’t too fast!
Expected behavior
I would expect the dev service for postgresql to work.
Actual behavior
It does not
How to Reproduce?
I can reproduce this pretty regularly. I put together a repo on GitHub [1] detailing what I’m seeing (it’s a pretty basic hello world). I also recorded a 2 minute video [2] showing what I’m seeing. The README file in the repo has a very detailed explanation of the problem & what I’m seeing.
[1] https://github.com/edeandrea/quarkus-devservice-postgresql [2] https://github.com/edeandrea/quarkus-devservice-postgresql/raw/main/Dev-Services-postgres-failing.mov
Output of uname -a or ver
Darwin edeandrea-m1pro 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
Output of java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode)
Quarkus version or git rev
2.9.1.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /Users/edeandre/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4
Java version: 17.0.3, vendor: Eclipse Adoptium, runtime: /Users/edeandre/.sdkman/candidates/java/17.0.3-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "aarch64", family: "mac"
Additional information
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 27 (17 by maintainers)
I was able to run the container by adding the following environment variables: export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock export DOCKER_HOST=“unix://${HOME}/.rd/docker.sock”
I have also found that with Podman it is apparently only ever the LAST service which causes the hang. When inspecting the containers, the service is UP and running, but DevServices does not recognize whatever the last service to complete is. If I add Kafka or SSO or whatever, it’s only the last one starting which gets stuck and not just PostgreSQL
@gastaldi @tqvarnst
Just wanted to let you know that this is a reproducible problem with 2021 MacBook M1 Pros and Rancher Desktop. When running
quarkus dev(for example) it is possible to connect to a testcontainers Postgres instance on the first run but not on any of the following runs. We’ve tested it on multiple MacBooks and we always see the same behaviour. No issues with Docker Desktop. I’ll add the logs ofgradle quarkusTestto give you some context.Logs: quarkus-test-rancher-desktop.log
Thank you @gastaldi for looking at it!
ran it a bunch of times with docker desktop & podman - can’t reproduce it. I blew away my rancher desktop instance & re-created it. Ran ok a few times but then started up again.
I’d say go ahead and close this for now. If it crops back up I’ll come back & re-open.
Yes it happens when I run
./mvnw test. Here’s the output withquarkus.log.category."org.testcontainers".level=FINEST