Comments (6)
related to #536
from s3mock.
@campidelli
Do you have a working test case against the real S3 API?
When I was implementing #536, I couldn't figure out how the parts are supposed to work. Citing myself:
The implementation for the "HeadObject" attributes is straightforward, but I struggle to understand how the "ListParts" attributes are supposed to work.
I can't get a test case against the S3 API to work.
There is no way to pass in an "uploadId", so a call to an object where the multipart upload is still running returns a 404 key not found.
After the multipart upload is completed, the "parts" in the response are empty because there are no more parts.
from s3mock.
This is a use case https://github.com/campidelli/file-storage-service/blob/main/src/main/java/campidelli/file/storage/controller/AsyncMultipartDownloadController.java
BTW, I have found more things in this new version:
- Now I need to provide basic credentials to my S3Client, the
DefaultCredentialsProvider
doesn't work anymore. - When I use
.withVolumeAsRoot(TEMP_DIR.getAbsolutePath())
it times out looking for/favicon.ico
and the test doesn't run.
from s3mock.
@campidelli just to reiterate:
this application and the tests are working as-is against the real S3 backend?
After looking at the code, I'm pretty sure they will not.
There are multiple problems with the test setup, none have anything to do with S3Mock:
- The application can't reach the S3Mock testcontainer.
- The WebTestClient request timeout is so low (5 seconds) that if the application can reach S3(Mock) and makes multiple requests, we run into timeouts.
- The file uploaded is so small that the S3Client uses a "putObject" instead of a MultipartUpload.
- The part size calculation is wrong, object size is always returned in bytes, so parts are expected to be 8 bytes long in your implementation.
- Since MultipartUpload is not used, getObjectAttributes returns all needed properties in the response.
...
Please make sure that your code works before asking me to debug problems in S3Mock. I'm doing this in my free time... ;)
Also: run S3Mock as an external process / Docker container to see the logs. Make sure to use the "debug" setting. You can see which requests come in, which controller methods they are being routed to etc. Using "trace" gives even more output, though that may be hard to read - Spring logs a lot on "trace".
You'd have seen that there are no errors in the logs, getObjectAttributes is never called and the problem is within your test and application.
campidelli/file-storage-service#3
from s3mock.
Also:
DefaultCredentialsProvider
is provided by the AWS SDK. In your test application, I can see in the debugger that DefaultCredentialsProvider
is used and works, and withVolumeAsRoot
does not throw an error when used.
Not sure how you can reproduce these problems.
This is a use case https://github.com/campidelli/file-storage-service/blob/main/src/main/java/campidelli/file/storage/controller/AsyncMultipartDownloadController.java
BTW, I have found more things in this new version:
1. Now I need to provide basic credentials to my S3Client, the `DefaultCredentialsProvider` doesn't work anymore. 2. When I use `.withVolumeAsRoot(TEMP_DIR.getAbsolutePath())` it times out looking for `/favicon.ico` and the test doesn't run.
from s3mock.
@campidelli I'll close this ticket.
If you have any more questions / challenges then re-open or open a new issue with a reproducer I can easily execute :)
from s3mock.
Related Issues (20)
- Persist checksums for parts, validate on multipart completion HOT 4
- Completed 406 NOT_ACCEPTABLE when using Cloudflare Image Resizing HOT 6
- Add `ListObjectVersions` and verify S3Mock functionality with ceph/s3-tests
- Random unrecoverable "bucketMetadata" is null error HOT 10
- When upgrading to SpringBoot 3.1.1 I get NoClassDefFoundError: javax/servlet/Filter HOT 9
- accessKey and secretKey invalid HOT 9
- @JJRdec Could you please open a new ticket with a description on how to reproduce the issue?
- Upload Files read timeout (with Persist data) HOT 3
- SSLException: Unsupported or unrecognized SSL message HOT 6
- Copying object with new storage class does not appear to save storage class HOT 5
- initialBuckets is ignored if at least one bucket exists with a bucketMetadata.json
- Service: Amazon S3; Status Code: 404; Error Code: 404 HOT 2
- org.eclipse.jetty.server.Request : java.lang.IllegalStateException: Form is larger than max length 200000 HOT 1
- while reading large number of record from s3mock getting Exception( java.io.IOException: Attempted read on closed stream) HOT 2
- S3Mock is incompatible with Spring Boot 3.2.x and Spring Framework 6.x HOT 3
- createBucket fails using S3AsyncClient with NoSuchBucketException HOT 1
- Support S3AsyncClient from software.amazon.awssdk:s3 HOT 2
- Cannot put object acl without a policy HOT 5
- When upgrading to Spring 3.2.2: ClassNotFoundException: javax.xml.bind.annotation.XmlElement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3mock.