quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Health UI access wrong health endpoint with management interface #35980

Open will421 opened 1 year ago

will421 commented 1 year ago

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
  2. Add quarkus.management.enabled=true to application.properties
  3. Open http://localhost:9000/q/health-ui
  4. 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"

quarkus-bot[bot] commented 1 year ago

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

xstefank commented 1 year ago

sure, I'll take a look

will421 commented 1 year ago

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.