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 executable ignores config option quarkus.http.host if set in the application configuration file #40299

Closed
flippingbits opened this issue Apr 26, 2024 · 2 comments · Fixed by #40337
Assignees
Labels
Milestone

Comments

@flippingbits
Copy link

flippingbits commented Apr 26, 2024

Describe the bug

When setting the configuration option quarkus.http.host in the application configuration file src/main/resources/application.properties (or src/main/resources/application.yaml when using quarkus-config-yaml), the native executable, built with ./mvnw package -Dnative, does not pick up this configuration.

I can successfully set the configuration option quarkus.http.host (default value: 0.0.0.0) when starting the native executable, either by setting the environment variable QUARKUS_HTTP_HOST=127.0.0.1 or by passing -Dquarkus.http.host=127.0.0.1 to the native executable, though.

Note that setting the configuration option via the application configuration file works perfectly for JARs built with ./mvnw package.

Expected behavior

The generated native executable picks up the configuration value from the application configuration file.

Given the following src/main/resources/application.properties file:

quarkus.http.host=127.0.0.1

I would expect the following:

./target/getting-started-1.0.0-SNAPSHOT-runner
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2024-04-26 09:58:38,062 INFO  [io.quarkus] (main) getting-started 1.0.0-SNAPSHOT native (powered by Quarkus 3.9.4) started in 0.015s. Listening on: http://127.0.0.1:8080
2024-04-26 09:58:38,062 INFO  [io.quarkus] (main) Profile prod activated.
2024-04-26 09:58:38,062 INFO  [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]

Actual behavior

The generated native executable does not pick up the configuration value from the application configuration file.

Given the following src/main/resources/application.properties file:

quarkus.http.host=127.0.0.1

I observe the following:

./target/getting-started-1.0.0-SNAPSHOT-runner
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2024-04-26 10:05:12,921 INFO  [io.quarkus] (main) getting-started 1.0.0-SNAPSHOT native (powered by Quarkus 3.9.4) started in 0.011s. Listening on: http://0.0.0.0:8080
2024-04-26 10:05:12,921 INFO  [io.quarkus] (main) Profile prod activated.
2024-04-26 10:05:12,921 INFO  [io.quarkus] (main) Installed features: [cdi, rest, smallrye-context-propagation, vertx]

How to Reproduce?

Clone this repository and run the following commands:

$ ./mvnw package -Dnative
$ ./target/getting-started-1.0.0-SNAPSHOT-runner

Output of uname -a or ver

Darwin C7MW2PKHK6 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "21.0.2" 2024-01-16 OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.9.4

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

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 26, 2024

/cc @Karm (mandrel), @galderz (mandrel), @radcortez (config), @zakkak (mandrel,native-image)

@flippingbits flippingbits changed the title Native profile ignores config option quarkus.http.host if set in the application configuration file Native executable ignores config option quarkus.http.host if set in the application configuration file Apr 26, 2024
@galderz
Copy link
Member

galderz commented Apr 29, 2024

I've replicated it, looking into it.

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

Successfully merging a pull request may close this issue.

4 participants