Skip to content

Excon::Error::Forbidden: Expected(200) <=> Actual(403 Forbidden)  #379

@Haseeb717

Description

@Haseeb717

When I try to async assets with s3 using command AssetSync.sync or rake assets:precompile

This throw an error

Excon::Error::Forbidden: Expected(200) <=> Actual(403 Forbidden)
excon.error.response

:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

S3 bucket policy is

{
"Id": "xxx",
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "xxx",
        "Action": [
            "s3:ListBucket"
        ],
        "Effect": "Allow",
        "Resource": "arn:aws:s3:::static-assets",
        "Principal": "*"
    },
    {
        "Sid": "xxx",
        "Action": [
            "s3:GetObject",
            "s3:GetObjectAcl",
            "s3:PutObject",
            "s3:PutObjectAcl"
        ],
        "Effect": "Allow",
        "Resource": "arn:aws:s3:::static-assets/*",
        "Principal": "*"
    }
]
}

How to fix this issue?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions