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

Health UI access wrong health endpoint with management interface #35980

Closed
will421 opened this issue Sep 18, 2023 · 4 comments · Fixed by #44647
Closed

Health UI access wrong health endpoint with management interface #35980

will421 opened this issue Sep 18, 2023 · 4 comments · Fixed by #44647
Labels
area/health area/smallrye env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@will421
Copy link

will421 commented Sep 18, 2023

Describe the bug

Hello,

I was trying to use the health-ui with management interface.
When opening the page, a request to the health endpoint is made but with the wrong host "0.0.0.0:9000".

Expected behavior

Health UI request to localhost:9000

Actual behavior

Health UI request to 0.0.0.0:9000

How to Reproduce?

  1. Create a project with
mvn io.quarkus.platform:quarkus-maven-plugin:3.3.3:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=microprofile-health-quickstart \
    -Dextensions='smallrye-health' \
    -DnoCode
  1. Add quarkus.management.enabled=true to application.properties
  2. Open http://localhost:9000/q/health-ui
  3. Check request console

Output of uname -a or ver

MINGW64_NT-10.0-19045 PC3747 3.4.7-ea781829.x86_64 2023-07-05 12:05 UTC x86_64 Msys

Output of java -version

openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

Quarkus version or git rev

3.3.3

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

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: D:\Programs\maven
Java version: 17.0.1, vendor: Eclipse Adoptium, runtime: D:\Programs\jdk\jdk-17.0.1+12
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

@will421 will421 added the kind/bug Something isn't working label Sep 18, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 18, 2023

/cc @jmartisk (health), @xstefank (health)

@xstefank
Copy link
Member

sure, I'll take a look

@will421
Copy link
Author

will421 commented Sep 19, 2023

I think it's because the script is using the management interface host, by default 0.0.0.0 rather than something like window.location.host
When I set quarkus.management.host=localhost it works again.

gsmet added a commit to gsmet/quarkus that referenced this issue Nov 22, 2024
The Health UI will be served from the exact same interface so we don't
need to include the host:port.
It actually causes issues when you access the Health UI through a proxy
as it might point to 0.0.0.0:9000 which will resolve to localhost.

Fixes quarkusio#35980
@gsmet
Copy link
Member

gsmet commented Nov 22, 2024

It took me a loooooong time to get there but I wanted to thank you for this bug report as it unveiled several issues that need fixing.

This first PR should fix the immediate problem: #44647 . But others are coming.

@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Nov 25, 2024
@gsmet gsmet modified the milestones: 3.18 - main, 3.17.1 Nov 27, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Nov 27, 2024
The Health UI will be served from the exact same interface so we don't
need to include the host:port.
It actually causes issues when you access the Health UI through a proxy
as it might point to 0.0.0.0:9000 which will resolve to localhost.

Fixes quarkusio#35980

(cherry picked from commit 4dbf1a8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/health area/smallrye env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants