scireum / s3ninja

S3 ninja emulates the Amazon S3 API for developement and test purposes
MIT License
493 stars 91 forks source link

Multipart upload error when file name includes slash #170

Closed lampslave closed 3 years ago

lampslave commented 3 years ago

I am trying to upload a file using evaporate.js. Files with normal names load correctly, but when I try the name with a slash, I get error:

sirius.kernel.health.HandledException: An unexpected exception occurred: No such file or directory (java.io.IOException)
    at sirius.kernel.health.Exceptions$ErrorHandler.handle(Exceptions.java:219)
    at sirius.kernel.health.Exceptions.handle(Exceptions.java:366)
    at ninja.S3Dispatcher.combineParts(S3Dispatcher.java:980)
    at ninja.S3Dispatcher.completeMultipartUpload(S3Dispatcher.java:907)
    at ninja.S3Dispatcher.writeObject(S3Dispatcher.java:532)
    at ninja.S3Dispatcher.lambda$preparePreDispatch$0(S3Dispatcher.java:197)
    at sirius.web.http.DispatcherPipeline.executePreDispatching(DispatcherPipeline.java:137)
    at sirius.web.http.DispatcherPipeline.lambda$preDispatch$3(DispatcherPipeline.java:122)
    at sirius.kernel.async.ExecutionBuilder$TaskWrapper.run(ExecutionBuilder.java:123)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: No such file or directory
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1014)
    at ninja.S3Dispatcher.combineParts(S3Dispatcher.java:971)
    ... 9 more

Diagnostic:

    node: 357f20e3c180
    duration: 55 Milliseconds
    parent: HTTP::GENERIC::/mybucket/chat_message_attachments/gglur6ggop.txt
    scope: default
    userId: (public)
    flow: 357f20e3c180/901
    username: (public)
jakobvogel commented 3 years ago

Hello @lampslave 👋 Which version do you use?

lampslave commented 3 years ago

Hello @jakobvogel I use docker image scireum/s3-ninja:7.0.1

jakobvogel commented 3 years ago

Thanks. I will have a look as soon as possible.

jakobvogel commented 3 years ago

Pull request #171 should fix this bug. Thanks for reporting it. Please let us know whether the upcoming release solves the issue for you.

jakobvogel commented 3 years ago

Release 7.0.2 is available.

lampslave commented 3 years ago

It works! Thank you a lot :)