SignatureDoesNotMatch when creating redirects with special characters
See original GitHub issueHello!
I’m using your plugin to deploy our website to an S3 bucket. When I’ve implemented some redirects I get the following error:
SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
s3.js:700 Request.extractError
One example of the redirects I’m trying to create:
createRedirect({
fromPath: `/p/123456/`,
toPath: '/argument-f%C3%B6r-testning/p/123456/', //special character ö is encoded inside
isPermanent: true
})
Which in code looks like this:
await createPage({
path: node.fields.slug,
component: resolve(
__dirname,
`../../src/templates/myPage.tsx`
),
context: {
id: node.id,
},
});
await createRedirect({
fromPath: `/p/${node.productNumber}/`,
toPath: node.fields.slug,
isPermanent: true,
});
Note that I’m using the same slug as I’m doing when creating the page. What am I doing wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
SignatureDoesNotMatch: The request signature we calculated ...
while copying i am getting this error" SignatureDoesNotMatch: The request signature ... environment variable is bad at parsing special characters like "/".
Read more >SignatureDoesNotMatch Error while downloading file using X ...
SignatureDoesNotMatch Error while downloading file using X-Accel-Redirect · Do any of these URLs have unusual characters in them, such as non- ...
Read more >Troubleshooting AWS CLI errors - AWS Command Line Interface
If your AWS secret key includes certain special characters, such as - , + , / , or % , some operating system...
Read more >S3 — Boto3 Docs 1.26.35 documentation - AWS
The name of the bucket that contains the newly created object. ... Replacement must be made for object keys containing special characters (such...
Read more >Add support for encoded URLs (with spaces or other special ...
Add support for encoded URLs (with spaces or other special characters). Reviewed & tested by the community. Project: Redirect. Version:.
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 Free
Top 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

The AWS docs don’t mention any requirement to escape the value, but I guess it makes sense that it has to be URL safe. We should implement escaping. Still, I’m surprised that you get a SignatureDoesNotMatch error, that seems very strange.
Unfortunately aws-sdk doesn’t often provide useful error messages, and if we tried to read them and provide more helpful ones it would really just be guesswork.
Added encoding and it seems to work much better. However, that seems to me as an inconsistency compared to how gatsby’s
createPageworks. Also, a better error message would be really helpful as I’ve been struggling with this for a while.Love the plugin, super simple and works like a charm for our page! Keep up the good work