Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

aws-s3-deploy fails - Feels like not deleting all S3 files before upload.

Jason Redwood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2023

This is an intermittant issue, but it does look like it occurs more often when redeploying (uploading from bitbucket pipeline to S3) an older build over the top of a newer build.

 

It looks like the files are not fully or properly being deleted in the S3 bucket before the upload occurs and I often find the files in the s3 bucket are not accurate with the build

The aws-s3-deploy:1.1.0 config I am using is

```

- pipe: atlassian/aws-s3-deploy:1.1.0
    variables:
        AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
        AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
        AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
        S3_BUCKET: $AWS_PROD_S3_BUCKET
        LOCAL_PATH: "output"
        DELETE_FLAG: "true"

```

 

As mention, the issues dont seem to occur when incrementally deploying later builds, or at least much much less often, the issue seems to occur when deploying a later build, then redeploying an earlier build later on.

When the issue occurs, to resolve it, I login to AWS and manually delete all the files, then do the deployment and everything works as expected.

Is anyone else experiencing this issue or does someone know what I might be doing wrong?

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 17, 2023

@Jason Redwood hi . Thanks for your question. This pipe based on aws s3 sync where DELETE_FLAG is option:
`
--delete (boolean) Files that exist in the destination but not in the source are deleted during sync`. 
To test your case you could try directly call `aws s3 sync` command inside pipelines script, and investigate the behaviour.

Regards, Igor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events