-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Log records show the hostname on which the native executable was generated #41535
Comments
@Karm @javanegmond did you have to deal with the |
I have not. Looks to me like that's a whole separate issue from what I opened this issue for. |
@javanegmond Sorry, I should've clarified, your reproducer fails on my system due to this problem... |
The reproducer is nothing more than a getting-started project with logging and logging config. If that fails to build/execute, I'm going assume there's a totally unrelated issue with native builds that occurs on your system. |
@javanegmond Agreed, that it is an unrelated issue, it is just that I can't confirm the problem yet, but we'll check further. By the way, can you consider
as a workaround for now ? |
Sure thing. Building the project this way and running it with docker run --rm -h runtime-hostname -p 8080:8080 quarkus/quarkus-quickstart Followed by a GET on http://localhost:8080/hello shows the following in the logs:
I'm going out on a limb and assume |
@sberyozkin this looks like an incompatibility between your build system and your runtime system. I suspect you are building using the builder image and trying to run the native executable on the host machine or vice versa. I recommend either running in a container like you suggest in #41535 (comment) (which as stated by @javanegmond doesn't look like a workaround to the original issue) or installing mandrel or GraalVM locally on the host machine and both building and running the reproducer on the host (without the use of containers). |
@zakkak Thanks for the feedback. I just followed steps in https://github.com/javanegmond/quarkus-native-hostname, and indeed I have a local GraalVM installed.
But then the runtime and buildtime host is the same, so it is not an issue, since nothing is leaked. |
Any other method to have a different hostname at runtime than at buildtime could also suffice to reproduce the issue. In the specific project I found the issue on first we're producing the native build on a Gitlab runner and deploying the container in a k8s pod. |
Sure, this is why I called it a workaround. |
This seems to be on the right path. I ran the reproducer, but with
|
Thanks @dmlloyd for the fix |
@zakkak Hi Foivos, can you give me a favour and try the reproducer with the locally installed GraalVM 21, esp if you have Fedora 40 ? It is off-topic for this issue so can open a Discussion to follow up there |
Hi @sberyozkin, I have tried the following combinations on my Fedora machine:
and glibc 2.39 Build using builder-image with podman and run on local host ✔️
Build using local installation and run on local host ✔️
Build using local installation and run in a container fails as expected ❌
since the glibc version in
|
Hey @zakkak, thanks for the tests, summary, So yeah, would it make sense to have quarkus micro image shipping the latest version of this library ? I can open an enhancement request, not sure where though |
I don't know. Fedora is quite at the edge so I think that as long as we are compatible with the glibc versions shipped with LTS GNU/Linux distributions it should be fine, but in any case not my call :) |
FWIW I confirm that #41664 resolves this issue, I can no longer reproduce it with a Quarkus build based on the |
Thanks @zakkak, sure, let's see if more users will ask about it |
Describe the bug
When using hostname in formatted logs (the
%h
option), the hostname at build time is logged rather than the runtime hostname.This was reported and fixed a long time ago in this issue:
#14423
Expected behavior
The hostname at runtime is logged.
Actual behavior
The build time hostname is logged.
How to Reproduce?
Reproducer:
I created a reproducer here:
https://github.com/javanegmond/quarkus-native-hostname
Steps to reproduce:
mvn clean install -Pnative
docker run -h runtime-hostname -it --rm --entrypoint=/target/native-hostname-1.0.0-SNAPSHOT-runner -v $PWD/target:/target -p 8080:8080 quay.io/quarkus/quarkus-micro-image:2.0
Output of
uname -a
orver
No response
Output of
java -version
java version "21" 2023-09-19 LTS
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.12.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Additional information
I was not able to find at what point in time this behaviour has changed back to the old faulty behaviour. In the reproducer I found it in Quarkus 3.12.0, but the project I first found it in was on Quarkus 3.9.5.
The text was updated successfully, but these errors were encountered: