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

Quarkus 3.1.0.CR1 can't find a valid Docker env despite valid podman 4.2.0 #33637

Closed
ewoks opened this issue May 26, 2023 · 5 comments
Closed
Assignees
Labels
area/devmode kind/bug Something isn't working

Comments

@ewoks
Copy link

ewoks commented May 26, 2023

Describe the bug

When using Podman, Quarkus 3.1.0.CR1 (as well as 3.0.3.Final and older versions) has difficulties to find container engine environment necessary for DevServices (auto activated when no DB url and credentials are provided in application.properties). Alias for docker works, but it isn`t helpful neither.

This is basically the same as [Issue 16541] (#16541 (comment)), but newly tested and reproduced with Quarkus 3.1.0.CR1, reporting as new per @geoand recommendation.

Expected behavior

When the Podman exists in the $PATH and works without issues on the host OS, mvn quarkus:dev command should be able to use the podman for DevServices (e.g. to start a Postgresql container).

Actual behavior

Error:

Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
	UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause AccessDeniedException (/var/run/docker.sock)As no valid configuration was found, execution cannot continue.
See https://www.testcontainers.org/on_failure.html for more details.

2023-05-26 15:36:13,264 WARN  [io.qua.dep.IsDockerWorking] (build-16) Unix socket defined in DOCKER_HOST unix:///run/user/119066/podman/podman.sock is not writable, make sure Docker is running on the specified host
...
...
Caused by: java.lang.IllegalStateException: Previous attempts to find a Docker environment failed. Will not retry. Please see logs and check configuration
	at org.testcontainers.dockerclient.DockerClientProviderStrategy.getFirstValidStrategy(DockerClientProviderStrava:212)

How to Reproduce?

  1. On Linux OS with Podman:
  2. Follow the getting Started reactive guide
    1.1. Create new Quarkus project using quarkus-hibernate-reactive-panache, quarkus-reactive-pg-client as well as resteasy reactive extensions, according to the guide
    1.2. Add minimal Fruit entity class , in application.properties add quarkus.datasource.db-kind=postgresql, and save, as advised in the guide
  3. execute mvn quarkus:dev from the project root will cause the error from above

Output of uname -a or ver

CSB RHEL: 4.18.0-425.19.2.el8_7.x86_64

Output of java -version

17.0.7-tem

GraalVM version (if different from Java)

~/.sdkman/candidates/java/22.3.0.1.r17-mandrel/

Quarkus version or git rev

3.1.0.CR1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)

Additional information

Podman 4.2.0 is installed and working without issues on this host.
Current workaround as previously described by @vanuatoo

# start podman in another terminal and leave it running with the command
podman system service -t 0

# export the following variables
export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
export TESTCONTAINERS_RYUK_DISABLED=true
# run
mvn quarkus:dev
@ewoks ewoks added the kind/bug Something isn't working label May 26, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented May 26, 2023

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)

@ewoks ewoks changed the title quarkus 3.1.0.CR1 can't find a valid Docker environment despite valid podman 4.2.0 Quarkus 3.1.0.CR1 can't find a valid Docker env despite valid podman 4.2.0 May 26, 2023
@gsmet gsmet assigned gsmet and unassigned gsmet May 26, 2023
@Karm Karm self-assigned this May 30, 2023
@Karm
Copy link
Member

Karm commented May 30, 2023

@gsmet I was preparing a blogpost about Podman for Windows. Then I wanted to test with Podman Desktop and contemporary Quarkus and it doesn't work plus it shows different things in different terminals (suspect color control symbols).
It is not just about .exe or the lack thereof.

I will fix it...

@krisgerhard
Copy link

Might be related to testcontainers/testcontainers-java#7058.
Released yesterday.

@ewoks
Copy link
Author

ewoks commented Jun 8, 2023

@krisgerhard is there some configuration I could set to take advantage of #7058 ?
Additional info I wrote is my current workaround, and it might be a hint why isn't working yet

@gsmet
Copy link
Member

gsmet commented Aug 24, 2024

I think the Podman story has been greatly improved in the past year. Let's close this one.

@gsmet gsmet closed this as completed Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants