serverless: Serverless Error - Function not found...
As of today (1/2/2017), when I try serverless deploy I get this error.
Serverless Error ---------------------------------------
An error occurred while provisioning your stack: XXXLambdaVersionPUKt3p41YmjAJBYRa6HS1i4GOUTJQpzTYRXOhP8524
- Function not found: arn:aws:lambda:us-east-1:11xxxxx32:function:xxx-xxx-xxxxx.
Yesterday I was able to deploy my service without failure.
I’m running on a Mac using serverless version 1.4. I have about 4 functions in my template. One is a lambda proxy, 2 sns topic handlers, and 1 function without an event attached to it.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 15
- Comments: 52 (15 by maintainers)
I had the same problem after killing a running
sls deploy.@mrosett’s workaround worked for me as well:
sls remove && sls deploy.I’m seeing this again after manually deleting a function through the AWS console and then redeploying it. I ended up fixing it by running sls remove.
Hey i’ve found a way to “fix” it manually.
This bug happen when you just delete the lambda function from AWS panel, then when you try to deploy it again the errors appers.
When you delete the lambda function you should delete the API Gateway path too and the CloudFormation Stack. So this way I can deploy the function again via console.
I have noticed I get the error when trying to deploy a lambda function that I have recently deleted. If i change the name of the function using --stage then it works, as long as it’s not something I have deleted recently 😃
Rolling back to version 1.2 did fix the issue for me. So there must have been a regression somewhere between then and now.
I ran into a similar issue trying to redploy and kept getting function not found… I had to remove the CloudFormation stack manually after removing the S3 bucket. Not sure if it’s the same issue as others.
5 months later, and this is still happening 😦
@mrosett’s workaround was successful: Run
serverless remove && serverless deploySeems to have resolved itself
A quick update…
We’re also facing this right now in our integration tests.
Edit: Not sure if it’s maybe a kind of race condition and we need to add a
DependsOnsomewhere here: https://github.com/serverless/serverless/blob/809a28a55d1feeb0aee141235937478084fde38a/lib/plugins/aws/deploy/compile/functions/index.js#L236-L248 ?It did seem like it was mostly an AWS issue. But even so, why would 1.2 work and 1.4 not?
Was having this issue yesterday with 1.4 and 1.3 along with lambda sync issues (even removing a 1.2 stack sometimes left lambda functions deployed, couldn’t delete them via the aws console or cli) but no longer.
Today both issues seem resolved - I’ve deployed and removed several different stacks with no problem in both AWS accounts that were erroring out yesterday. I wonder if the two were related.
Also, you can use different region. us-west-2 works fine with sls v1.4
I got around it by manually creating the missing lambda and then doing the deploy, pain but it worked.
I think it is something to do with AWS itself. It is better to ask AWS Lambda team to check their internal log when it will happen again.
This error is really non-deterministic. Just re-run our integration test suite today (which failed yesterday) and it succeeded w/o having the
Function not founderror again…We’re on
us-east-1.I have been trying to redeploy from github but since I am deploying from codebuild I am encountering unrelated error due to some newer changes in the repository (due to npm scripts). Trying to figure that one out before opening an issue