gomorpheus / terraform-provider-morpheus

Terraform Morpheus provider
MIT License
17 stars 23 forks source link

Unable to create morpheus_power_schedule_policy #272

Closed JRRoul closed 1 month ago

JRRoul commented 1 month ago

We are unable to create this resource on version 9.8 or 10.0.

An example of the module:

`module "morpheus_power_schedule_policy" { source = "../../powerschedule"

powerscheduling = { schedule2 = { name = "tf_example_power_schedule_policy_global" description = "terraform example global power schedule policy" enabled = true enforcement_type = "fixed" power_schedule_id = data.morpheus_power_schedule.example_power_schedule.id hide_power_schedule_if_fixed = true scope = "global" } } }`

The response:

` │ Error: Plugin did not respond │ │ with module.morpheus_power_schedule_policy.morpheus_power_schedule_policy.tf_example_power_schedule_policy_global["schedule2"], │ on ....\powerschedule\main.tf line 1, in resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_global": │ 1: resource "morpheus_power_schedule_policy" "tf_example_power_schedule_policy_global" { │ │ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more d ╵

Stack trace from the terraform-provider-morpheus_v0.10.0.exe plugin:

panic: interface conversion: interface {} is nil, not int

github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).Apply(0xc00042bce0, {0x13fce38, 0xc0003ab650}, 0xc0003bd1e0, 0xc000265900, {0x1264fe0, 0xc0002283c0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:937 +0xa89 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ApplyResourceChange(0xc0003624e0, {0x13fce38?, 0xc0003ab560?}, 0xc00022f8b0) github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:1153 +0xdbc github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ApplyResourceChange(0xc000458140, {0x13fce38?, 0xc0003aab70?}, 0xc000290b60) github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:865 +0x3d0 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x120e520?, 0xc000458140}, {0x13fce38, 0xc0003aab70}, 0xc000265100, 0x0) github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169 google.golang.org/grpc.(Server).processUnaryRPC(0xc00019f000, {0x13fce38, 0xc0003aaae0}, {0x1401100, 0xc00021c780}, 0xc00029b9e0, 0xc00048f830, 0x1a728f8, 0x0) google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23 google.golang.org/grpc.(Server).handleStream(0xc00019f000, {0x1401100, 0xc00021c780}, 0xc00029b9e0) google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016 google.golang.org/grpc.(Server).serveStreams.func2.1() google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 68 google.golang.org/grpc@v1.63.2/server.go:1030 +0x135

Error: The terraform-provider-morpheus_v0.10.0.exe plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely helpful if you could report the crash with the plugin's maintainers so that it can be fixed. The output above should help diagnose the issue. `

We are still able to create the policy via UI and API.

martezr commented 1 month ago

This issue has been fixed in the latest release (v0.11.0) of the Terraform provider.