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 · 1 comment
Open

[BUG] Importing citrixadc_systemfile fails #1120

ravager-dk opened this issue Feb 2, 2024 · 1 comment
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 NetScaler-AutomationToolkit@cloud.com !

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/terraform-plugin-sdk@v1.17.2/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/terraform-plugin-sdk@v1.17.2/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/grpc@v1.52.0/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/grpc@v1.52.0/server.go:1704 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.52.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.52.0/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
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

3 participants