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.

SignatureDoesNotMatch when creating redirects with special characters

See original GitHub issue

Hello!

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:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
JoshuaWalshcommented, Dec 4, 2020

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.

1reaction
marcus13371337commented, Dec 4, 2020

Added encoding and it seems to work much better. However, that seems to me as an inconsistency compared to how gatsby’s createPage works. 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

Read more comments on GitHub >

github_iconTop 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 >

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