No internet connection
  1. Home
  2. Support

Exporting to S3 and creating directories

By Will Warner @samsaradog2019-03-07 22:06:30.235Z

I have a bucket set up in s3, wordpresstest.hireology.com and the export is failing when trying to write to this bucket:

PUT'ing file to archives/1/feed/index.html in S3
Using S3 Endpoint wordpresstest.hireology.com.s3.us-west-2.amazonaws.com
S3 URL: http://wordpresstest.hireology.com.s3.us-west-2.amazonaws.com/archives/1/feed/index.html
API response code: 403
API response body: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>8E27591E21BBB654</RequestId><HostId>K70EC6cmQQLPb8OqJxcE5uVI7FYW7v4bJbWyFLENxLh1nCU6CepjW/cTHqqsSO1WGX+cAzy0PWw=</HostId></Error>
BAD RESPONSE STATUS FROM API (403)

When I go to http://wordpresstest.hireology.com.s3.us-west-2.amazonaws.com/archives I get:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>archives</Key>
<RequestId>A31BD0742A2F09E3</RequestId>
<HostId>
uLeQRTIGoeCGEV6KUYL3y123NHUa8VuBcSgcquKwUZ8X1yoDQ1XWcRja4+Hw+2qKqw7VSKZV5EQ=
</HostId>
</Error>

Do I need to create the directories in the bucket before I try the export? Thanks for your help.

Solved in post #3, click to view
  • 1 replies
  1. S
    Will Warner @samsaradog2019-03-12 21:03:47.108Z

    We got it working, but it's ugly. We had to set these permissions on our S3 bucket:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "s3:ListBucket",
                    "s3:PutObject*",
                    "s3:GetObject",
                    "s3:DeleteObject",
                    "s3:PutBucket*"
                ],
                "Resource": "arn:aws:s3:::wordpresstest.hireology.com/*"
            }
        ]
    }
    

    The splats for PutObject* and PutBucket* are perplexing. I can't see why the plugin would need PutBucketCORS or PutBucketRequestPayment. I'll set up a separate post asking the devs which permissions they need for this. That might even end up in their documentation somewhere.

    ReplySolution
    1. Progress