question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authorization mechanism not supported - "Please use AWS4-HMAC-SHA256"

See original GitHub issue

Hi there,

I’ve gotten to the step where I enter the Bucket name, path (blank), AWS access key ID, and AWS secret key into the dialog box on the google sheet. However, when I click save, the page hangs with the button showing “Saving”, and nothing occurs.

In the Chrome developer tools, I see the following error logged:

665147591-mae_html_user_bin_i18n_mae_html_user.js:42 

Uncaught Error: AWS Error - InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
 at S3Request:184 (S3:4) 38692e5d-4673-4c76-8733-0d4f8f1a0aa0
 at S3:146 (S3:4) a1279393-c26a-481c-9557-516ab8f2ac22
 at publish (Code:71) (Publish sheet to S3:20) 744867ab-df1e-44d5-aa49-4744c8b83522
 at updateConfig (Code:100) (Publish sheet to S3:20) 744867ab-df1e-44d5-aa49-4744c8b83522

I think I’ve followed your instructions correctly and set up everything I need to on the S3 side. Any idea on how to get around this error?

Thanks! Jeffrey

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gloomylumicommented, Oct 12, 2022

I ended up having to scrap the S3 binding originally used with this add-on. I was adapting the add-on for use Google Forms, rather than Sheets anyway. I used this repo instead and replaced the code under the ‘upload to s3’ comment on line 63 with a call to wrapper function that looked like this:

function s3PutObject(objectName, object) {
  const props = PropertiesService.getDocumentProperties().getProperties()

  const contentBlob = Utilities.newBlob(JSON.stringify(object), "application/json")
  contentBlob.setName(objectName)
  
  const service = 's3'
  const region = 'us-east-2'
  const action = 'PutObject'
  const params = {}
  const method = 'PUT'
  const payload = contentBlob.getDataAsString()
  const headers = {}
  const uri = '/' + objectName
  const options = {
    Bucket: props.bucketName
  }

  AWS.init(props.awsAccessKeyId, props.awsSecretKey)
  const response = AWS.request(service, region, action, params, method, payload, headers, uri, options)
  return response
}

In the context of this repo, the function call would look like:

s3PutObject([props.path, sheet.getId()].join('/'), cells)

Hope this helps someone else!

1reaction
TranBaVinhSoncommented, May 29, 2019

@Tetsunori-Mitarai I tried both your lib and patch-1 but still got same error:

AWS Error - InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Read more comments on GitHub >

github_iconTop Results From Across the Web

The authorization mechanism you have provided is not ...
I get an error AWS::S3::Errors::InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Read more >
The authorization mechanism you have provided is not ...
The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. S3 documentation describes how to use Sig v4 in ...
Read more >
On some S3 regions, pin() gets "The authorization mechanism ...
On some S3 regions, pin() gets "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256" #233.
Read more >
The authorization mechanism you have provided is ... - YouTube
s3 #awssdk InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Read more >
I got error like "The authorization mechanism you have ...
I got error like "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256." to avoid this add.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found