Skip to content
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

DXE-2615 FullIPv6 panics for invalid input #410

Closed
zliang-akamai opened this issue May 5, 2023 · 2 comments
Closed

DXE-2615 FullIPv6 panics for invalid input #410

zliang-akamai opened this issue May 5, 2023 · 2 comments

Comments

@zliang-akamai
Copy link

zliang-akamai commented May 5, 2023

Terraform Version

Multiple versions

Affected Resource(s)

Please list the resources as a list, for example:

  • resource_akamai_dns_record

Debug Output

2023-05-04T15:52:22.219-0400 [DEBUG] plugin.terraform-provider-akamai_v3.3.0: 2023/05/04 03:52:22 [DEBUG] diffQuotedDNSRecord Suppress. recodtype: A: [Akamai DNS]=dnsRecordTargetSuppress
2023-05-04T15:52:22.219-0400 [DEBUG] plugin.terraform-provider-akamai_v3.3.0: 2023/05/04 03:52:22 [DEBUG] diffQuotedDNSRecord Suppress. oldTargetList: [[]]: [Akamai DNS]=dnsRecordTargetSuppress
2023-05-04T15:52:22.219-0400 [DEBUG] plugin.terraform-provider-akamai_v3.3.0: 2023/05/04 03:52:22 [DEBUG] diffQuotedDNSRecord Suppress. newTargetList: [[]]: [Akamai DNS]=dnsRecordTargetSuppress
2023-05-04T15:52:22.219-0400 [DEBUG] plugin.terraform-provider-akamai_v3.3.0: 2023/05/04 03:52:22 [DEBUG] diffQuotedDNSRecord Suppress. old: [0]: [Akamai DNS]=dnsRecordTargetSuppress
2023-05-04T15:52:22.219-0400 [DEBUG] plugin.terraform-provider-akamai_v3.3.0: 2023/05/04 03:52:22 [DEBUG] diffQuotedDNSRecord Suppress. new: []: [Akamai DNS]=dnsRecordTargetSuppress

Panic Output

https://gist.github.com/zliang-akamai/e8d1e33605975b2786c5cbd58b6739f1

Expected Behavior

dnsRecordTargetSuppress function passed without issue

Actual Behavior

dnsRecordTargetSuppress function panics

Our SRE team encountered this issue when deploying their Linode infrastructure. I was assisting them in the debugging process. Basically in some edge cases, might be due to some Terraform/Terraform SDK bugs, "0" or some other invalid values can be passed in to dnsRecordTargetSuppress function as old parameter. Before HashiCorp fixing this in Terraform code base, I think it would be nice to have some validations for the parameter passing into FullIPv6, like returning a false when the net.ParseIP(...) returns a nil.

https://github.com/akamai/terraform-provider-akamai/blob/461dfad9cac309178603fab72b53a62556a38bb8/pkg/providers/dns/resource_akamai_dns_record.go#LL489C39-L489C46

Potentially related Terraform issues:
hashicorp/terraform-plugin-sdk#743

Originally reported by @iehrenwald-linode

@majakubiec
Copy link
Contributor

Hi @zliang-akamai,
thanks for reporting the issue and doing some investigation,
We will take a look at it

@majakubiec majakubiec added the bug label May 8, 2023
@majakubiec majakubiec changed the title FullIPv6 panics for invalid input DXE-2615 FullIPv6 panics for invalid input May 8, 2023
@dstopka dstopka mentioned this issue May 30, 2023
@lkowalsk-akamai-com
Copy link
Contributor

@zliang-akamai this issue was fixed in recent release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants