aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: SAM pipeline bootstrap fails with "Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting" when using AWS Quick Start Pipeline Templates.

Open sreshtk opened this issue 3 years ago • 6 comments

Description:

SAM pipeline bootstrap fails with "Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting" when using AWS Quick Start Pipeline Templates.

The error is related to the recent S3 service update per https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-faq.html.

Steps to reproduce:

$ sam pipeline init --bootstrap

sam pipeline init generates a pipeline configuration file that your CI/CD system can use to deploy serverless applications using AWS SAM. We will guide you through the process to bootstrap resources for each stage, then walk through the details necessary for creating the pipeline config file.

Please ensure you are in the root folder of your SAM application before you begin.

Select a pipeline template to get started: 1 - AWS Quick Start Pipeline Templates 2 - Custom Pipeline Template Location Choice: 1

Cloning from https://github.com/aws/aws-sam-cli-pipeline-init-templates.git (process may take a moment) Select CI/CD system 1 - Jenkins 2 - GitLab CI/CD 3 - GitHub Actions 4 - Bitbucket Pipelines 5 - AWS CodePipeline Choice: 2 .. Setting everything default after this. ..

Observed result:

A CloudFormation stack creation is initiated with name "aws-sam-cli-managed-dev-pipeline-resources" and this fails with error - "Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting"

Expected result:

Bootstrap completes by creating the SAM artifact logging S3 bucket excluding AccessControl configuration.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Linux
  2. sam --version: SAM CLI, version 1.81.0
  3. AWS region: us-east-1
# Paste the output of `sam --info` here

Add --debug flag to command you are running

sreshtk avatar Apr 25 '23 23:04 sreshtk

@xazhao : https://github.com/aws/aws-sam-cli/pull/5078 is this related?

sriram-mv avatar Apr 26 '23 01:04 sriram-mv

I am very certain it is the same issue. I have been having this issue for 48 hours and from the information I got from the AWS support I am very lucky because this change has been rolling out since April and I did a workshop about sam pipelines (which luckily worked fine) 4 days ago.

cmoutafidis avatar Apr 26 '23 07:04 cmoutafidis

@sriram-mv Yes https://github.com/aws/aws-sam-cli/pull/5078 is the fix to this bug.

xazhao avatar Apr 26 '23 16:04 xazhao

Am also experiencing this issue currently.. when should I expect a new release?

Kigbu avatar May 11 '23 02:05 Kigbu

Patch is released in v1.83.0. Closing

github-actions[bot] avatar May 11 '23 19:05 github-actions[bot]

I can confirm that this issue is fixed on v1.83.0. Thank you to everyone that worked on this issue!

cmoutafidis avatar May 11 '23 21:05 cmoutafidis