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

Errors deleting multipart tmp files #1761

Closed
osivinyuk opened this issue Dec 9, 2022 · 6 comments
Closed

Errors deleting multipart tmp files #1761

osivinyuk opened this issue Dec 9, 2022 · 6 comments
Labels

Comments

@osivinyuk
Copy link

Hello.
On Windows we found this bug with jetty.

2022-12-09 18:27:47 WARN Request:1472 - Errors deleting multipart tmp files
java.lang.RuntimeException: java.io.IOException: Could Not Delete File
at org.eclipse.jetty.util.MultiException.ifExceptionThrowRuntime(MultiException.java:148)
at org.eclipse.jetty.server.MultiPartFormInputStream.delete(MultiPartFormInputStream.java:463)
at org.eclipse.jetty.server.MultiPartFormInputStream.deleteParts(MultiPartFormInputStream.java:438)
at org.eclipse.jetty.server.MultiParts$MultiPartsHttpParser.close(MultiParts.java:101)
at org.eclipse.jetty.server.Request.onCompleted(Request.java:1468)
at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:966)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:485)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:139)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:933)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1077)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.io.IOException: Could Not Delete File
at org.eclipse.jetty.server.MultiPartFormInputStream$MultiPart.delete(MultiPartFormInputStream.java:328)
at org.eclipse.jetty.server.MultiPartFormInputStream$MultiPart.cleanUp(MultiPartFormInputStream.java:339)
at org.eclipse.jetty.server.MultiPartFormInputStream.delete(MultiPartFormInputStream.java:450)
... 17 more

@osivinyuk osivinyuk added the BUG label Dec 9, 2022
@tipsy
Copy link
Member

tipsy commented Dec 9, 2022

Version?

@osivinyuk
Copy link
Author

5.1.4
I think it’s some jetty problem on windows

@tipsy
Copy link
Member

tipsy commented Dec 10, 2022

@osivinyuk are you closing the stream?

@osivinyuk
Copy link
Author

Hello
I dont think so, but I made a copy of these files and working with copies:

public void addItem(@Parameter(hidden = true) Context ctx) {
    User user = usersManager.getUser(ctx);

    final List<UploadedFile> files = ctx.uploadedFiles("files");
    if (files.isEmpty())
        throw new ErrorException(RequiredParams, "files");

    for (UploadedFile file : files) {
            ... some files manipulations

            File tempImageFile = File.createTempFile("temp_image_", null);
            final Path tempImageFilePath = tempImageFile.toPath();
            Files.copy(imageInputStream, tempImageFilePath, StandardCopyOption.REPLACE_EXISTING);

            ... some files manipulations

    }
            ... some code for answer

    ctx.json(dto);
}

Maybe its wrong, but we was using Javalin 4 and I dont remember about this bug
Thank you

@tipsy
Copy link
Member

tipsy commented Dec 10, 2022

Maybe its wrong, but we was using Javalin 4 and I dont remember about this bug

There was a change in Jetty from 9 to 11. There shouldn't be any issue in Javalin now though: jetty/jetty.project#8417

@tipsy
Copy link
Member

tipsy commented Feb 18, 2023

This has been open for a really long time, I'll close it.

@tipsy tipsy closed this as completed Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants