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

Native image agent integration fails with dev services #41771

Closed
galderz opened this issue Jul 9, 2024 · 3 comments · Fixed by #41858
Closed

Native image agent integration fails with dev services #41771

galderz opened this issue Jul 9, 2024 · 3 comments · Fixed by #41858
Assignees
Milestone

Comments

@galderz
Copy link
Member

galderz commented Jul 9, 2024

Native image agent integration fails to work with integration tests that rely on external services, e.g. DBs:

2024-07-09 07:07:30,088 INFO  [io.qua.dev.h2.dep.H2DevServicesProcessor] (build-4) Dev Services for H2 started.
2024-07-09 07:07:30,092 INFO  [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-4) Dev Services for default datasource (h2) started
2024-07-09 07:07:30,779 INFO  [io.qua.tes.com.DefaultDockerContainerLauncher] (main) Executing "podman run --name quarkus-integration-test-ZonVU -i --rm --user 501:20 -p 8081:8081 -p 8444:8444 --entrypoint java -v /Users/galder/tmp/jinq-native-agent/0807/quarkus-jinq/target:/project --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081 --env QUARKUS_PROFILE=test-with-native-agent --env QUARKUS_DATASOURCE_PASSWORD=quarkus --env QUARKUS_DATASOURCE_DB_KIND=h2 --env QUARKUS_DATASOURCE_DEVSERVICES_REUSE=true --env QUARKUS_DATASOURCE_JDBC_URL=jdbc:h2:tcp://localhost:58351/mem:quarkus;DB_CLOSE_DELAY=-1 --env QUARKUS_DATASOURCE_USERNAME=quarkus --env QUARKUS_TEST_INTEGRATION_TEST_PROFILE=test-with-native-agent quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 -agentlib:native-image-agent=access-filter-file=quarkus-access-filter.json,caller-filter-file=quarkus-caller-filter.json,config-output-dir=native-image-agent-base-config, -jar quarkus-app/quarkus-run.jar"

The dev services start bare metal in localhost, but Quarkus runs in container, so Quarkus cannot access those. In this case Quarkus fails to start, e.g.

2024-07-09 06:07:38,370 ERROR [io.qua.run.Application] (main) Failed to start application (with profile [test-with-native-agent]): java.lang.RuntimeException: Failed to start quarkus
...
Caused by: org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution [Connection is broken: "java.net.ConnectException: Connection refused: localhost:58351" [90067-224]] [n/a]

This is originally reported by @ebramirez in this Zulip chat.

@galderz galderz added the kind/bug Something isn't working label Jul 9, 2024
@galderz galderz self-assigned this Jul 9, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 9, 2024

/cc @Karm (mandrel), @geoand (devservices), @stuartwdouglas (devservices), @zakkak (mandrel,native-image)

@quarkus-bot

This comment was marked as resolved.

@galderz
Copy link
Member Author

galderz commented Jul 12, 2024

@ebramirez #41858 contains a fix for this.

@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Jul 19, 2024
@gsmet gsmet modified the milestones: 3.14 - main, 3.13.0 Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants