-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
AWS API Gateway: Error when renaming path variable #3785
Comments
I have the same issue when removing variable from path. Old yml config:
Updated yml:
Error: |
It seems that CF first tries to add the new resource, and then to remove the old resource. This leads to an intermediate state where both resources will exist, which is of course not possible, because they interfere with each other. Just some unordered thoughts to get a discussion running:
|
Workaround for now: |
@pettyalex |
I'm using the workaround suggested by @pettyalex but unfortunately makes me hit another issue where cloudformation stalls in the state UPDATE_COMPLETE_CLEANUP_IN_PROGRESS where it is taking a long time to delete lambdas inside VPCs: https://forum.serverless.com/t/very-long-delay-when-doing-sls-remove-of-lambda-in-a-vpc/2535 |
Thing is, deleting the API and then creating it again changes the URL endpoint. This is pretty destructive, is there a less destructive solution to this? |
Im new to serverless framework, but found workaround that worked for me and didnt result in a change to the endpoint hostname. It might still cause a short outage for your service because it seems the resource paths are not responding correctly, but that might be acceptable considering you are changing the paths. Its better than deleting the entire api endpoint tho. This workaround changes the path from
It seems there is something very wrong with the CloudFormation updates to |
So the accepted solution here requires you to take down the routes. Not really acceptable if you are just changing marginal things (e.g. making path parameter required) and the route are live in production and used heavily. Bleeding edge is bleeding edge.... |
This can be a problem for when a route has been deleted, and a new route with a variable in the same part of the path is now being added. It looks to me that this has something to do with the way stage works, and the workaround is still to destroy the entire API gateway and rebuild. |
Any news on this issue? We have trouble as well and undeploying the entire api/path is not really acceptable since it runs live in production. update: Nevermind, it looks like its not a problem with Serverless, its in cloudformation. When you change your path in ApiGateway it creates the new resources and then directly starts the deployment. |
Is any solution available? |
I agree, this should have way higher priority and should have been fixed a long time ago. This issue is close to being 2.5 years old and this bug can be a real showstopper for some applications. |
@laurensV We stopped using path parameter entirely and route and validate in application logic with a single resolver route (using lambda-serverless-api on npm, disclaimer I'm the author). There are still problems with rouge routes in stage as @MacMcIrish described, but if you do a drift detection in cf after a deploy the next deploy seems to be removing the stage path. Not ideal but at least we don't need to remove and redeploy anymore. |
I experienced this error, but the cause of my problem was actually legitimate hence why commenting out the yaml, deploy, uncomment and redeploy wasn't working. I had two functions that I was trying to deploy with the following paths.
This wasn't working given that
|
We're experiencing the same. |
Experiencing this issue. 5 years now for this issue. What can we do to encourage a resolution? |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yup, happened again today when I changed the httpApi.path from Had to force deploy without either to work around it. Good job wasn't our live stack... |
Happening to me today... Not sure I understand why 2 different route method ( Had to use the following names, which is far from ideal
|
Happened to me today as well. |
And today :) |
any updates on this? |
Multi billion dollar company right there |
And today too 😄 |
still no luck? |
6 year old bug |
This bug still remains. How can I help fix it? |
Just happened to me now |
Just happened to me today too |
This bug still out there. How can we caught him? |
Same issue here 😢 |
That's how CloudFormation works, cool down, cannot be solved in serverless.
AWS CDK uses CloudFormation underneath, i.e. the behavior will be the same. |
Still having the same problem today, any updates on this? Maybe some news from AWS? Since from what I understand this is an AWS CloudFormation issue. |
Same problem today |
Yeah, faced this error some minutes ago, like @Ehbraheem |
@Ehbraheem @WyllianNeo please read #3785 (comment) |
This issue should be closed and locked as unfixable
--
†øღ
Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge
…On 27 February 2024 17:11:54 GMT, Constantine Peresypkin ***@***.***> wrote:
@Ehbraheem @WyllianNeo please read #3785 (comment)
--
Reply to this email directly or view it on GitHub:
#3785 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Also happened to me, please fix 🙏 |
Facing the same error, please have a fix serverless!! |
This issue should be closed and locked as unfixable as it's a CloudFormation problem. Reporters should be moaning at AWS |
This is a Bug Report
Description
Tried to rename a path variable and got the error.
Deployed a service with the following yml config:
Then changed it to
Then tried to redeploy the service to update the variable name and got the error.
For bug reports:
An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar. A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed.
Expected the service to deploy the new route over the old one. Renaming the path variable from
pathvar
topathVar
.An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar - A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed
Similar or dependent issues:
Additional Data
An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar. A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed.
If more information is needed, just let me know.
The text was updated successfully, but these errors were encountered: