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
API Key length causing deployment to fail #7628
Comments
@revgum thanks for report
I just issued such test deployment and output was:
Are you relying on latest version of a Framework? |
I was using the latest, however, my actual apiKeys |
What exactly ends in generated CloudFormation template? |
It looks legit;
...
|
This error seems related to some other issue with your configuration, and that's why the API key error doesn't surface for you. It's hard for me to state what can be wrong not know your full configuration, and not having full |
I think the underlying problem is that there are resources being created that depend on the API key and they fail being created at the same time the API key fails to be created.. the API key length error gets swallowed up by these circumstances and never surfaces in a meaningful way. The stack rollback happens, and you are left not knowing why it really failed. When I deploy an updated lambda affecting the API Gateway along with the value of the API key to under 20 characters I get the errors I've left in the issue ticket already. The only things you don't see are the lambdas each having CREATE_FAILED, then all of the changes being deleted, the stack rolling back and the bad error indicating the stack doesn't exist even though it does. I hope this helps! |
I wanted to add that I tried a few scenarios;
|
@revgum thanks for clarification. This looks very familiar to: #7635 - it appears that it's the source of an issue that hides real error from you |
@revgum Could you provide list of events for that failed stack? (at least the events statuses without reosuces ids). Serverless checks for the stack progress/success/failure through the events provided by |
This is 5th time in last year, I'm searching whole Github. how to explicitly set value of API key on this Serverless lambda thing😰 |
@arash-bizcover try asking at https://forum.serverless.com/ or https://www.serverless.com/slack |
Bug Report
Description
When a specified API Key has fewer than 20 characters, deployment fails without any evidence as to why. I used to AWS Console to try to create the key manually and saw the key length requirement show up there. The error provided on the AWS Console is
API Key value should be at least 20 characters
.What did you do?
Set an API Key value having fewer than 20 characters in configuration.
What happened?
CloudFormation repeatedly failed to create
ApiGatewayApiKey1
and rolled back deployment with no error details.What should've happened?
Serverless should have prevented deployment by validating the api key length.
What's the content of your
serverless.yml
file?SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)Template validation passes, typical resource creation happens and eventually:
CloudFormation - CREATE_FAILED - AWS::ApiGateway::ApiKey - ApiGatewayApiKey1
followed by all of the resource deletes.Similar or dependent issues:
The text was updated successfully, but these errors were encountered: