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

NPE in Rest client when downloading multipart with File #24415

Closed
fedinskiy opened this issue Mar 18, 2022 · 4 comments
Closed

NPE in Rest client when downloading multipart with File #24415

fedinskiy opened this issue Mar 18, 2022 · 4 comments
Assignees
Labels
area/rest-client kind/bug Something isn't working

Comments

@fedinskiy
Copy link
Contributor

Describe the bug

REST client fails with NPE when downloading multipart forms.

Expected behavior

Rest client should download multipart forms successfully, like it currently do with uploading.

Actual behavior

Downloading fails with exception:

17:14:33,280 INFO  [app] 17:14:29,929 Uncaught exception received by Vert.x: java.lang.NullPointerException
17:14:33,281 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.readDelimiterOptimized(QuarkusMultipartResponseDecoder.java:1058)
17:14:33,281 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.findMultipartDelimiter(QuarkusMultipartResponseDecoder.java:674)
17:14:33,281 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.decodeMultipart(QuarkusMultipartResponseDecoder.java:522)
17:14:33,281 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.parseBodyMultipart(QuarkusMultipartResponseDecoder.java:487)
17:14:33,281 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.parseBody(QuarkusMultipartResponseDecoder.java:456)
17:14:33,282 INFO  [app] 	at org.jboss.resteasy.reactive.client.impl.multipart.QuarkusMultipartResponseDecoder.offer(QuarkusMultipartResponseDecoder.java:374)
17:14:33,282 INFO  [app] 	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$2$1$1.handle(ClientSendRequestHandler.java:198)
17:14:33,282 INFO  [app] 	at org.jboss.resteasy.reactive.client.handlers.ClientSendRequestHandler$2$1$1.handle(ClientSendRequestHandler.java:195)
17:14:33,283 INFO  [app] 	at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
17:14:33,283 INFO  [app] 	at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:63)
17:14:33,283 INFO  [app] 	at io.vertx.core.http.impl.HttpEventHandler.handleEnd(HttpEventHandler.java:76)
17:14:33,283 INFO  [app] 	at io.vertx.core.http.impl.HttpClientResponseImpl.handleEnd(HttpClientResponseImpl.java:250)
17:14:33,283 INFO  [app] 	at io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.lambda$new$0(Http1xClientConnection.java:383)
17:14:33,284 INFO  [app] 	at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:240)
17:14:33,284 INFO  [app] 	at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:130)
17:14:33,284 INFO  [app] 	at io.vertx.core.http.impl.Http1xClientConnection$StreamImpl.handleEnd(Http1xClientConnection.java:610)
17:14:33,284 INFO  [app] 	at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:71)
17:14:33,284 INFO  [app] 	at io.vertx.core.impl.DuplicatedContext.execute(DuplicatedContext.java:163)
17:14:33,285 INFO  [app] 	at io.vertx.core.http.impl.Http1xClientConnection.handleResponseEnd(Http1xClientConnection.java:844)
17:14:33,285 INFO  [app] 	at io.vertx.core.http.impl.Http1xClientConnection.handleHttpMessage(Http1xClientConnection.java:716)
17:14:33,285 INFO  [app] 	at io.vertx.core.http.impl.Http1xClientConnection.handleMessage(Http1xClientConnection.java:680)
17:14:33,285 INFO  [app] 	at io.vertx.core.net.impl.ConnectionBase.read(ConnectionBase.java:156)
17:14:33,285 INFO  [app] 	at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:153)
17:14:33,286 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
17:14:33,286 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
17:14:33,286 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
17:14:33,286 INFO  [app] 	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
17:14:33,287 INFO  [app] 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
17:14:33,287 INFO  [app] 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
17:14:33,287 INFO  [app] 	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
17:14:33,287 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
17:14:33,287 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
17:14:33,288 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
17:14:33,288 INFO  [app] 	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
17:14:33,288 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
17:14:33,288 INFO  [app] 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
17:14:33,289 INFO  [app] 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
17:14:33,289 INFO  [app] 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
17:14:33,289 INFO  [app] 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
17:14:33,289 INFO  [app] 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
17:14:33,289 INFO  [app] 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
17:14:33,290 INFO  [app] 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
17:14:33,290 INFO  [app] 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
17:14:33,290 INFO  [app] 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
17:14:33,290 INFO  [app] 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
17:14:33,291 INFO  [app] 	at java.base/java.lang.Thread.run(Thread.java:829)

How to Reproduce?

On any machine with installed bash, truncate and md5sum:

  1. git clone [email protected]:fedinskiy/quarkus-test-suite.git -b reproducer/reactive-rest-client
  2. cd quarkus-test-suite/http/rest-client-reactive
  3. mvn clean verify -Dit.test=FileIT#downloadMultipart

Output of uname -a or ver

5.16.13-200.fc35.x86_64

Output of java -version

11.0.12, vendor: GraalVM Community

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.4.Final

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

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)

Additional information

See #24405 for related issue

@fedinskiy fedinskiy added the kind/bug Something isn't working label Mar 18, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 18, 2022

/cc @michalszynkiewicz

@geoand
Copy link
Contributor

geoand commented Mar 21, 2022

@michalszynkiewicz are you looking into this one or do you want me to?

@michalszynkiewicz
Copy link
Member

No, I'm at other issues at the moment.

@geoand
Copy link
Contributor

geoand commented Mar 21, 2022

Hopefully not the ones I have already opened PRs for :)

I'll take a look at this later on today.

@geoand geoand self-assigned this Mar 21, 2022
geoand added a commit to geoand/quarkus that referenced this issue Mar 21, 2022
geoand added a commit to geoand/quarkus that referenced this issue Mar 21, 2022
geoand added a commit to geoand/quarkus that referenced this issue Mar 21, 2022
@gsmet gsmet closed this as completed in 2e92f0d Mar 21, 2022
gsmet added a commit that referenced this issue Mar 21, 2022
Improve usability of RESTEasy Reactive server and client multipart handling
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 28, 2022
fedinskiy added a commit to fedinskiy/quarkus-test-suite that referenced this issue Jun 3, 2022
fedinskiy added a commit to fedinskiy/quarkus-test-suite that referenced this issue Jun 3, 2022
fedinskiy added a commit to fedinskiy/quarkus-test-suite that referenced this issue Jun 6, 2022
fedinskiy added a commit to fedinskiy/quarkus-test-suite that referenced this issue Jun 6, 2022
fedinskiy added a commit to fedinskiy/quarkus-test-suite that referenced this issue Jun 8, 2022
pjgg pushed a commit to pjgg/quarkus-test-suite that referenced this issue Jun 14, 2022
quarkusio/quarkus#24402
quarkusio/quarkus#24405
quarkusio/quarkus#24415
quarkusio/quarkus#25028
Additionally: delete temporary files to speed up local execution
(cherry picked from commit 565a6fd)
pjgg pushed a commit to pjgg/quarkus-test-suite that referenced this issue Jun 14, 2022
quarkusio/quarkus#24402
quarkusio/quarkus#24405
quarkusio/quarkus#24415
quarkusio/quarkus#25028
Additionally: delete temporary files to speed up local execution
(cherry picked from commit 565a6fd)
fedinskiy added a commit to quarkus-qe/quarkus-test-suite that referenced this issue Jun 14, 2022
quarkusio/quarkus#24402
quarkusio/quarkus#24405
quarkusio/quarkus#24415
quarkusio/quarkus#25028
Additionally: delete temporary files to speed up local execution
(cherry picked from commit 565a6fd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants