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

Cannot use deployment data source when autoscaling is not defined. #649

Closed
4 tasks done
that-dom opened this issue May 12, 2023 · 5 comments · Fixed by #667
Closed
4 tasks done

Cannot use deployment data source when autoscaling is not defined. #649

that-dom opened this issue May 12, 2023 · 5 comments · Fixed by #667
Labels
bug Something isn't working
Milestone

Comments

@that-dom
Copy link

that-dom commented May 12, 2023

The provider will crash when no autoscaling properties are defined on cluster topology elements. Deployments created via the UI will include autoscaling limits regardless of whether autoscaling is enabled or not, to repro a deployment must be created via the API, without any autoscaling limits defined, or created with a version which does not support autoscaling.

Original issue

Readiness Checklist

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I am reporting the issue to the correct repository (for multi-repository projects)

I'm attempting to get data back from ec_deployment using provider ec version 0.7.0. Received this error from Terraform:

data.ec_deployment.example: Reading...

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

╷
│ Error: Value Conversion Error
│ 
│   with data.ec_deployment.example,
│   on main.tf line 54, in data "ec_deployment" "example":
│   54: data "ec_deployment" "example" {
│ 
│ An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the
│ provider developer:
│ 
│ cannot convert List to tftypes.Value if ElemType field is not set
╵
╷
│ Error: Value Conversion Error
│ 
│   with data.ec_deployment.example,
│   on main.tf line 54, in data "ec_deployment" "example":
│   54: data "ec_deployment" "example" {
│ 
│ An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the
│ provider developer:
│ 
│ cannot convert List to tftypes.Value if ElemType field is not set
╵

This happens running this simple Terraform with the deployment_id set to id

terraform {
  required_providers {
    ec = {
      source = "elastic/ec"
      version = "0.7.0"
    }
  }
}

data "ec_deployment" "example" {
  id = "<cluster id from my cloud account>"
}

Turn on tracing (seen below) and it looks like the error message indicates that there are two Value Conversion Errors encountered while reading the "ec_deployment" data source. The first error is related to the attribute "autoscaling," and the second error is related to the attribute "topology."

Trace Logs

2023-05-12T14:33:56.312-0400 [TRACE] readDataSource: data.ec_deployment.cluster[0] configuration is complete, so reading from provider
data.ec_deployment.cluster[0]: Reading...
2023-05-12T14:33:56.312-0400 [TRACE] GRPCProvider.v6: ReadDataSource
2023-05-12T14:33:56.312-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Received request: tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 @module=sdk.proto tf_proto_version=6.3 tf_provider_addr=registry.terraform.io/elastic/ec @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:646 tf_data_source_type=ec_deployment tf_rpc=ReadDataSource timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Sending request downstream: tf_proto_version=6.3 tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:17 @module=sdk.proto tf_data_source_type=ec_deployment tf_provider_addr=registry.terraform.io/elastic/ec timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Checking DataSourceTypes lock: tf_data_source_type=ec_deployment tf_provider_addr=registry.terraform.io/elastic/ec tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:142 @module=sdk.framework tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Checking DataSourceSchemas lock: tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_rpc=ReadDataSource @module=sdk.framework tf_data_source_type=ec_deployment tf_provider_addr=registry.terraform.io/elastic/ec @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:216 timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: DataSource implements DataSourceWithConfigure: tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:36 @module=sdk.framework tf_provider_addr=registry.terraform.io/elastic/ec tf_data_source_type=ec_deployment timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [DEBUG] provider.terraform-provider-ec_v0.7.0: Calling provider defined DataSource Configure: @module=sdk.framework tf_provider_addr=registry.terraform.io/elastic/ec tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:43 tf_data_source_type=ec_deployment tf_rpc=ReadDataSource timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [DEBUG] provider.terraform-provider-ec_v0.7.0: Called provider defined DataSource Configure: @module=sdk.framework tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:45 tf_data_source_type=ec_deployment tf_provider_addr=registry.terraform.io/elastic/ec tf_rpc=ReadDataSource timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.312-0400 [DEBUG] provider.terraform-provider-ec_v0.7.0: Calling provider defined DataSource Read: tf_data_source_type=ec_deployment tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_rpc=ReadDataSource @module=sdk.framework tf_provider_addr=registry.terraform.io/elastic/ec @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:74 timestamp=2023-05-12T14:33:56.312-0400
2023-05-12T14:33:56.520-0400 [DEBUG] provider.terraform-provider-ec_v0.7.0: Called provider defined DataSource Read: tf_data_source_type=ec_deployment tf_provider_addr=registry.terraform.io/elastic/ec @module=sdk.framework tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:76 timestamp=2023-05-12T14:33:56.519-0400
2023-05-12T14:33:56.520-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Received downstream response: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:37 diagnostic_warning_count=0 tf_req_duration_ms=207 tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 tf_data_source_type=ec_deployment tf_proto_version=6.3 tf_provider_addr=registry.terraform.io/elastic/ec @module=sdk.proto diagnostic_error_count=2 tf_rpc=ReadDataSource timestamp=2023-05-12T14:33:56.520-0400
2023-05-12T14:33:56.520-0400 [ERROR] provider.terraform-provider-ec_v0.7.0: Response contains error diagnostic: diagnostic_summary="Value Conversion Error" tf_data_source_type=ec_deployment diagnostic_attribute=ElementKeyInt(2).AttributeName("autoscaling") tf_provider_addr=registry.terraform.io/elastic/ec @module=sdk.proto diagnostic_detail="An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set" tf_proto_version=6.3 tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55 diagnostic_severity=ERROR tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 timestamp=2023-05-12T14:33:56.520-0400
2023-05-12T14:33:56.520-0400 [ERROR] provider.terraform-provider-ec_v0.7.0: Response contains error diagnostic: tf_provider_addr=registry.terraform.io/elastic/ec @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55 @module=sdk.proto tf_proto_version=6.3 diagnostic_attribute=ElementKeyInt(0).AttributeName("topology") diagnostic_detail="An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set" diagnostic_summary="Value Conversion Error" tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 diagnostic_severity=ERROR tf_data_source_type=ec_deployment tf_rpc=ReadDataSource timestamp=2023-05-12T14:33:56.520-0400
2023-05-12T14:33:56.520-0400 [TRACE] provider.terraform-provider-ec_v0.7.0: Served request: tf_provider_addr=registry.terraform.io/elastic/ec tf_req_id=fb6eaf24-7907-622c-cdb9-271233d38a94 @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:668 tf_rpc=ReadDataSource @module=sdk.proto tf_data_source_type=ec_deployment tf_proto_version=6.3 timestamp=2023-05-12T14:33:56.520-0400
2023-05-12T14:33:56.521-0400 [ERROR] vertex "data.ec_deployment.cluster[0]" error: Value Conversion Error
2023-05-12T14:33:56.521-0400 [ERROR] vertex "data.ec_deployment.cluster[0]" error: Value Conversion Error
2023-05-12T14:33:56.521-0400 [TRACE] vertex "data.ec_deployment.cluster[0]": visit complete, with errors
2023-05-12T14:33:56.521-0400 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-05-12T14:33:56.521-0400 [TRACE] vertex "data.ec_deployment.cluster (expand)": dynamic subgraph encountered errors: Value Conversion Error,Value Conversion Error
2023-05-12T14:33:56.521-0400 [ERROR] vertex "data.ec_deployment.cluster (expand)" error: Value Conversion Error
2023-05-12T14:33:56.521-0400 [ERROR] vertex "data.ec_deployment.cluster (expand)" error: Value Conversion Error
2023-05-12T14:33:56.521-0400 [TRACE] vertex "data.ec_deployment.cluster (expand)": visit complete, with errors
2023-05-12T14:33:56.521-0400 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/elastic/ec\"] (close)" errored, so skipping
2023-05-12T14:33:56.521-0400 [TRACE] dag/walk: upstream of "output.remote_clusters (expand)" errored, so skipping
2023-05-12T14:33:56.521-0400 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-05-12T14:33:56.522-0400 [TRACE] LoadSchemas: retrieving schema for provider type "registry.terraform.io/elastic/ec"

Error: Value Conversion Error

  with data.ec_deployment.cluster[0],
  on main.tf line 38, in data "ec_deployment" "cluster":
  38: data "ec_deployment" "cluster" {

An unexpected error was encountered trying to convert the Attribute value
into a Terraform value. This is always an error in the provider. Please
report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set

Error: Value Conversion Error

  with data.ec_deployment.cluster[0],
  on main.tf line 38, in data "ec_deployment" "cluster":
  38: data "ec_deployment" "cluster" {

An unexpected error was encountered trying to convert the Attribute value
into a Terraform value. This is always an error in the provider. Please
report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set
2023-05-12T14:33:56.528-0400 [TRACE] statemgr.Filesystem: removing lock metadata file .terraform.tfstate.lock.info
2023-05-12T14:33:56.529-0400 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2023-05-12T14:33:56.530-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-05-12T14:33:56.532-0400 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/elastic/ec/0.7.0/darwin_arm64/terraform-provider-ec_v0.7.0 pid=48802
2023-05-12T14:33:56.532-0400 [DEBUG] provider: plugin exited
@that-dom that-dom added the bug Something isn't working label May 12, 2023
@yannrouillard
Copy link

I can confirm this bug, we are hitting exactly the same issue.

@shivshav
Copy link

Hitting the exact same issue on 0.6.0 as well. This is on a configuration that's already deployed successfully previously. Fwiw upgrading to 0.7.0 didn't change anything

@tobio
Copy link
Member

tobio commented Jun 16, 2023

@shivshav are you able to let me know a deployment id you're using when triggering this issue?

@xM8WVqaG
Copy link

Version information

$ tf version
Terraform v1.4.6
on darwin_arm64
+ provider [registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) v0.7.0

Minimum working example

terraform {
  required_version = "~> 1.2"

  required_providers {
    ec = {
      source  = "elastic/ec"
      version = "0.7.0"
    }
  }
}


provider "ec" {}

data "ec_deployment" "mwe" {
  id = "REDACTED"
}

Same error as reported above

2023-06-16T15:18:08.039+0100 [TRACE] readDataSource: data.ec_deployment.mwe configuration is complete, so reading from provider
data.ec_deployment.mwe: Reading...
2023-06-16T15:18:08.039+0100 [TRACE] GRPCProvider.v6: ReadDataSource
2023-06-16T15:18:08.039+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Received request: tf_data_source_type=ec_deployment tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:646](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:646) @module=sdk.proto tf_proto_version=6.3 tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_rpc=ReadDataSource timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Sending request downstream: tf_data_source_type=ec_deployment tf_proto_version=6.3 tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_rpc=ReadDataSource @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:17](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:17) tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) @module=sdk.proto timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Checking DataSourceTypes lock: @module=sdk.framework tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_rpc=ReadDataSource @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:142](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:142) tf_data_source_type=ec_deployment timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Checking DataSourceSchemas lock: @module=sdk.framework tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_rpc=ReadDataSource @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:216](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server.go:216) tf_data_source_type=ec_deployment timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: DataSource implements DataSourceWithConfigure: @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:36](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:36) tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 @module=sdk.framework tf_data_source_type=ec_deployment tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [DEBUG] provider.terraform-provider-ec_v0.7.0: Calling provider defined DataSource Configure: @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:43](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:43) @module=sdk.framework tf_data_source_type=ec_deployment tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [DEBUG] provider.terraform-provider-ec_v0.7.0: Called provider defined DataSource Configure: @module=sdk.framework @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:45](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:45) tf_data_source_type=ec_deployment tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_rpc=ReadDataSource timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.039+0100 [DEBUG] provider.terraform-provider-ec_v0.7.0: Calling provider defined DataSource Read: @module=sdk.framework tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:74](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:74) tf_data_source_type=ec_deployment tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 timestamp=2023-06-16T15:18:08.039+0100
2023-06-16T15:18:08.885+0100 [DEBUG] provider.terraform-provider-ec_v0.7.0: Called provider defined DataSource Read: @caller=[github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:76](http://github.com/hashicorp/terraform-plugin-framework@v0.14.0/internal/fwserver/server_readdatasource.go:76) tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource @module=sdk.framework tf_data_source_type=ec_deployment tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 timestamp=2023-06-16T15:18:08.885+0100
2023-06-16T15:18:08.885+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Received downstream response: tf_rpc=ReadDataSource @module=sdk.proto tf_data_source_type=ec_deployment tf_proto_version=6.3 @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:37](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/tf6serverlogging/downstream_request.go:37) diagnostic_error_count=2 diagnostic_warning_count=0 tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_req_duration_ms=845 tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 timestamp=2023-06-16T15:18:08.885+0100
2023-06-16T15:18:08.885+0100 [ERROR] provider.terraform-provider-ec_v0.7.0: Response contains error diagnostic: tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 tf_proto_version=6.3 diagnostic_severity=ERROR diagnostic_attribute=ElementKeyInt(0).AttributeName("autoscaling") @module=sdk.proto diagnostic_detail="An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set" diagnostic_summary="Value Conversion Error" tf_data_source_type=ec_deployment tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55) timestamp=2023-06-16T15:18:08.885+0100
2023-06-16T15:18:08.885+0100 [ERROR] provider.terraform-provider-ec_v0.7.0: Response contains error diagnostic: @module=sdk.proto tf_rpc=ReadDataSource diagnostic_severity=ERROR tf_data_source_type=ec_deployment diagnostic_detail="An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:

