Closed NickKellett closed 3 years ago
I'm running into a similar issue, but the upload mostly completes before throwing the "Signature does not match" error. Oddly, it always fails at the same file. This is with the free version of WP2Static (version 6.6.6), and WP 5.2.3. It's likely this isn't a permissions issue, and the problem is in the signature/upload code. Edit: Just noticed plugin version 6.6.6 as reported by WP doesn't match any version in repository.
Hi @fnbauer - test button in version 6 likely giving a false positive there.
Please check your bucket's Public ACL settings in the AWS console and try unchecking/setting the 4 options to allow public ACL's to be changed.
This won't be necessary from next update of S3 plugin, but as the plugin's code explicitly sets public-read
ACL on the files, the S3 bucket permissions need to allow that.
Hi @leonstafford, I've already ensured all public ACL settings are unchecked but that didn't help. Unfortunately at the moment I cannot use this WP2Static pro module and am instead outputting WP2Static to a local folder that is actually a drive mounted to AWS S3 bucket using Cloudberry Drive (using the same IAM user). Hopefully the next update removes the signature issue, because apart from that WP2Static is working very well and it would be great to have the full S3 integration.
Hi @NickKellett thanks for you patience with this. Getting more professional S3/AWS usage is definitely a high priority with next release!
@leonstafford My issue turned out to be UTF-8 characters in filenames, which cause signature issues.
Bumping this as I'm stuck on the same issue: the URL containing percent escape sequences (I think it's UTF8-ized cyrillics) fails with "The request signature we calculated does not match the signature you provided. Check your key and signing method."
`Uploading /opt/bitnami/apps/wordpress/htdocs/wp-content/uploads/wp-static-html-output-1578533266/wp-content/plugins/js_composer/assets/lib/vc_waypoints/vc-waypoints.min.js to qver=6.0.3.pagespeed.jm.mIlLTaoaih.js in S3 PUT'ing file to qver=6.0.3.pagespeed.jm.mIlLTaoaih.jsvc-waypoints.min.js in S3 Using S3 Endpoint website.com.s3.eu-west-3.amazonaws.com S3 URL: http://website.com.s3.eu-west-3.amazonaws.com/qver=6.0.3.pagespeed.jm.mIlLTaoaih.jsvc-waypoints.min.js API response code: 403 API response body: <?xml version="1.0" encoding="UTF-8"?>
SignatureDoesNotMatch
@labsforge in your case, I can see the Apache mod_pagespeed is enabled, which messes with URLs. Can you please try disabling that, restarting webserver and trying again?
Holly crap! it works now! thank you very much @leonstafford!
@NickKellett - switched back to official AWS SDK for PHP and you shouldn't see these issues now. Please let me know if they persist in V7: https://github.com/WP2Static/wp2static/releases/tag/7.0-alpha-003
This should be all good for most cases in the wp2static-addon-s3 add-on now.
There are still issues which this and other projects face with certain characters, trying to deploy to S3. In those cases, you may be forced to use AWS' CLI tool, like aws sync . s3://somebucket
or such, that tends to transfer everything.
I've uploaded the paid AWS plugin to WPStatic (6.6.5, not the pro version of the plugin), entered IAM access key and secret, and tested authentication to the public bucket using the test button. S3 test works. I've independently tested using Cloudberry. However, whenever I try to export it always fails saying "The request signature we calculated does not match the signature you provided. Check your key and signing method. ". This seems to imply a permission error but I can't think what. The bucket currently has the following bucket policy:
SignatureDoesNotMatch
{ "Version": "2012-10-17", "Id": "Policy123etc", "Statement": [ { "Sid": "Stmt123etc", "Effect": "Allow", "Principal": "", "Action": [ "s3:ListBucket", "s3:GetObject" ], "Resource": [ "arn:aws:s3:::[the url]", "arn:aws:s3:::[the url]/" ] }, { "Sid": "Stmt123etc", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::[the iam user]" }, "Action": [ "s3:ListBucket", "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:PutBucket" ], "Resource": [ "arn:aws:s3:::[the url]", "arn:aws:s3:::[the url]/*" ] } ] }
The IAM user has full s3 access. I've deleted the access keys multiple times, handtyped as well as copy-pasted, no joy. Anything else I should be looking at? Thanks