Object Storage upload problem

I am trying to upload file to object storage using https://github.com/aws/aws-sdk-ruby. My code looks like this:

client = Aws::S3::Client.new(
  endpoint: "https://us-east-1.linodeobjects.com",
  access_key_id: "...",
  secret_access_key: "...",
  region: "us-east-1",

  bucket: "...",
  key: "test-object",
  body: 'Hello World!'

But I am getting "Aws::S3::Errors::SignatureDoesNotMatch".

Not quite sure what's going on. I can access bucket & upload via s3cmd.

Any help appreciated

9 Replies

One of our Object Storage devs saw this post and wanted to pass along that you'll want to remove the region from their stanza, or set it to “default” if that doesn’t work.

Thanks for the help.

Unfortunately, it didn't help. If I set to region: "default", I am getting same error Aws::S3::Errors::SignatureDoesNotMatch.

If I remove it completely, library throws:

missing region; use :region option or export region name to ENV['AWS_REGION'] (Aws::Errors::MissingRegionError)

spacesquirrel: Try removing https from the beginning of the endpoint, leaving it as us-east-1.linodeobjects.com.

Can you check if this code runs properly when AWS S3 bucket is configured? You can create a Free Tier user with AWS if needed.

My concern is that it comes from the V2/V4 S3 Signature differences.
In that case, I would search for the previous version of this project (that worked with V2 signature), and use it when running with Linode Object storage, for better compatibility.

After going over each Header value I finally found the issue! Looks like Linode Object Storage doesn't support expect: 100-continue header. This was causing HTTP 403. After I removed it, everything works fine. Here is how final code looks like (hope it saves time someone looking into this in future):

client = Aws::S3::Client.new(
  endpoint: "https://us-east-1.linodeobjects.com",
  access_key_id: "...",
  secret_access_key: "...",
  region: "default",
  http_continue_timeout: 0 # disable 'expect: 100-continue' header

I guess now the question for Object Storage team is: will you add support for this?

I was struggling to configure a Rails 6 app with Active Storage to operate with Linode S3 until I've found your post @spacesquirrel.

Thank you, I was really going crazy!!

Here are my working settings for storage.yml:

  service: S3
  endpoint: https://us-east-1.linodeobjects.com
  access_key_id: XXX
  secret_access_key: XXX
  region: default
  bucket: XXX
  http_continue_timeout: 0

Anyway.. how the named header works and what are we missing if it is not implemented?

Solved the same problem for me - would be good if Linode object storage had some 'real' code examples in the docs which would help flesh this out, even if it's only a generic language option (not necessarily Ruby).

Very happy that multipart uploads work too from SDK…next to check if they work in Uppy's solution too…then i make the switch.

Thanks for the post @spacesquirrel and @pablo_vizcay. I was also struggling and thinking of using a different provider (since I could not get it working).
Agree with @davidlowry regarding some "real" examples

I was also having issues using Linode Object Storage as my Active Storage location.

I made two changes.

1) I copied my full bucket url as the endpoint like https://xxxbucketnamexxx.ap-south-1.linodeobjects.com. I removed the xxxbucketname and made it https://ap-south-1.linodeobjects.com.
2) I added http_continue_timeout: 0

Not sure if I needed the http continue timeout part but it seems to have popped up in a few of these results.

Also, it might be worth noting that the documentation on cors for linode object storage has been hard to find. I originally setup using Digital Ocean Spaces and I migrated my cors.xml file from that codebase… seems to have worked ok with linode…


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct