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

Auth header error when using AWS credential with HTTP module #12216

Open
leesilverman opened this issue Dec 13, 2024 · 1 comment
Open

Auth header error when using AWS credential with HTTP module #12216

leesilverman opened this issue Dec 13, 2024 · 1 comment
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@leesilverman
Copy link

Bug Description

I have a bucket named wrd-media-archive in region us-east-1. I'm making a listObjectsV2 call to https://wrd-media-archive.s3.amazonaws.com/ using the HTTP module. The credential I'm using has the region specified as us-east-1. However, I get this error when I make the http request. I'm guessing that N8N is using the region S3 in the "cannonical headers" portion of the auth header calculation instead of using the value from the credential.

Error code: 400
Full message: 400 - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 's3' is wrong; expecting 'us-east-1'</Message><Region>us-east-1</Region><RequestId>YRJ175KYNDK8S1EE</RequestId><HostId>SLEa1+LB2woZ15VTf9ybhi56J5rE9k42qX+YHlDSBRJOrpo199l75NEMesp/dTe4nRGzS+ckLpA=</HostId></Error>"
Request: { "headers": { "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7", "Host": "wrd-media-archive.s3.amazonaws.com", "X-Amz-Content-Sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "X-Amz-Date": "20241213T160555Z", "Authorization": "**hidden**" }, "method": "GET", "uri": "https://wrd-media-archive.s3.amazonaws.com/", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "qs": { "list-type": "2", "max-keys": "10", "prefix": "instagram" }, "encoding": null, "json": false, "useStream": true, "url": "https://wrd-media-archive.s3.amazonaws.com/" }

aws_credential
http_request_config
s3_error

To Reproduce

  1. Create an AWS credential.
  2. Confirm that it works by using an AWS S3 built in module to upload a file
  3. Try to use the HTTP module with the same credential to list the folder where you put the file

Expected behavior

The request authorization header should be calculated correctly

Operating System

Amazon Linux 2003

n8n Version

1.70.3

Node.js Version

v22.12.0

Database

PostgreSQL

Execution mode

main (default)

@Joffcom
Copy link
Member

Joffcom commented Dec 13, 2024

Hey @leesilverman,

We have created an internal ticket to look into this which we will be tracking as "N8N-7962"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

No branches or pull requests

2 participants