-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
ec2: Prevent "InvalidNetworkInterfaceID.NotFound" errors in deleteLingeringLambdaENIs #6037
Conversation
…geringLambdaENIs Previously: ``` --- FAIL: TestAccAWSLambdaFunction_VPC_withInvocation (70.96s) testing.go:588: Error destroying resource! WARNING: Dangling resources may exist. The full state and error is shown below. Error: Error applying: 1 error occurred: * aws_subnet.subnet_for_lambda (destroy): 1 error occurred: * aws_subnet.subnet_for_lambda: Failed to delete Lambda ENIs: Error waiting for ENI (eni-00233276ead620ddf) to become detached: InvalidNetworkInterfaceID.NotFound: The networkInterface ID 'eni-00233276ead620ddf' does not exist ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'm surprised I didn't find this in testing.
@@ -1464,8 +1477,11 @@ func networkInterfaceAttachedRefreshFunc(conn *ec2.EC2, id string) resource.Stat | |||
} | |||
describeResp, err := conn.DescribeNetworkInterfaces(describe_network_interfaces_request) | |||
|
|||
if isAWSErr(err, "InvalidNetworkInterfaceID.NotFound", "") { | |||
return 42, "false", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is 42
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jen20 something I don't necessarily agree with, but an existing convention that is a workaround for return nil, X, nil
causing WaitForState()
to treat the refresh as a missing resource and automatically retry without exiting the WaitForState()
since Target
has a value: https://github.com/hashicorp/terraform/blob/master/helper/resource/state.go#L115-L137
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, the second part was what I assumed but thought I would clarify! Is it worth introducing a constant here to make the intent clearer?
This has been released in version 1.39.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "aws" {
version = "~> 1.39.0"
}
# ... other configuration ... |
Hi, using the 2.12.0 AWS provider version we are still getting the following error: aws_security_group.health_check_agent_sg: Failed to delete Lambda ENIs: InvalidAttachmentID.NotFound: The interface attachment 'eni-attach-0eb0eb99372a3d930' does not exist Is it possible that there was a regression regarding this issue? |
Hi @Kompi , I'm seeing the same issue. Looking at the code it seems that |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Reference: #4884
Changes proposed in this pull request:
InvalidNetworkInterfaceID.NotFound
errors when deleting lingering network interfacesInvalidNetworkInterfaceID.NotFound
errors when deleting lingering network interfacesPreviously:
Output from acceptance testing: