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

azurerm_automation_software_update_configuration Plugin did not respond #21277

Closed
1 task done
ASHR4 opened this issue Apr 4, 2023 · 1 comment · Fixed by #21311
Closed
1 task done

azurerm_automation_software_update_configuration Plugin did not respond #21277

ASHR4 opened this issue Apr 4, 2023 · 1 comment · Fixed by #21311

Comments

@ASHR4
Copy link
Contributor

ASHR4 commented Apr 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.4.4

AzureRM Provider Version

3.5.0

Affected Resource(s)/Data Source(s)

azurerm_automation_software_update_configuration

Terraform Configuration Files

resource "azurerm_automation_software_update_configuration" "main" {
  for_each              = var.update_configuration != null ? var.update_configuration : {}
  name                  = lower(each.key)
  automation_account_id = azurerm_automation_account.main.id
  operating_system      = each.value.operating_system
  duration              = each.value.duration


  dynamic "linux" {
    for_each = title(each.value.operating_system) == "Linux" ? [1] : []
    content {
      classification_included = join("", each.value.linux.classification_included)
      excluded_packages       = each.value.linux.excluded_packages
      included_packages       = each.value.linux.included_packages
      reboot                  = each.value.linux.reboot
    }
  }

  dynamic "windows" {
    for_each = title(each.value.operating_system) == "Windows" ? [1] : []
    content {
      classifications_included        = each.value.windows.classifications_included
      excluded_knowledge_base_numbers = each.value.windows.excluded_knowledge_base_numbers
      included_knowledge_base_numbers = each.value.windows.included_knowledge_base_numbers
      reboot                          = each.value.windows.reboot
    }
  }

  pre_task {
    source     = each.value.pre_task.name
    parameters = each.value.pre_task.parameters
  }

  post_task {
    source     = each.value.post_task.name
    parameters = each.value.post_task.parameters
  }

  target {
    azure_query {
      scope     = each.value.target.scope
      locations = each.value.target.locations

      tags {
        tag    = each.value.target.tags.tag
        values = each.value.target.tags.values
      }
    }
  }

  schedule {
    is_enabled  = each.value.schedule.is_enabled
    frequency   = each.value.schedule.frequency
    description = each.value.schedule.description
    start_time  = each.value.schedule.start_time
    time_zone   = ""
  }
  lifecycle {
    ignore_changes = [
      schedule.0.start_time
    ]
  }
}

// terraform.tfvars

update_configuration =  {
          auto = {
            operating_system = "Windows"
            duration         = "PT3H0M0S"
            windows = {
              classifications_included        = ["Critical", "Security", "UpdateRollup", "Definition"]
              excluded_knowledge_base_numbers = []
              included_knowledge_base_numbers = []
              reboot                          = "Always"
            }
            schedule = {
              is_enabled  = true
              frequency   = "OneTime"
              description = "Patching"
              start_time  = ""
            }
            target = {
              locations = []
              scope     = []
              tags = {
                tag    = "group"
                values = ["0"]
              }
            }
          }
      }

Debug Output/Panic Output

Stack trace from the terraform-provider-azurerm_v3.50.0_x5.exe plugin:

panic: assignment to entry in nil map

goroutine 121 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/automation.updateTaskFromSDK(...)
	github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/automation_software_update_configuration_resource.go:91
github.com/hashicorp/terraform-provider-azurerm/internal/services/automation.(*SoftwareUpdateConfigurationModel).LoadSDKModel(0xc000edd400, 0x58?)
	github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/automation_software_update_configuration_resource.go:508 +0xcc9
github.com/hashicorp/terraform-provider-azurerm/internal/services/automation.SoftwareUpdateConfigurationResource.Read.func1({0x85cb168, 0xc0026c0fc0}, {0xc0006a3000, {0x85cbc90, 0xc0004339f8}, 0xc001ad7600, 0x0, {0x85cd078, 0xcb66bc8}})
	github.com/hashicorp/terraform-provider-azurerm/internal/services/automation/automation_software_update_configuration_resource.go:1033 +0x4e6
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func2({0x85cb168, 0xc0026c0fc0}, 0x1a3185c5000?, {0x717bbc0?, 0xc0006a3000?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:59 +0x1e5
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.diagnosticsWrapper.func1({0x85cb168, 0xc0026c0fc0}, 0x0?, {0x717bbc0, 0xc0006a3000})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:185 +0xbe
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0004e5500, {0x85cb1a0, 0xc0012cc420}, 0xd?, {0x717bbc0, 0xc0006a3000})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:707 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004e5500, {0x85cb1a0, 0xc0012cc420}, 0xc001cf8750, 0xc00239dc00, {0x717bbc0, 0xc0006a3000})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0018763a8, {0x85cb1a0?, 0xc00262bf50?}, 0xc00238ef00)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc000889400, {0x85cb1a0?, 0xc00262b920?}, 0xc0013b18f0)
	github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x78d1340?, 0xc000889400}, {0x85cb1a0, 0xc00262b920}, 0xc0013b1880, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00043e000, {0x85db4a0, 0xc00154a340}, 0xc001b917a0, 0xc00190ffb0, 0xcb00ec0, 0x0)
	google.golang.org/grpc@v1.51.0/server.go:1340 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00043e000, {0x85db4a0, 0xc00154a340}, 0xc001b917a0, 0x0)
	google.golang.org/grpc@v1.51.0/server.go:1713 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.51.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.51.0/server.go:963 +0x28a

Error: The terraform-provider-azurerm_v3.50.0_x5.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.

Expected Behaviour

# automation-accounts["main"].azurerm_automation_software_update_configuration.main["auto"] will be created
  + resource "azurerm_automation_software_update_configuration" "main" {
      + automation_account_id = ""
      + duration              = "PT3H0M0S"
      + error_code            = (known after apply)
      + error_meesage         = (known after apply)
      + error_message         = (known after apply)
      + id                    = (known after apply)
      + name                  = "auto"
      + operating_system      = "Windows"

      + schedule {
          + creation_time              = (known after apply)
          + description                = "Patching"
          + expiry_time                = (known after apply)
          + expiry_time_offset_minutes = (known after apply)
          + frequency                  = "OneTime"
          + is_enabled                 = true
          + last_modified_time         = (known after apply)
          + next_run                   = (known after apply)
          + next_run_offset_minutes    = (known after apply)
          + start_time                 = ""
          + start_time_offset_minutes  = (known after apply)
          + time_zone                  = ""
        }

      + target {
          + azure_query {
              + locations  = []
              + scope      = []
              + tag_filter = (known after apply)

              + tags {
                  + tag    = "group"
                  + values = [
                      + "0",
                    ]
                }
            }
        }

      + windows {
          + classification_included         = (known after apply)
          + classifications_included        = [
              + "Critical",
              + "Security",
              + "UpdateRollup",
              + "Definition",
            ]
          + excluded_knowledge_base_numbers = []
          + included_knowledge_base_numbers = []
          + reboot                          = "Always"
        }
    }

Actual Behaviour

│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

Thought #21110 would fix it

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants