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

minio.error.SignatureDoesNotMatch non ascii metadata #764

Closed
zukka77 opened this issue May 26, 2019 · 3 comments · Fixed by #770
Closed

minio.error.SignatureDoesNotMatch non ascii metadata #764

zukka77 opened this issue May 26, 2019 · 3 comments · Fixed by #770

Comments

@zukka77
Copy link

zukka77 commented May 26, 2019

Whenever i try to put an object with non ascii metadata value I get minio.error.SignatureDoesNotMatch

Traceback (most recent call last):
  File "testio.py", line 18, in <module>
    minioClient.put_object("test","test.txt",BytesIO(data),len(data),metadata={"test":"testà"})
  File "/tmp/venv/lib/python3.7/site-packages/minio/api.py", line 838, in put_object
    progress=progress)
  File "/tmp/venv/lib/python3.7/site-packages/minio/api.py", line 1551, in _do_put_object
    content_sha256=sha256_hex
  File "/tmp/venv/lib/python3.7/site-packages/minio/api.py", line 1901, in _url_open
    object_name).get_exception()
minio.error.SignatureDoesNotMatch: SignatureDoesNotMatch: message: The request signature we calculated does not match the signature you provided.

This works:

with open('test.txt','rb') as f:
    data=f.read()
minioClient.put_object("test","test.txt",BytesIO(data),len(data),metadata={"test":"test"})

This doesn't:

with open('test.txt','rb') as f:
    data=f.read()
minioClient.put_object("test","test.txt",BytesIO(data),len(data),metadata={"test":"testà"})
@kannappanr
Copy link
Collaborator

@zukka77 Thanks for reporting this issue. Will take a look.

@vadmeste
Copy link
Member

vadmeste commented May 30, 2019

@zukka77 in the following documentation, https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-metadata, it says that
Each key-value pair must conform to US-ASCII when you are using REST

é is not accepted as a header value even in the HTTP spec.

The best we can do here is to return an error with a self explanatory message.

@kannappanr
Copy link
Collaborator

ping @vadmeste We can add something like

metadata supports only ASCII characters.

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

Successfully merging a pull request may close this issue.

3 participants