awslabs / aws-for-wordpress

Amazon Polly Plugin for WordPress, which enables functionality for converting any text content on the wordpress site into audio.
https://wordpress.org/plugins/amazon-polly/
GNU General Public License v3.0
80 stars 36 forks source link

Polly player not working #49

Open auraengh opened 3 years ago

auraengh commented 3 years ago

Hi,

We installed the AWS Wp plugin, and followed the instructions: created IAM user, activated on the website and then created a Could Front distribution for Amazon Polly, but the text doesn't appear to get to Polly (my bucket is empty) and the player is inactive. Would you please be able to help? Not sure where to start looking ... any special settings for the bucket? e.g. https://www.opi.net/news/region/001-north-america/takkt-implements-divisional-restructure/

image

Many thanks, Aurora Enghis

cowboydaks commented 2 years ago

I too am having this issue. Polly widget displays 0:00 on my post and no objects are in the S3 bucket. See (https://www.davidsmithjd.com/2021/08/20/hello-world/)

I would love to use this on my website and the the company website I manage. Thank you for your help and development on this!

cowboydaks commented 2 years ago

Ok, I have an update. I utilized my business support plan on AWS and had a phenomenal cloud support specialist debug the issue. Amazon Polly now works! I don't know if this is the same for you all, but I will share the info:

Wordpress Debug log showed following error and portions of transcript, with redactions:

[24-Dec-2021 03:23:40 UTC] PHP Fatal error: Uncaught exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "PutObject" on REDACTED BUCKET "; AWS HTTP error: Client error: PUT REDACTED BUCKET resulted in a403 Forbidden` response: <?xml version="1.0" encoding="UTF-8"?>

AccessDeniedAccess DeniedREDACTED (truncated...) AccessDenied (client): Access Denied - AccessDeniedAccess DeniedREDACTEDREDACTED' GuzzleHttp\Exception\ClientException: Client error: `PUT REDACTED BUCKET resulted in a `403 Forbid in REDACTED WORDPRESS DIRECTORY LOCATION 195 === Upon further analysis, we could see that the plugin was trying to write the objects to S3 using the PutObject call with ‘public-read’ ACL[2]: === $result = $this->s3_client->putObject( array( ‘ACL’ => ‘public-read’, ‘Bucket’ => $s3BucketName, ‘Key’ => $key, ‘SourceFile’ => $file_temp_full_name, ) ); ... In order to reproduce the issue, we also tried to write a file to the S3 bucket from AWS CLI using the credentials for the user using the below command: === $ touch file.txt $ aws s3 cp file.txt s3://REDACTED --acl ‘public-read’ === We could observe that this call was also failing with the same error as mentioned in above shared log snippets. In order to fix this, I requested you to disable the 'Block Public Access' settings for your account as well the bucket. Further to this, the above command was able to write the file to the target bucket. Upon testing the WordPress site, we could also see the audio files being written to the correct destination as well. ... Please note, the plugin code dictates the ACL settings for writing the audio files to S3 and therefore ‘public-read’ ACL will have be allowed for the bucket from IAM user ‘AWSForWordPressPlugin’. I don't know if any changes will be made to how the Plugin makes calls to AWS S3, but if not, this resolved the issue for me.