cannot convert List to tftypes.Value if ElemType field is not set" tf_proto_version=6.3 tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/internal/diag/diagnostics.go:55) diagnostic_attribute=ElementKeyInt(0).AttributeName("topology") diagnostic_summary="Value Conversion Error" tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) timestamp=2023-06-16T15:18:08.885+0100
2023-06-16T15:18:08.885+0100 [TRACE] provider.terraform-provider-ec_v0.7.0: Served request: @module=sdk.proto tf_data_source_type=ec_deployment tf_proto_version=6.3 tf_req_id=58a494a7-ca2d-1b2b-a4e6-dc0f0040f2e3 @caller=[github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:668](http://github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov6/tf6server/server.go:668) tf_provider_addr=[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec) tf_rpc=ReadDataSource timestamp=2023-06-16T15:18:08.885+0100
2023-06-16T15:18:08.886+0100 [ERROR] vertex "data.ec_deployment.mwe" error: Value Conversion Error
2023-06-16T15:18:08.886+0100 [ERROR] vertex "data.ec_deployment.mwe" error: Value Conversion Error
2023-06-16T15:18:08.886+0100 [TRACE] vertex "data.ec_deployment.mwe": visit complete, with errors
2023-06-16T15:18:08.886+0100 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-06-16T15:18:08.886+0100 [TRACE] vertex "data.ec_deployment.mwe (expand)": dynamic subgraph encountered errors: Value Conversion Error,Value Conversion Error
2023-06-16T15:18:08.886+0100 [ERROR] vertex "data.ec_deployment.mwe (expand)" error: Value Conversion Error
2023-06-16T15:18:08.886+0100 [ERROR] vertex "data.ec_deployment.mwe (expand)" error: Value Conversion Error
2023-06-16T15:18:08.886+0100 [TRACE] vertex "data.ec_deployment.mwe (expand)": visit complete, with errors
2023-06-16T15:18:08.886+0100 [TRACE] dag/walk: upstream of "provider[\"[registry.terraform.io/elastic/ec\](http://registry.terraform.io/elastic/ec%5C)"] (close)" errored, so skipping
2023-06-16T15:18:08.886+0100 [TRACE] dag/walk: upstream of "root" errored, so skipping
2023-06-16T15:18:08.886+0100 [TRACE] LoadSchemas: retrieving schema for provider type "[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec)"
2023-06-16T15:18:08.886+0100 [INFO]  backend/local: plan operation completed
2023-06-16T15:18:08.886+0100 [TRACE] LoadSchemas: retrieving schema for provider type "[registry.terraform.io/elastic/ec](http://registry.terraform.io/elastic/ec)"

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

