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

aws sync broken since 2.1.29 #257

Closed
mibollma opened this issue Jun 9, 2021 · 6 comments · Fixed by #258
Closed

aws sync broken since 2.1.29 #257

mibollma opened this issue Jun 9, 2021 · 6 comments · Fixed by #258
Assignees
Labels

Comments

@mibollma
Copy link

mibollma commented Jun 9, 2021

aws sync seems to be broken since 2.1.29.
Calling the command in it's basic form e.g. aws s3 sync . s3://bucket --endpoint-url http://localhost:9090 produces the error fatal error: 'Prefix'.
The same command works fine till version 2.1.28.

@afranken
Copy link
Member

I just reproduced this locally.
In #251, which was released in 2.1.29, support for the "encodingType" parameter was added.

Unfortunately, this seems to have broken object listing, as the client expects several field values in the response to be encoded (Prefix for example). If the field value is empty, the client expects those fields to be dropped from the response.
The error is thrown because we always return the Prefix and CommonPrefix fields with empty values, which the client tries to decode without checking if the value is empty.

@afranken
Copy link
Member

@gerhalt
Copy link

gerhalt commented Jun 29, 2021

Ran into exactly the same original URL-encoding issue and the new breakage described here.

@afranken
Copy link
Member

I have a fix ready, just working on the tests right now - unfortunately the V1 and V2 APIs (or rather the client implementation of ListObjects vs ListObjectsV2) do different things when it comes to responses with encoding.

I'm wondering if we have to keep supporting the V1 APIs in the mock...

@afranken afranken self-assigned this Jun 30, 2021
@afranken afranken added the bug label Jun 30, 2021
@mibollma
Copy link
Author

mibollma commented Jun 30, 2021

I'm still using V1 currently. One reason is that some features were only available in V1 at least until recently, such as DynamoDB client-side encryption: aws/aws-sdk-java-v2#34

@afranken
Copy link
Member

afranken added a commit that referenced this issue Jun 30, 2021
aws-cli expects no empty elements in encoded responses and will fail
the request if it encounters an empty element.
At least aws-java-sdk V1 and V2 worked fine with the current
implementation, though.

Fixes #257
@afranken afranken linked a pull request Jun 30, 2021 that will close this issue
2 tasks
agudian pushed a commit that referenced this issue Jul 1, 2021
aws-cli expects no empty elements in encoded responses and will fail
the request if it encounters an empty element.
At least aws-java-sdk V1 and V2 worked fine with the current
implementation, though.

Fixes #257
lennartblom pushed a commit to lennartblom/S3Mock that referenced this issue Nov 24, 2021
aws-cli expects no empty elements in encoded responses and will fail
the request if it encounters an empty element.
At least aws-java-sdk V1 and V2 worked fine with the current
implementation, though.

Fixes adobe#257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants