citrix / terraform-provider-citrix

Terraform Provider for Citrix
https://registry.terraform.io/providers/citrix/citrix/latest
Apache License 2.0
45 stars 5 forks source link

Plugin did not respond to the plugin6.(*GRPCProvider).ConfigureProvider call. #27

Closed ladanovy closed 8 months ago

ladanovy commented 9 months ago

Anyone would be able to provide advice. New to Terraform and Citrix provider. Using the templates for onprem setup. Terraform INIT goes well, PLAN is generating error below when changing the default value of users in delivery_group.tf from to UPN.

In connected machine catalogue.tf I`m commenting the whole section as in the onprem templates there seems to be configuration of machine catalogue only with examples to cloud connection and doing an import : terraform import citrix_daas_machine_catalog.example GUID_OF_MACHINE_CATALOGUE. Citrixdaas.tf provider Citrix is filled up with farm info.

Thanks for any advice.

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

Stack trace from the terraform-provider-citrix_v0.3.5.exe plugin:

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x38 pc=0x14f2f5e]

goroutine 53 [running]: net/http.(Request).SetBasicAuth(0x0, {0xc0000a6500?, 0x230239d?}, {0xc000090620?, 0xc0003aa870?}) net/http/request.go:988 +0x7e github.com/citrix/citrix-daas-rest-go/client.(CitrixDaasClient).SignIn(0xc0003a0640) github.com/citrix/citrix-daas-rest-go@v0.2.6/client/auth.go:57 +0x255 github.com/citrix/citrix-daas-rest-go/client.NewCitrixDaasClient({0x24af060, 0xc0003b3b00}, {0xc0003aa870, 0x4e}, {0xc0000a6520, 0x1a}, {0x230e848, 0x10}, {0xc0000a6500, 0x1d}, ...) github.com/citrix/citrix-daas-rest-go@v0.2.6/client/citrixdaas_client.go:78 +0x53a github.com/citrix/terraform-provider-citrix/internal/provider.(citrixProvider).Configure(0xc0001f5420, {0x24af060, 0xc0004a2360}, {{0xc0000904f8, 0x5}, {{{0x24b3890, 0xc0004a2d50}, {0x2140ec0, 0xc0004a2c60}}, {0x2 4b5190, ...}}}, ...) github.com/citrix/terraform-provider-citrix/internal/provider/provider.go:389 +0x12db github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(Server).ConfigureProvider(0xc00015d1e0, {0x24af060, 0xc0004a2360}, 0xc000095380, 0xc000095300) github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/fwserver/server_configureprovider.go:18 +0x10c github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(Server).ConfigureProvider(0xc00015d1e0, {0x24af060?, 0xc0004a2240?}, 0xc0004a2210?) github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/proto6server/server_configureprovider.go:39 +0x2f6 github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(server).ConfigureProvider(0xc00023d220, {0x24af060?, 0xc000495a10?}, 0xc000095140) github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov6/tf6server/server.go:568 +0x2bb github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x2259420?, 0xc00023d220}, {0x24af060, 0xc000495a10}, 0xc0000c8b80, 0x0) github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:413 +0x169 google.golang.org/grpc.(Server).processUnaryRPC(0xc0002321e0, {0x24af060, 0xc0004959b0}, {0x24b4100, 0xc0003881a0}, 0xc000496ea0, 0xc00032abd0, 0x2f933d0, 0x0) google.golang.org/grpc@v1.59.0/server.go:1343 +0xe03 google.golang.org/grpc.(Server).handleStream(0xc0002321e0, {0x24b4100, 0xc0003881a0}, 0xc000496ea0) google.golang.org/grpc@v1.59.0/server.go:1737 +0xc4c google.golang.org/grpc.(Server).serveStreams.func1.1() google.golang.org/grpc@v1.59.0/server.go:986 +0x86 created by google.golang.org/grpc.(Server).serveStreams.func1 in goroutine 36 google.golang.org/grpc@v1.59.0/server.go:997 +0x145

Error: The terraform-provider-citrix_v0.3.5.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.

AlanCitrix commented 9 months ago

Thanks for reporting this issue. The crash is certainly unexpected, however I believe it is because the hostname parameter in your Citrixdaas.tf is not well formed.

If you are using an on-premises DDC, it should be the IP address or FQDN of your DDC. Would you mind including your Citrixdaas.tf with any secrets omitted if that's ok to share?

ladanovy commented 9 months ago

Hello Alan, You are almost right ;). For hostname I have used IP but for client_id I have passed : FQDN of DDC\domain_account instead of domain\domain_account. My mistake - but many thanks for answer because I was unable to find any other channel where I can speak directly to this specific topic. Even this seems more like not my understanding of the configuration. Anyway - last question is this provider somehow Citrix version specific ? Meaning what is the oldest Citrix version I can use this provider for ?

Im asking due another issue ... There is no windows firewall turned on, TLS setup to 1.2 in registry and Im running it on the same machine as Citrix DDC is installed. An unexpected error occurred when creating the Citrix API client. │ │ Error: Post "https://10.0.0.1/citrix/orchestration/api/techpreview/tokens": read tcp 10.0.0.1:51899->10.0.0.1:443: wsarecv: An existing connection was forcibly closed by the remote host.

But this doesn't seems to be related to the provider itself. Regards, Lada.

AlanCitrix commented 9 months ago

For on-premises DDCs it requires Web Studio + Orchestration service which is an optional install starting with release 2308: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/install-configure/install-core/install-web-studio.html#install-web-studio-1

zhuolun-citrix commented 9 months ago

Since you are using IP address of the DDC in your terraform provider config, please make sure to disable TLS in the provider config so that the connection can be established.

TLS on provider connection can be disabled by setting disable_ssl_verification to true, i.e.:

provider "citrix" {
  hostname                    = "<DDC public IP / hostname>"
  client_id                   = "<DomainFqdn>\\<Admin Username>"
  client_secret               = "<Admin Passwd>"
  disable_ssl_verification    = true # omit this field if DDC has valid SSL certificate configured 
}
zhuolun-citrix commented 8 months ago

Hi @ladanovy ,

Just trying to follow up on the issue. Please let us know if the above comment helps unblock you.

Thank you!

ladanovy commented 8 months ago

Hi,

Sorry for my late response. I'm gonna give you answer tomorrow.

Thanks and sorry. Lada

Dne út 16. 1. 2024 18:11 uživatel Zhuolun @.***> napsal:

Hi @ladanovy https://github.com/ladanovy ,

Just trying to follow up on the issue. Please let us know if the above comment helps unblock you.

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/citrix/terraform-provider-citrix/issues/27#issuecomment-1894165460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3YSDH2JVSU7KIS4PAVNE3YO2YCNAVCNFSM6AAAAABAHOVL42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGE3DKNBWGA . You are receiving this because you were mentioned.Message ID: @.***>

ladanovy commented 8 months ago

Just to sum up.

I was not fulfilling the need of all components as Alan mentioned.

út 23. 1. 2024 v 18:21 odesílatel Ladislav Novy @.***> napsal:

Hi,

Sorry for my late response. I'm gonna give you answer tomorrow.

Thanks and sorry. Lada

Dne út 16. 1. 2024 18:11 uživatel Zhuolun @.***> napsal:

Hi @ladanovy https://github.com/ladanovy ,

Just trying to follow up on the issue. Please let us know if the above comment helps unblock you.

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/citrix/terraform-provider-citrix/issues/27#issuecomment-1894165460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3YSDH2JVSU7KIS4PAVNE3YO2YCNAVCNFSM6AAAAABAHOVL42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJUGE3DKNBWGA . You are receiving this because you were mentioned.Message ID: @.***>

-- S pozdravem, Ladislav Novy.