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

cloudflare_zone_settings_override: panic: interface conversion: interface is nil, not interface {} #404

Open
2 tasks done
barbich opened this issue May 6, 2022 · 2 comments

Comments

@barbich
Copy link

barbich commented May 6, 2022

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the library and it is still present.

cf-terraforming version

cf-terraforming v0.7.3

Expected outcome

hi
I'm trying to retrieve the cloudflare_zone_settings_override .
This used to work a couple of days ago with v0.7.3 (and v0.6..).
Note that requesting other resource types is still OK.

Actual outcome

cloudflare$ ./cf-terraforming generate -v --resource-type cloudflare_zone_settings_override --zone f82f3fc005XXXXX
DEBU[0000] initializing cloudflare-go with API Token account_Id= zone_id=f82f3fc005XXXXXX
DEBU[0004] initializing Terraform in .
DEBU[0005] reading Terraform schema for Cloudflare provider
DEBU[0005] beginning to read and build cloudflare_zone_settings_override resources
cloudflare-go [DEBUG] REQUEST Method:GET URI:https://api.cloudflare.com/client/v4/zones/f82f3fc005XXXXX/settings Headers:http.Header(nil) Body:
cloudflare-go [DEBUG] RESPONSE URI:https://api.cloudflare.com/client/v4 StatusCode:200 Body:"{"result":[{"id":"0rtt","value":"off","modified_on":null,"editable":true},{"id":"ad.....}" RayID:7071fb92fa99dxxx-BRU
panic: interface conversion: interface is nil, not interface {}

goroutine 1 [running]:
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.generateResources.func1(0xd40ca0?, {0x9721f4?, 0x6?, 0x6?})
/home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/generate.go:752 +0x6279
github.com/spf13/cobra.(*Command).execute(0xd40ca0, {0xc0000b4540, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xd411a0)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
github.com/cloudflare/cf-terraforming/internal/app/cf-terraforming/cmd.Execute()
/home/runner/work/cf-terraforming/cf-terraforming/internal/app/cf-terraforming/cmd/root.go:30 +0x25
main.main()
/home/runner/work/cf-terraforming/cf-terraforming/cmd/cf-terraforming/main.go:8 +0x17
seb@seb-GB-BKi7:~/work/Office/ectl-itsec/Development/cloudflare$

Steps to reproduce

  1. ./cf-terraforming generate -v --resource-type cloudflare_zone_settings_override --zone f82f3fc005XXXXX

References

No response

@barbich
Copy link
Author

barbich commented May 6, 2022

My suspicion is that this is due to the max_upload value.
from the cloudflare terraform provider documentation and schema it is expected to be a INT:
/cloudflare/terraform-provider-cloudflare/schema_cloudflare_zone_settings_override.go+449:
"max_upload": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
},

But the value can also be NULL for entreprise customer requesting non standard values (as is our case):
{
"result": [
...
{
"id": "max_upload",
"value": null,
"modified_on": "2022-05-06T11:04:45.758088Z",
"editable": true
},
...
],
"success": true,
"errors": [],
"messages": []
}

@istvanfedak
Copy link

Hi I'm experiencing the same issue

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

No branches or pull requests

2 participants