╷
│ Error: Value Conversion Error
│
│   with data.ec_deployment.mwe,
│   on elasticsearch.tf line 37, in data "ec_deployment" "mwe":
│   37: data "ec_deployment" "mwe" {
│
│ An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:
│
│ cannot convert List to tftypes.Value if ElemType field is not set
╵
╷
│ Error: Value Conversion Error
│
│   with data.ec_deployment.mwe,
│   on [elasticsearch.tf](http://elasticsearch.tf/) line 37, in data "ec_deployment" "mwe":
│   37: data "ec_deployment" "mwe" {
│
│ An unexpected error was encountered trying to convert the Attribute value into a Terraform value. This is always an error in the provider. Please report the following to the provider developer:
│
│ cannot convert List to tftypes.Value if ElemType field is not set
╵
2023-06-16T15:18:08.887+0100 [TRACE] statemgr.Filesystem: removing lock metadata file .[terraform.tfstate.lock.info](http://terraform.tfstate.lock.info/)
2023-06-16T15:18:08.888+0100 [TRACE] statemgr.Filesystem: unlocking terraform.tfstate using fcntl flock
2023-06-16T15:18:08.889+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-06-16T15:18:08.891+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/[registry.terraform.io/elastic/ec/0.7.0/darwin_arm64/terraform-provider-ec_v0.7.0](http://registry.terraform.io/elastic/ec/0.7.0/darwin_arm64/terraform-provider-ec_v0.7.0) pid=35884
2023-06-16T15:18:08.891+0100 [DEBUG] provider: plugin exited

Cluster information:

  • Deployment id: 48d5395ab52d14454f8f062de2495fdf (cc @tobio)
  • Elasticsearch version: 6.4.1

Context, I know v6 is EoL, I was attempting to read in an old v6 cluster to automatically generate the Elasticsearch cluster definition to shortcut building a similar supported cluster.

I expect older versions aren't supported by the provider since they were removed from the EC console. If so, the provider should probably check the version and abort with a suitable message.

@shivshav
Copy link

@tobio Funnily enough I tried running tf plan again and I'm actually not experiencing the issue anymore on 0.6.0 or 0.7.0 🤔 Maybe this was an unexpected Elastic Cloud API response change that got reverted or something? 🤷🏾

In any case, no more issues running tf plan for me

@tobio tobio changed the title Running ec_deployment and receiving cannot convert List to tftypes.Value if ElemType field is not set Cannot import deployment when autoscaling is not defined. Jun 17, 2023
@tobio tobio changed the title Cannot import deployment when autoscaling is not defined. Cannot use deployment data source when autoscaling is not defined. Jun 17, 2023
@tobio tobio added this to the 0.8.0 milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants