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

Quarkus fails to expand quarkus.application.name in DEV mode #46662

Open
Sgitario opened this issue Mar 7, 2025 · 2 comments · May be fixed by #46670
Open

Quarkus fails to expand quarkus.application.name in DEV mode #46662

Sgitario opened this issue Mar 7, 2025 · 2 comments · May be fixed by #46670
Labels
area/devmode kind/bug Something isn't working

Comments

@Sgitario
Copy link
Contributor

Sgitario commented Mar 7, 2025

Describe the bug

We're using the Smallrye OpenAPI and Swagger UI extensions with the following properties:

quarkus.smallrye-openapi.path=/api/${quarkus.application.name}/internal/openapi
quarkus.swagger-ui.path=/api/${quarkus.application.name}/internal/swagger-ui

Note that "quarkus.application.name" is automatically set by the build.

When running the application using the production profile, it works fine (using the JAR file), however when running in DEV mode, it fails with:

2025-03-06 15:34:26,557 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.devui.deployment.menu.EndpointsProcessor#createEndpointsPage threw an exception: java.lang.IllegalArgumentException: Specified path is an invalid URI. Path was /api/${quarkus.application.name}/internal/swagger-ui
        at io.quarkus.deployment.util.UriNormalizationUtil.toURI(UriNormalizationUtil.java:52)
        at io.quarkus.deployment.util.UriNormalizationUtil.normalizeWithBase(UriNormalizationUtil.java:107)
        at io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem.resolvePath(NonApplicationRootPathBuildItem.java:165)
        at io.quarkus.devui.deployment.menu.EndpointsProcessor.createEndpointsPage(EndpointsProcessor.java:29)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
        at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
        at java.base/java.lang.Thread.run(Thread.java:840)
        at org.jboss.threads.JBossThread.run(JBossThread.java:499)
Caused by: java.net.URISyntaxException: Illegal character in path at index 6: /api/${quarkus.application.name}/internal/swagger-ui
        at java.base/java.net.URI$Parser.fail(URI.java:2976)

This was working fine in Quarkus 3.18.3, and we spotted the issue in 3.19.2.

We're using Gradle (didn't check if this is happening in Maven), and also if it only affects to the swagger UI extension.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

@Sgitario
Copy link
Contributor Author

Sgitario commented Mar 7, 2025

@radcortez do you know any recent changes that could affect this?

@Sgitario
Copy link
Contributor Author

Sgitario commented Mar 7, 2025

I found the changes that are causing this issue: #43950
@phillip-kruger the getProperty method does not expand the properties.

This only affects the swagger UI endpoint and it can be reproduced in Maven as well.

lindseyburnett added a commit to RedHatInsights/rhsm-subscriptions that referenced this issue Mar 7, 2025
…erty

This is a workaround for an issue running quarkusDev gradle task after bumping the quarkusVersion to 3.19.1.

See quarkusio/quarkus#46662
lindseyburnett added a commit to RedHatInsights/rhsm-subscriptions that referenced this issue Mar 7, 2025
…erty (#4244)

This is a workaround for an issue running quarkusDev gradle task after
bumping the quarkusVersion to 3.19.1.

See quarkusio/quarkus#46662

The quarkusDev gradle tasked stopped working because of that version
bump. It was resulting in this stack trace

```
./gradlew :swatch-contracts:quarkusDev
```
```
2025-03-06 15:34:26,557 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.devui.deployment.menu.EndpointsProcessor#createEndpointsPage threw an exception: java.lang.IllegalArgumentException: Specified path is an invalid URI. Path was /api/${quarkus.application.name}/internal/swagger-ui
        at io.quarkus.deployment.util.UriNormalizationUtil.toURI(UriNormalizationUtil.java:52)
        at io.quarkus.deployment.util.UriNormalizationUtil.normalizeWithBase(UriNormalizationUtil.java:107)
        at io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem.resolvePath(NonApplicationRootPathBuildItem.java:165)
        at io.quarkus.devui.deployment.menu.EndpointsProcessor.createEndpointsPage(EndpointsProcessor.java:29)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:255)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
        at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
        at java.base/java.lang.Thread.run(Thread.java:840)
        at org.jboss.threads.JBossThread.run(JBossThread.java:499)
Caused by: java.net.URISyntaxException: Illegal character in path at index 6: /api/${quarkus.application.name}/internal/swagger-ui
        at java.base/java.net.URI$Parser.fail(URI.java:2976)
        ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant