Open gsmet opened 3 days ago
/cc @radcortez (config)
/cc @cescoffier
FWIW, I fixed the Health UI issue in https://github.com/quarkusio/quarkus/pull/44647 but that doesn't solve the fact that we are building URLs at build time with runtime elements.
Yes, all this part should be moved to runtime.
@phillip-kruger when is the 404 page generated?
It's generated at build. But I think I should be able to fix this. I'll have a look in the morning.
Ok, after looking at this in detail, I realized I might not be the right person to look at this. The dev mode works fine (I thought the error was there). I am not sure how the 404 works in Prod mode. The 404 page and related code is only in dev mode.
@phillip-kruger, we won't change this in prod mode. However, in dev mode, instead of computing the URLs are build time, we would compute them at runtime.
It works fine in Dev mode
NonApplicationRootPathBuildItem#getManagementUrlPrefix()
resolves non-application URLs using runtime config.While it's not that big of a deal when the result of this call is used in dev mode, it becomes a problem when some of these paths (well, they are actually URLs when the management interface is enabled) are used at runtime such as when the Health UI is made available at runtime.
I think we should avoid using the host when configuring the Health UI as there's a good chance you won't use the interface address to get access to it. I will try to address that in a PR. But that doesn't solve the more general problem we have here.
Noticed while trying to fix
NonApplicationRootPathBuildItem#getManagementUrlPrefix()
and gettingNonApplicationRootPathBuildItemTest
to fail.It can be very easily reproducer with the following project:
management-url-issue.zip
Then:
Go to http://localhost:9008/q/health-ui/ , you will see the following error:
because the config used the URL generated at build time with some default config.