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

Remote dev mode with gradle throwing connection refused #20904

Closed
AlanMasciangelo opened this issue Oct 20, 2021 · 2 comments · Fixed by #22621
Closed

Remote dev mode with gradle throwing connection refused #20904

AlanMasciangelo opened this issue Oct 20, 2021 · 2 comments · Fixed by #22621
Labels
area/devmode area/gradle Gradle area/kubernetes env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@AlanMasciangelo
Copy link

Describe the bug

I am attempting to run remote dev mode via Gradle against a Kubernetes deployment. Everything appears to be working as expected, mutable jar deployed in a container, logs show live coding enabled. When I attempt to connect via ./gradlew quarkusRemoteDev I get a connection refused.

Expected behavior

Remote dev mode working.

Actual behavior

The server side throws a BadRequestException and my workstation fails to connect.

The issue mentioned in #12969 seems similar. Specifically "The JDK client sends malformed q values (.2 instead of 0.2), resteasy rejects this with a bad request exception".

I captured the initial http requests coming from HttpRemoteDevClient and verified the Header values *; q=.2, */*; q=.2 were being included which I'm assuming is causing the issue.

Here's the server side stacktrace:

2021-10-19 19:35:34,387 INFO  [io.quarkus] [{}] (Quarkus Main Thread) Profile dev activated. Live Coding activated. 
2021-10-19 19:35:34,387 INFO  [io.quarkus] [{}] (Quarkus Main Thread) Installed features: [agroal, cdi, config-yaml, elasticsearch-rest-client, elasticsearch-rest-high-level-client, flyway, hibernate-orm, jdbc-postgresql, kubernetes-client, narayana-jta, quartz, reactive-routes, rest-client, rest-client-jackson, resteasy, resteasy-jackson, resteasy-mutiny, scheduler, security, smallrye-context-propagation, smallrye-health, smallrye-jwt, smallrye-metrics, smallrye-openapi, smallrye-reactive-messaging, smallrye-reactive-messaging-amqp, swagger-ui, vertx] 
2021-10-19 19:38:02,062 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] [{}] (executor-thread-0) HTTP Request to /connect failed, error id: a2e06b4b-fd41-4203-a991-88eee1224451-1: javax.ws.rs.BadRequestException: RESTEASY003520: Malformed quality value. 
	at org.jboss.resteasy.core.request.QualityValue.parseAsInteger(QualityValue.java:113) 
	at org.jboss.resteasy.core.request.QualityValue.valueOf(QualityValue.java:40) 
	at org.jboss.resteasy.core.request.AcceptHeaders.evaluateAcceptParameters(AcceptHeaders.java:292) 
	at org.jboss.resteasy.core.request.AcceptHeaders.getMediaTypeQualityValues(AcceptHeaders.java:170) 
	at org.jboss.resteasy.core.request.ServerDrivenNegotiation.setAcceptHeaders(ServerDrivenNegotiation.java:41) 
	at io.quarkus.resteasy.runtime.NotFoundExceptionMapper.selectVariant(NotFoundExceptionMapper.java:386) 
	at io.quarkus.resteasy.runtime.NotFoundExceptionMapper.respond(NotFoundExceptionMapper.java:244) 
	at io.quarkus.resteasy.runtime.NotFoundExceptionMapper.toResponse(NotFoundExceptionMapper.java:225) 
	at io.quarkus.resteasy.runtime.NotFoundExceptionMapper.toResponse(NotFoundExceptionMapper.java:53) 
	at org.jboss.resteasy.core.ExceptionHandler.executeExactExceptionMapper(ExceptionHandler.java:65) 
	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:317) 
	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218) 
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:258) 
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161) 
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) 
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164) 
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247) 
	at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73) 
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:135) 
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:90) 
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543) 
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) 
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) 
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) 
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29) 
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) 
	at java.base/java.lang.Thread.run(Unknown Source) 

How to Reproduce?

No response

Output of uname -a or ver

Microsoft Windows Version 10.0.19042 Build 19042

Output of java -version

JVM: 11.0.2 (Oracle Corporation 11.0.2+9)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0

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

Gradle 6.8.3

Additional information

No response

@AlanMasciangelo AlanMasciangelo added the kind/bug Something isn't working label Oct 20, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 20, 2021

/cc @geoand, @glefloch, @iocanel, @quarkusio/devtools

@stuartwdouglas
Copy link
Member

Do you have a password set? If there is no password set then the remote sync handler won't be installed, which would pass the request onto RESTEasy which will reject it because of the bad Q value.

gsmet added a commit to gsmet/quarkus that referenced this issue Jan 4, 2022
The default Accept header defined in
sun.net.www.protocol.http.HttpURLConnection is invalid and
does not respect the RFC so we override it with a valid value.
RESTEasy is quite strict regarding the RFC and throws an error.
Note that this is just the default HttpURLConnection header value
made valid.
See https://bugs.openjdk.java.net/browse/JDK-8163921
and https://bugs.openjdk.java.net/browse/JDK-8177439

Fixes quarkusio#20904
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Jan 5, 2022
@gsmet gsmet modified the milestones: 2.7 - main, 2.6.2.Final Jan 7, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Jan 7, 2022
The default Accept header defined in
sun.net.www.protocol.http.HttpURLConnection is invalid and
does not respect the RFC so we override it with a valid value.
RESTEasy is quite strict regarding the RFC and throws an error.
Note that this is just the default HttpURLConnection header value
made valid.
See https://bugs.openjdk.java.net/browse/JDK-8163921
and https://bugs.openjdk.java.net/browse/JDK-8177439

Fixes quarkusio#20904

(cherry picked from commit b65ae06)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode area/gradle Gradle area/kubernetes 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