generate_presigned_url not working with complete_multipart_upload
See original GitHub issueHello, I am trying to generate a presigned URL for complete_multipart_upload
, but I’m getting this error when running my code:
Traceback (most recent call last):
File "/dev-env/test/chalicelib/rmodel.py", line 280, in __call__
return funct(*args, **kwargs)
File "/dev-env/test/chalicelib/upload.py", line 201, in create_complete_upload
'MultipartUpload': upload})
File "/dev-env/venv/lib/python3.7/site-packages/botocore/signers.py", line 595, in generate_presigned_url
operation_name=operation_name)
File "/dev-env/venv/lib/python3.7/site-packages/botocore/signers.py", line 268, in generate_presigned_url
'presign-url', expires_in, signing_name)
File "/dev-env/venv/lib/python3.7/site-packages/botocore/signers.py", line 157, in sign
auth.add_auth(request)
File "/dev-env/venv/lib/python3.7/site-packages/botocore/auth.py", line 362, in add_auth
self._modify_request_before_signing(request)
File "/dev-env/venv/lib/python3.7/site-packages/botocore/auth.py", line 525, in _modify_request_before_signing
query_dict.update(self._get_body_as_dict(request))
File "/dev-env/venv/lib/python3.7/site-packages/botocore/auth.py", line 550, in _get_body_as_dict
data = json.loads(data.decode('utf-8'))
File "/dev-env/Packages/miniconda3/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/dev-env/Packages/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/dev-env/Packages/miniconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This is the code:
s3_client = boto3.client('s3')
signed_url = s3_client.generate_presigned_url('complete_multipart_upload',
ExpiresIn=3600,
HttpMethod='POST',
Params={
'Bucket': _BUCKET,
'Key': key,
'UploadId': upload_id,
'MultipartUpload': upload})
If I call s3_client.complete_multipart_upload
with the same arguments specified in Params
, then the operation completes without issues. From the error it looks like AWS is returning an unexpected response message to boto.
The boto3 version is 1.10.2
Thank you,
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Multipart uploads with S3 pre-signed URLs · Issue #1548
Is your feature request related to a problem? ... But i can not find it on asw-sdk-cpp just like http... ... step-2:GeneratePresignedUrl
Read more >S3 Java- Multipart upload using a presigned URL?
For a single PUT (or GET) operation, one can use generatePresignedUrl , but I wouldn't know how to apply this to multipart upload...
Read more >AmazonS3 (AWS SDK for Java - 1.12.368)
Provides an interface for accessing the Amazon S3 web service. Note: Do not directly implement this interface, new methods are added to it...
Read more >AmazonS3.generatePresignedUrl - Java
public URL getPreSignedUrl(long attachmentId, HttpMethod method, boolean unaccelerated) { AmazonS3 client = new AmazonS3Client(credentials); ...
Read more >aws/aws-sdk-go
Content should always be returned in CSV format, but I'm not 100% sure; GetCredentialReport. ... You need to do a little extra work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Caian, I can reproduce this issue. Thanks for your debugging thus far. Marking as a bug and will investigate further.
Reproduction does not need any credentials or actual objects, but simple invocation.