New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy fails with error 'An error occurred: ServerlessDeploymentBucketPolicy - The bucket policy already exists on bucket...'' #6923
Comments
Roll back to version 1.55.1 and everything works fine as before. |
@webstruck thanks for report. I imagine it's caused because given policy was added manually, when service was deployed with pre 1.56.0 version (?) As now this policy is configured by the framework automatically, I believe to recover you should remove that policy and then redeploy with latest version of a framework, it'll add it back but now it'll be covered under CloudFormation stack |
@medikoo I had the same issue happened yesterday after upgrading my Serverless Framework. I deleted the entire CFN stack (ie removing the entire Serverless deployment) and then trying to deploy again, and it fails with the same problem. Then, I tried updating an already deployed Stack and it fails with the same stuff. I also found that this "resembles" but its not the same as #5919 but it directs you to the AWS Forum and the first reply has some context on what I mentioned above. My Stack Information
|
Just confirmed this is introduced by the latest version. |
@medikoo I did not create any policy manually. Just like @enriquemanuel downgrading to 1.55.1 worked as before. |
I have the same exact issue as @enriquemanuel. I am also deploying to GovCloud Same resolution too, downgraded serverless npm module to v1.55.1. Maybe a new issue should be created since we have different error that the parent. |
@enriquemanuel I believe it was fixed with #6934 It'll be published to npm this Wednesday (for a time being you may try to use version as in |
I just tested serverless version 1.58.0 that was published to npm today. Deploying to aws region |
Thanks @jmb12686 for confirmation. @webstruck can you confirm it's fixed for you(?) |
It was happening to me on v1.59.2. It worked going back to v1.55.1. These steps solved it for me:
thanks to @webstruck and @enriquemanuel |
Having the same issue with |
@chenrui333 can you share your configuration (or minimal with which I can expose the issue) ? |
Having this issue with |
Yap. Having same issue with |
We'll be happy to fix it so it works with 1.60+, still we need a reproducible test case. |
I am having the same issue: "The bucket policy already exists on bucket" @medikoo maybe I can help a little... My company uses a product that has "guardrails" around AWS resources. For instance, when an S3 bucket is created in our AWS account this product automatically puts a bucket policy on it. This product does it (nearly) instantaneously. I have watched it in real-time, while CF is doing its magic and before it completes, our product puts a bucket policy on the serverless bucket. When the serverless CF template then goes to put a policy on that bucket there is a "collision" (for lack of a better word). Since our guardrail product already put a bucket policy on the serverless bucket I get the "The bucket policy already exists on bucket " error message. |
@robpi great thanks for that clarification, it explains a lot. I guess for this case, the best solution is to introduce an option through which user can opt-out from bucket policy being automatically added by the framework PR's welcome! |
I work in a corporate setting where there are automated bucket policies applied programmatically. It seems as though |
Still happening in 1.67.3. Is everyone having this problem using the SecureTransport option?
|
I would suggest marking as a defect as the only fix is rolling back to 1.55.1 |
I've observed the same issue within our organization which uses Turbot for policy management. Rolling back to 1.55.1 resolved the issue. |
I also saw the same thing with 1.7*. I rolled back to 1.55.1 and it fixed my issue. |
In my case I was forced to use the latest version since i need to integrate the cognito to alb through framework. Therefore first I've downgraded the version to 1.55.1 and deployed the stack and after that go that specific bucket (in my case ServerlessDeploymentBucket) and deleted the bucket policy. Then updated the current version and deployed again. |
Thanks, I had the same issue with 1.59.0. Rolling back to 1.55.1 fixed it. |
having this problem with 2.4 ... rolling back to 1.55.1 fixed it ... concerned about rolling back my versions so far. Any ideas when this might be addressed? |
@continuata we're open for PR that introduces needed option (as discussed here: #6923 (comment)) |
My workaround was to set the deploymentBucket under the provider section:
After that, it complained about not finding the bucket, so I used Serverless Deployment Bucket This worked with the latest version of the framework. |
Hello 👋 In recent release Example use:
Please, let us know if the above solution does not solve the problem. 🙇 |
This worked for me, I would like to know why I haven't have an issue with other deployments without this configuration |
Bug Report
Deploy fails with error 'An error occurred: ServerlessDeploymentBucketPolicy - The bucket policy already exists on bucket...''
Description
Ran serverless deploy for a recently removed service.
The deployment failed with error 'An error occurred: ServerlessDeploymentBucketPolicy - The bucket policy already exists on bucket...''
The service should deploy.
serverless.yml
file?SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)The text was updated successfully, but these errors were encountered: