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 quarkus.http.non-application-root-path relative to quarkus.http.root-path leads to stuck backend requests in combination with the Quinoa Dev Server #780

Open
ThoSap opened this issue Oct 2, 2024 · 9 comments
Assignees
Labels
needs triage Issue needs triaging

Comments

@ThoSap
Copy link

ThoSap commented Oct 2, 2024

Describe the bug

When the Quarkus quarkus.http.non-application-root-path is set relative to quarkus.http.root-path, requests to the REST API endpoints lead to stuck backend requests when Quinoa quarkus.quinoa.ui-root-path is unset or not set to anything different than / (relative to the quarkus.http.root-path, but then the dev server does not work at all).
For example:

quarkus.http.root-path=/administration
quarkus.http.non-application-root-path=/administration/api
quarkus.rest.path=/api/v1

So my endpoints are the following:

/administration/* <- frontend
/administration/api/* <- non-application-root-path like the Swagger UI and Health UI like the following two
/administration/api/swagger-ui/
/administration/api/health-ui/
/administration/api/v1/* <- REST API paths

If I set the quarkus.quinoa.ui-root-path to something different, let's say /dummy, then the backend REST API requests work and the backend is not stuck, but I then cannot use the Quinoa dev server as the path is wrong for Angular.
Also quarkus.quinoa.just-build set to true fixes the error, but then I can no longer use the dev server advantages of Quinoa.

This also happens with Quarkus version 3.14.4.

When I then stop the backend using q in the console, I get the following errors:

2024-10-02T13:40:00.146Z INFO  [quarkus] (Quarkus Main Thread) administration 0.0.0-SNAPSHOT on JVM (powered by Quarkus 3.15.1) started in 22.115s. Listening on: http://localhost:8084
2024-10-02T13:40:00.146Z INFO  [quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-10-02T13:40:00.146Z INFO  [quarkus] (Quarkus Main Thread) Installed features: [agroal, cache, cdi, config-yaml, jdbc-oracle, jdbc-postgresql, kubernetes, micrometer, narayana-jta, oidc, oidc-client, quinoa, rest, rest-client, rest-client-jackson, rest-client-oidc-filter, rest-client-oidc-token-propagation, rest-jackson, security, smallrye-context-propagation, smallrye-health, smallrye-openapi, swagger-ui, vertex]

q

2024-10-02T13:41:38.143Z INFO  [PackageManagerRunner] (Thread-82) Stopping Quinoa package manager live coding as a dev service.
2024-10-02T13:41:38.146Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration (- bytes in 6746 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.146Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration (- bytes in 4914 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.146Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6776 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.146Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6806 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.147Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6797 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.147Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6787 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.147Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6765 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.148Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 6771 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.148Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 4916 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
13:41:38 [vite] http proxy error: /administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
13:41:38 [vite] http proxy error: /administration/api/v1/core/keycloak
Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2024-10-02T13:41:38.260Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration (- bytes in 77 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.263Z INFO  [access-log] (vert.x-eventloop-thread-6) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 78 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.264Z ERROR [ConnectionBase] (vert.x-eventloop-thread-5) Connection reset [Error Occurred After Shutdown]
2024-10-02T13:41:38.264Z ERROR [ConnectionBase] (vert.x-eventloop-thread-6) Connection reset [Error Occurred After Shutdown]
2024-10-02T13:41:38.265Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-5) Quinoa failed to forward request '/administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration', see logs. [Error Occurred After Shutdown]: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.265Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-6) Quinoa failed to forward request '/administration/api/v1/core/keycloak', see logs. [Error Occurred After Shutdown]: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.270Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 87 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.271Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration (- bytes in 29 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.271Z ERROR [ConnectionBase] (vert.x-eventloop-thread-6) Connection reset [Error Occurred After Shutdown]
2024-10-02T13:41:38.272Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-6) Quinoa failed to forward request '/administration/api/v1/core/keycloak', see logs. [Error Occurred After Shutdown]: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.272Z ERROR [ConnectionBase] (vert.x-eventloop-thread-5) Connection reset [Error Occurred After Shutdown]
2024-10-02T13:41:38.273Z ERROR [ConnectionBase] (vert.x-eventloop-thread-6) Connection reset [Error Occurred After Shutdown]
2024-10-02T13:41:38.273Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-5) Quinoa failed to forward request '/administration/api/v1/core/keycloak', see logs. [Error Occurred After Shutdown]: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.274Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-6) Quinoa failed to forward request '/administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration', see logs. [Error Occurred After Shutdown]: java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:401)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:434)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:356)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.275Z INFO  [access-log] (vert.x-eventloop-thread-5) Request HTTP 200 GET /administration/api/v1/core/keycloak (- bytes in 86 ms) by - from IP 127.0.0.1 (Scheme=-, Protocol=HTTP_1_1)
2024-10-02T13:41:38.277Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-6) Quinoa failed to forward request '/administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration', see logs. [Error Occurred After Shutdown]: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: /[0:0:0:0:0:0:0:1]:4204
Caused by: java.net.ConnectException: Connection refused: getsockopt
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:336)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.277Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-5) Quinoa failed to forward request '/administration/api/v1/core/keycloak', see logs. [Error Occurred After Shutdown]: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: /[0:0:0:0:0:0:0:1]:4204
Caused by: java.net.ConnectException: Connection refused: getsockopt
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:336)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.278Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-6) Quinoa failed to forward request '/administration/api/v1/core/keycloak', see logs. [Error Occurred After Shutdown]: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: /[0:0:0:0:0:0:0:1]:4204
Caused by: java.net.ConnectException: Connection refused: getsockopt
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:336)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.279Z ERROR [QuinoaDevProxyHandler] (vert.x-eventloop-thread-5) Quinoa failed to forward request '/administration/api/v1/translations/en?applications=MyApp-Common&applications=MyApp-Administration', see logs. [Error Occurred After Shutdown]: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt: /[0:0:0:0:0:0:0:1]:4204
Caused by: java.net.ConnectException: Connection refused: getsockopt
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:336)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:339)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

2024-10-02T13:41:38.375Z INFO  [quarkus] (Shutdown thread) administration stopped in 0.232s

Quinoa version

2.4.9

Quarkus version

3.15.1

Build / Runtime

Angular

Package Manager

PNPM

Steps to reproduce the behavior

quarkus:
  rest:
    path: /api/v1
  http:
    root-path: /administration
    non-application-root-path: ${quarkus.http.root-path}/api
    enable-compression: true
    compress-media-types:
      - text/plain
      - text/html
      - text/css
      - text/javascript
      - text/xml
      - application/atom+xml
      - application/geo+json
      - application/javascript
      - application/json
      - application/ld+json
      - application/manifest+json
      - application/rdf+xml
      - application/rss+xml
      - application/x-javascript
      - application/xhtml+xml
      - application/xml
      - font/eot
      - font/otf
      - font/ttf
      - image/svg+xml
    host-enabled: true
    http2: true
    http2-push-enabled: true
    port: 8080
    record-request-start-time: true
    access-log:
      enabled: true
      # Exclude all HTTP request access logs not matching /administration/api.* (excluding /api/dev.* and /api/_static.* and /api/health.* and /api/metrics.* and /api/swagger-ui.* as we don't want to log these)
      exclude-pattern: ^(?!\/administration\/api(?!\/dev|\/_static|\/health|\/metrics|\/swagger-ui)).*$
    static-resources:
      max-age: PT1H
  quinoa:
    build-dir: dist/apps/administration/browser
    enable-spa-routing: true
    dev-server:
      managed: true
      host: localhost
      port: 4200
      websocket: true
      check-timeout: 60000
      logs: false
    package-manager: pnpm
    package-manager-command:
      dev: administration:start
      build: administration:build

Expected behavior

No response

@melloware
Copy link
Contributor

Don't you also need something like...

quarkus.rest.path=/bar/foo
quarkus.quinoa.ignored-path-prefixes=/q,/bar/foo/baz

@ThoSap
Copy link
Author

ThoSap commented Oct 2, 2024

Sorry I already had quarkus.rest.path set to the following (I also updated the issue description above) and as the doc says for quarkus.quinoa.ignored-path-prefixes, this property automatically ignores values configured by quarkus.resteasy-reactive.path, quarkus.rest.path, quarkus.resteasy.path and quarkus.http.non-application-root-path.

quarkus.rest.path=/api/v1

@ThoSap
Copy link
Author

ThoSap commented Oct 2, 2024

Maybe one addition which probably is the root cause of this issue, the REST endpoints, for example

/administration/api/v1/core/keycloak
/administration/api/v1/translations/en

are coming from a shared multi-module lib and are discovered automatically by the simplified bean discovery (dependency injection).
https://quarkus.io/guides/cdi-reference

So I guess maybe these REST paths must be added to quarkus.quinoa.ignored-path-prefixes (even though they should already be covered by quarkus.rest.path?), but maybe that is something that Quinoa should handle out of the box?

Some Quarkus Gradle multi-module examples from the Quarkus integration tests:
https://github.com/quarkusio/quarkus/tree/3.15.1/integration-tests/gradle/src/main/resources/basic-multi-module-project
https://github.com/quarkusio/quarkus/tree/3.15.1/integration-tests/gradle/src/main/resources/basic-multi-module-project-test-setup
https://github.com/quarkusio/quarkus/tree/3.15.1/integration-tests/gradle/src/main/resources/multi-module-named-injection

@melloware
Copy link
Contributor

yeah you might have to tweak that ignored values as thta is what the Angular Integration Tests here do...

@ThoSap
Copy link
Author

ThoSap commented Oct 2, 2024

Got it, I will try that.
But is it normal that if this is not configured correctly, Quinoa infinitely blocks any REST API request?

@melloware
Copy link
Contributor

Yes i am pretty sure if you look through the tickets here if both are mapped to the same address you need to distinguish them. That is how the integration tests are. In all my code I always set Quinoa at one path and REST API at another path. But I will let @ia3andy chime in he knows more about this stuff than me....

@melloware melloware added the needs triage Issue needs triaging label Oct 7, 2024
@melloware
Copy link
Contributor

@ThoSap where did you end up on this?

@HerrDerb
Copy link

I also experience that the dev server mode seems not to work. All request from the server application on port :4200 to the backend hang. When disabling the dev server, it seems to work find but then I don't have the "push" live reload anymore and gotta press F5 every time 🤷‍♂️

@melloware
Copy link
Contributor

@HerrDerb can you put together a small reproducer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs triaging
Projects
None yet
Development

No branches or pull requests

4 participants