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

Handling a multipart request part as a file based on the content-type #30502

Closed
pjgg opened this issue Jan 20, 2023 · 8 comments
Closed

Handling a multipart request part as a file based on the content-type #30502

pjgg opened this issue Jan 20, 2023 · 8 comments
Labels
area/rest kind/bug Something isn't working

Comments

@pjgg
Copy link
Contributor

pjgg commented Jan 20, 2023

Describe the bug

Quarkus 2.13.7.Final
Related to #29725

This issue is still happening on Quarkus 2.13.7.Final although was backported to Quarkus 2.13.6.Final . Is working on Quarkus 2.15.2.Final or main.

Expected behavior

All files regardless to the content-type of a multi-part request are uploaded.

Actual behavior

I am getting the following error:

Request failed: java.lang.NullPointerException: Cannot invoke "java.io.File.toPath()" because "multipartBody.plainTextFile" is null

How to Reproduce?

git clone --branch 2.13 [email protected]:quarkus-qe/quarkus-test-suite.git
cd  quarkus-test-suite/http/jaxrs-reactive

Fails

mvn clean verify -Dit.test=RESTEasyReactiveMultipartIT#testPlainTextFilePartFromMultipart -Dquarkus.platform.version=2.13.7.Final

Works

mvn clean verify -Dit.test=RESTEasyReactiveMultipartIT#testPlainTextFilePartFromMultipart -Dquarkus.platform.version=2.15.2.Final 

Be sure that the test RESTEasyReactiveMultipartIT#testPlainTextFilePartFromMultipart is not disabled

Output of uname -a or ver

Linux ovpn-193-134.brq.redhat.com 6.0.16-300.fc37.x86_64

Output of java -version

openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

GraalVM version (if different from Java)

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

@pjgg pjgg added the kind/bug Something isn't working label Jan 20, 2023
@pjgg pjgg changed the title [2.13.7.Final] Handling a multipart request part as a file based on the content-type Handling a multipart request part as a file based on the content-type Jan 20, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 20, 2023

/cc @FroMage (resteasy-reactive), @Sgitario (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

@gsmet
Copy link
Member

gsmet commented Jan 20, 2023

@pjgg I'm confused. Does it work with 2.13.6.Final? Because Pedro confirmed things were working for him with 2.13.6.Final.

@pjgg
Copy link
Contributor Author

pjgg commented Jan 20, 2023

@gsmet the reproducer is still failing on 2.13.6.Final (but works on 2.15.2.Final) so maybe something else needs to be backported.

@gsmet
Copy link
Member

gsmet commented Jan 20, 2023

So what I don't understand is that Pedro was positive his issue was fixed in 2.13.6.Final so I'm not sure your test is actually testing exactly the behavior @pedroigor wanted. I know we had other patches related to this issue that we didn't backport though.

@Sgitario
Copy link
Contributor

The test is not working because it's sending a text part. If you change this line to:

MultiPartSpecification textSpec = new MultiPartSpecBuilder(text.getBytes(StandardCharsets.UTF_8))

The test will work in 2.13.6.Final.

This issue was fixed for 2.15.1.Final by #29716, which is not backported.

@geoand
Copy link
Contributor

geoand commented Jan 23, 2023

So should we disable the test in 2.13?

@pedroigor
Copy link
Contributor

Looks like it is a different scenario. The behavior we expect is working fine in 2.13.

@Sgitario
Copy link
Contributor

Sgitario commented Mar 8, 2023

Closing as not planned.

@Sgitario Sgitario closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants