janko / uppy-s3_multipart

Provides Ruby endpoints for AWS S3 multipart uploads in Uppy
https://uppy.io/docs/aws-s3/
MIT License
65 stars 21 forks source link

NameError (uninitialized constant #<Class:NilClass>::PARAM_MAP in S3 #25

Closed mullermp closed 1 year ago

mullermp commented 1 year ago

I am creating this issue on behalf of one of our customers that encountered this error. I believe there to be an error in this library when creating a presigned url with S3. Please see this comment (you can ignore the thread, it was for a different reported issue): https://github.com/aws/aws-sdk-ruby/issues/2776#issuecomment-1295369003

The TL;DR is that when calling presigned_url or presigned_request, we expect a symbolized method name, but instead we are given "upload_part" as a string.

mullermp commented 1 year ago
mamuller@147dda1143b7 aws-sdk-ruby % gems/aws-sdk-resources/bin/aws-v3.rb -v
[1] pry(Aws)> Aws::S3::Presigner.new.presigned_url("upload_part", bucket: 'mamuller-us-west-2', key: 'multipart-test', upload_id: '123', part_number: '123', body: '')
NameError: uninitialized constant #<Class:NilClass>::PARAM_MAP
from /Users/mamuller/workplace/aws-sdk-ruby/gems/aws-sdk-core/lib/aws-sdk-core/endpoints/reference.rb:14:in `resolve'
[2] pry(Aws)> Aws::S3::Presigner.new.presigned_url(:upload_part, bucket: 'mamuller-us-west-2', key: 'multipart-test', upload_id: '123', part_number: '123', body: '')
[Aws::S3::Client 0 0.052097 0 retries] upload_part(bucket:"mamuller-us-west-2",key:"multipart-test",upload_id:"123",part_number:123,body:"")  
=> "https://mamuller-us-west-2.s3.us-west-2.amazonaws.com/multipart-test?partNumber=123&uploadId=123&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA6PPNEV3SARR46BGQ%2F20221028%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20221028T192654Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=3f3d94866f23c60fd56dbc4544a20cf33704cd616d4a3783c6507f39d2a87f78"
janko commented 1 year ago

Thanks for reporting and identifying the root cause, I will push a fix.