Lambda becomes "idle" after 2nd deployment, then it can't be updated with "Internal Error".

0

The 1st deployment (initial deployment to a new account via CDK) worked, the APIGateway can invoke it. Once I made the 2nd deployment (to update the Lambda env varialbes via CDK), the deployment got success, but after a few minutes, the Lambda became to "idle". The notification bar (on top of the Lambda console page)shows "The function xxxx is idle. To reactivate your function, choose Restore.".
The "Restore" button can trigger the restoring but can't actually restore it. Restoring may run a few minutes, the Lambda will be still showing the same bar again. (Edit: post the notification bar snapshot) Enter image description here

Now, if I update the Lambda, like enable "Lambda Insights enhanced monitoring" or update configuration via console, the update operation will fail with InternalError. Tried several times, same errors.

        "State": "Inactive",
        "StateReason": "The function is currently idle.",
        "StateReasonCode": "Idle",
        "LastUpdateStatus": "Failed",
        "LastUpdateStatusReason": "An internal error occurred. Please try again.",
        "LastUpdateStatusReasonCode": "InternalError",

The Lambda is created into a VPC with ipv6 enable, and is using EIGW.

I reproduced above steps in two new accounts. Wondering if anyone got the similar issue? Thank you.

  • Where are you seeing the message about the function being idle? I've not seen that before so looking for guidance to answer the question.

  • it's a sticky notification bar on the top of the Lambda function console. updated the question and attached the snapshot of the bar.

c3qo
asked 2 months ago66 views
1 Answer
2
Accepted Answer

When you change the configuration, that includes environment variables, this publishes a new version of the Lambda. The restore option given in the console is to restore a previous version. When you restore a previous version, it creates a new ARN for this new restored version because it is treated as a new version publish event.

When you publish a lambda, it becomes immutable and is a snapshot of the function code and configuration that can't be changed (except for a few configuration items relevant to a function version, such as provisioned concurrency). That's why you are getting that error.

AWS
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
  • Thank you for the answer.

    I published the version manually (from $LATEST to version "1") and the notification bar disappeared. Then: 1) deployed (via CDK) some changes to it and also 2) updated the configuration manually via console, the notification bar didn't come out any more.

    I'm very confused about the Lambda behavior. Why the "restore" notification showed to the configuration change on the initial function but not showed any more to it with "published version"?

  • Also I'd like to comment the "InternalError" got in the update function operation. Is this error not handled correctly in one of the Lambda Services? If updating configuration to an immutable snapshot is wrong, it'd be great to throw the 4xx error with detailed description explicitly.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions