ken
ken

Reputation: 8993

ResourceNotFoundException with full deploy to prod

I have a fully developed set of functions which work fine in the "dev" stage and it's now time for me deploy to production. Unfortunately every time I try to deploy it goes for a long time but after printing "Checking Stack update progress" it fails with a 404 error:

An error occurred: SentinelLambdaFunction - Function not found: arn:aws:lambda:us-east-1:837955377040:function:xyz-services-prod-sentinel (Service: AWSLambda; Status Code: 404; Error Code: ResourceNotFoundException; Request ID: 38f86b7a-99cd-11e8-af06-fffd92e40dc5).

This error is non-sensical to me as this function does exist and executing precisely the same full deployment to "dev" results in no error. Note that in both environment/stage, we are deploying 10 functions with a fully deployment.

I tried removing the function which was being complained about first, with the hope that I could re-include it on a second deployment but then it simply complained about a different function not existing.

I also thought maybe the "--force" parameter might push this deployment into place but it has had no impact on the error I get.

The cycle time for each attempt is very long so I'd be very grateful if anyone could help to point me in the right direction on this.


Below is a screenshot of the output when run in "verbose" mode:

enter image description here

In attempt to get around the error I thought maybe I'd have a better chance if I went into CloudFormation and explicitly deleted the template for prod. I attempted to do this from the GUI and got the following:

enter image description here

This actually has further convinced me that this removal is important but I'm not sure what to do next.

Upvotes: 2

Views: 6844

Answers (2)

pcv
pcv

Reputation: 2181

For me, the solution was:

serverless remove

and then try deploying again.

Upvotes: 3

ken
ken

Reputation: 8993

So the solution to this problem was to ensure that all previous traces of the CloudFront stack was removed. In my case I had manually taken out a few functions from Lambda and the 401 errors I was getting were likely occuring in the removal attempts rather than my assumption that it was related to adding these functions.

Bear in mind you may find yourself -- like I did -- where the first attempt to delete fails. In this case try again and make sure to check off any checkboxes exposed by UI that indicate what had caused the issues the prior attempt.

Once I'd done that I was able to deploy as per normal from the serverless framework.

Upvotes: 0

Related Questions