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

[BUG] Importing citrixadc_systemfile fails #1120

Open
ravager-dk opened this issue Feb 2, 2024 · 2 comments
Open

[BUG] Importing citrixadc_systemfile fails #1120

ravager-dk opened this issue Feb 2, 2024 · 2 comments
Assignees
Labels

Comments

@ravager-dk
Copy link
Contributor

ravager-dk commented Feb 2, 2024

Contact us

For any immediate issues or help , reach out to us at [email protected] !

Bug Report

Describe the bug
Importing citrixadc_systemfile fails with error:

citrixadc_systemfile.sshd_config: Import prepared!
  Prepared citrixadc_systemfile for import
citrixadc_systemfile.sshd_config: Refreshing state... [id=/etc/sshd_config]
╷
│ Error: Request cancelled
│ 
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵


Stack trace from the terraform-provider-citrixadc_v1.37.0 plugin:

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

goroutine 115 [running]:
github.com/citrix/terraform-provider-citrixadc/citrixadc.readSystemfileFunc(0xc000c06930, {0x14539c0?, 0xc000ea44c0})
	github.com/citrix/terraform-provider-citrixadc/citrixadc/resource_citrixadc_systemfile.go:134 +0x550
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0005dbd60, 0xc000c0caa0, {0x14539c0, 0xc000ea44c0})
	github.com/hashicorp/terraform-plugin-sdk@v1.[17](https://github.com/ravager-dk/Terraform-ADC-demo/actions/runs/7754063917/job/21146642551#step:4:18).2/helper/schema/resource.go:470 +0x1aa
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc0005dd230, {0xc000578[18](https://github.com/ravager-dk/Terraform-ADC-demo/actions/runs/7754063917/job/21146642551#step:4:19)0?, 0x5beae6?}, 0xc000578180)
	github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:535 +0x365
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler({0x1629c80?, 0xc0005dd230}, {0x1b090c0, 0xc000c00d20}, 0xc000c06460, 0x0)
	github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3269 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a66000, {0x1b0dfe0, 0xc000842000}, 0xc000d01320, 0xc000a64a80, 0x23d[19](https://github.com/ravager-dk/Terraform-ADC-demo/actions/runs/7754063917/job/21146642551#step:4:20)50, 0x0)
	google.golang.org/[email protected]/server.go:1336 +0xd33
google.golang.org/grpc.(*Server).handleStream(0xc000a66000, {0x1b0dfe0, 0xc00084[20](https://github.com/ravager-dk/Terraform-ADC-demo/actions/runs/7754063917/job/21146642551#step:4:21)00}, 0xc000d01320, 0x0)
	google.golang.org/[email protected]/server.go:1704 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:963 +0x28a

Error: The terraform-provider-citrixadc_v1.[37] 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.

To Reproduce
Steps to reproduce the behaviour:

  1. My terraform files are
resource "citrixadc_systemfile" "sshd_config" {
    filename = "sshd_config"
    filelocation = "/etc"
    filecontent = file("${path.module}/sshd_config")
} 
terraform {
  required_providers {
    citrixadc = {
      source  = "citrix/citrixadc"
      version = "~>1.37"
    }
  }
}
provider "citrixadc" {
  endpoint             = "https://${var.primaryNSIP}:443"
  username             = var.nsuser
  password             = var.nspassword
  insecure_skip_verify = true
}
  1. which terraform command I am getting the error
# terrafrom import citrixadc_systemfile.sshd_config /etc/sshd_config
  1. Terraform output logs to the log file (./tf.log). Append TF_LOG=TRACE NS_LOG=TRACE TF_LOG_PATH=./tf.log to your terraform command
    tl_logs cannot currently be captured from the pipeline used. I will try to get these from a local test

  2. Error I am facing on the console
    See error above

Expected behaviour
The file should be imported correctly into state for further modifications in the config later

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please fill the following information):

  • OS: Linux
  • terraform version 1.17
  • terraform-provider-citrixadc version 1.37
  • go version I don't have go installed

Additional context
Add any other context about the problem here.

@rohit-myali
Copy link
Contributor

Thanks @ravager-dk for contacting.
We are working on it, I will update you, as soon we release it to terraform registry!

Thanks
Rohit

@rohit-myali rohit-myali self-assigned this Apr 19, 2024
@stefanschlipfi
Copy link

Bug Report

Describe the bug
Unfortually the citrixadc_policypatset_pattern_binding import is not working with terraform import block

Using the terraform import cli citrixadc_policypatset_pattern_binding.policypatset_pattern_binding_set[\"patset_01.hallowelt\"] patset_01,hallowelt the import works

However if I am using the import block i get this:
Importing citrixadc_policypatset_pattern_binding fails with error:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-citrixadc_v1.41.0 plugin:

panic: runtime error: index out of range [1] with length 1

goroutine 37 [running]:
github.com/citrix/terraform-provider-citrixadc/citrixadc.readPolicypatset_pattern_bindingFunc(0xc0003d70a0, {0x14d4c20?, 0xc000b4a380})
       github.com/citrix/terraform-provider-citrixadc/citrixadc/resource_citrixadc_policypatset_pattern_binding.go:103 +0x718
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000666a00, 0xc0009d5c70, {0x14d4c20, 0xc000b4a380})
       github.com/hashicorp/[email protected]/helper/schema/resource.go:470 +0x1aa
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc000013b08, {0xc000a755c0?, 0x5af286?}, 0xc000a755c0)
       github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:535 +0x365
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler({0x16d90c0?, 0xc000013b08}, {0x1c07910, 0xc000b30480}, 0xc0003d6a10, 0x0)
       github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3269 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0008fe000, {0x1c0cc60, 0xc0009009c0}, 0xc000353d40, 0xc0008f8de0, 0x25566b0, 0x0)
       google.golang.org/[email protected]/server.go:1374 +0xdf1
google.golang.org/grpc.(*Server).handleStream(0xc0008fe000, {0x1c0cc60, 0xc0009009c0}, 0xc000353d40, 0x0)
       google.golang.org/[email protected]/server.go:1751 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.1()
       google.golang.org/[email protected]/server.go:986 +0xca
created by google.golang.org/grpc.(*Server).serveStreams.func1
       google.golang.org/[email protected]/server.go:997 +0x15c

Error: The terraform-provider-citrixadc_v1.41.0 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.

To Reproduce Steps to reproduce the behaviour:

  1. My terraform files are
resource "citrixadc_policypatset_pattern_binding" "policypatset_pattern_binding_set" {

 name    = "patset_01"
 string  = "hallowelt"
 charset = "ASCII"
}
terraform {
  required_providers {
    citrixadc = {
      source  = "citrix/citrixadc"
      version = "~>1.41.0"
    }
  }
}
provider "citrixadc" {
  endpoint             = "https://${var.primaryNSIP}:443"
  username             = var.nsuser
  password             = var.nspassword
  insecure_skip_verify = true
}

Expected behaviour The file should be imported correctly into state for further modifications in the config later

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please fill the following information):

  • OS: Linux
  • terraform version 1.9.5
  • terraform-provider-citrixadc version 1.41.0
  • go version I don't have go installed

Additional context Did I something working using the import block ?

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

No branches or pull requests

4 participants