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

5.0.0-rc1 terraform provider has error #4891

Open
3 tasks done
shengjiangfeng opened this issue Jan 15, 2025 · 6 comments
Open
3 tasks done

5.0.0-rc1 terraform provider has error #4891

shengjiangfeng opened this issue Jan 15, 2025 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@shengjiangfeng
Copy link

shengjiangfeng commented Jan 15, 2025

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

When i use 5.0.0-rc1 terraform provider , it returns errors like below.
│ Error: Value Conversion Error

│ with cloudflare_workers_script.example_workers_script,
│ An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the
│ provider developer:

│ mismatch between struct and object: Object defines fields not found in struct: startup_time_ms, etag, has_assets, placement_mode, modified_on, has_modules, and placement_status.

Affected resource(s)

resource cloudflare_workers_script

Terraform configuration files

resource "cloudflare_workers_script" "example_workers_script" {
  account_id = "xxxxxxxx"
  script_name = "test"
    content    = file("index.js")

    assets = {
      config = {
        html_handling = "auto-trailing-slash"
        not_found_handling = "none"
        serve_directly = true
      }
      jwt = "jwt"
    }
    bindings = [{
      name = "MY_ENV_VAR"
      type = "plain_text"
    }]
    compatibility_date = "2025-01-10"
    compatibility_flags = ["nodejs_compat_v2"]


 
  
}

Link to debug output

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

2025-01-15T16:31:15.018+0800 [INFO] backend/local: apply calling Apply
2025-01-15T16:31:15.018+0800 [DEBUG] Building and walking apply graph for NormalMode plan
2025-01-15T16:31:15.018+0800 [DEBUG] Resource state not found for node "cloudflare_workers_kv_namespace.workers_kv_namespace", instance cloudflare_workers_kv_namespace.workers_kv_namespace
2025-01-15T16:31:15.018+0800 [DEBUG] Resource state not found for node "cloudflare_workers_script.example_workers_script", instance cloudflare_workers_script.example_workers_script
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_script.example_workers_script" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_script.example_workers_script (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.019+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace (expand)" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_script.example_workers_script (expand)" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [cloudflare_workers_kv_namespace.workers_kv_namespace (expand) cloudflare_workers_kv_namespace.workers_kv_namespace cloudflare_workers_kv_namespace.workers_kv_namespace]
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_script.example_workers_script" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/cloudflare/cloudflare"]" references: []
2025-01-15T16:31:15.020+0800 [DEBUG] Starting graph walk: walkApply
2025-01-15T16:31:15.021+0800 [DEBUG] created provider logger: level=debug
2025-01-15T16:31:15.021+0800 [INFO] provider: configuring client automatic mTLS
2025-01-15T16:31:15.025+0800 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1]
2025-01-15T16:31:15.030+0800 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 pid=43261
2025-01-15T16:31:15.030+0800 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1
2025-01-15T16:31:15.053+0800 [INFO] provider.terraform-provider-cloudflare_v5.0.0-rc1: configuring server automatic mTLS: timestamp=2025-01-15T16:31:15.053+0800
2025-01-15T16:31:15.060+0800 [DEBUG] provider: using plugin: version=6
2025-01-15T16:31:15.060+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: plugin address: address=/var/folders/k6/n67v29s97t9g64gp2zd081m80000gq/T/plugin585257130 network=unix timestamp=2025-01-15T16:31:15.060+0800
2025-01-15T16:31:15.107+0800 [DEBUG] No provider meta schema returned
2025-01-15T16:31:15.122+0800 [DEBUG] skipping FixUpBlockAttrs
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:217 tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 tf_resource_type=cloudflare_workers_kv_namespace timestamp=2025-01-15T16:31:15.125+0800
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_kv_namespace @module=sdk.framework tf_attribute_path=AttributeName("id") tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 timestamp=2025-01-15T16:31:15.125+0800
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("supports_url_encoding") tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 timestamp=2025-01-15T16:31:15.125+0800
cloudflare_workers_kv_namespace.workers_kv_namespace: Creating...
2025-01-15T16:31:15.125+0800 [INFO] Starting apply for cloudflare_workers_kv_namespace.workers_kv_namespace
2025-01-15T16:31:15.126+0800 [DEBUG] cloudflare_workers_kv_namespace.workers_kv_namespace: applying the planned Create change
2025-01-15T16:31:15.127+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1:
POST /client/v4/accounts/xxxxxxxx/storage/kv/namespaces HTTP/1.1

x-stainless-lang: Terraform
accept: application/json
x-stainless-package-version: 5.0.0-rc1
x-stainless-runtime-version: 1.13.0
x-stainless-retry-count: 0
user-agent: terraform-provider-cloudflare/5.0.0-rc1 terraform-plugin-framework/1.13.0 terraform/1.5.7
x-stainless-runtime: terraform-plugin-framework
x-stainless-os: MacOS
authorization: [redacted]
content-type: application/json
x-stainless-arch: arm64

{"title":"test"}

: tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 @module=cloudflare tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/logging/logging.go:64 tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=ApplyResourceChange timestamp=2025-01-15T16:31:15.127+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:217 @module=sdk.framework tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("etag") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("placement") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_attribute_path=AttributeName("placement_status") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("usage_model") @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("tail_consumers") tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("placement_mode") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("modified_on") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_attribute_path=AttributeName("startup_time_ms") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("has_modules") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @module=sdk.framework tf_attribute_path=AttributeName("id") @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_attribute_path=AttributeName("observability") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_attribute_path=AttributeName("has_assets") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 @module=sdk.framework tf_attribute_path=AttributeName("migrations") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_attribute_path=AttributeName("logpush") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.136+0800
cloudflare_workers_script.example_workers_script: Creating...
2025-01-15T16:31:15.142+0800 [INFO] Starting apply for cloudflare_workers_script.example_workers_script
2025-01-15T16:31:15.142+0800 [DEBUG] skipping FixUpBlockAttrs
2025-01-15T16:31:15.143+0800 [DEBUG] cloudflare_workers_script.example_workers_script: applying the planned Create change
2025-01-15T16:31:15.145+0800 [ERROR] provider.terraform-provider-cloudflare_v5.0.0-rc1: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov6/internal/diag/diagnostics.go:58 diagnostic_attribute= tf_proto_version=6.7 tf_rpc=ApplyResourceChange @module=sdk.proto tf_provider_addr=registry.terraform.io/cloudflare/cloudflare diagnostic_detail="An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the provider developer:

mismatch between struct and object: Object defines fields not found in struct: etag, placement_status, modified_on, startup_time_ms, placement_mode, has_modules, and has_assets." diagnostic_severity=ERROR diagnostic_summary="Value Conversion Error" tf_req_id=2020e7ea-d4e6-d2ce-f8fc-a1470d666433 tf_resource_type=cloudflare_workers_script timestamp=2025-01-15T16:31:15.145+0800
2025-01-15T16:31:15.155+0800 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2025-01-15T16:31:15.155+0800 [ERROR] vertex "cloudflare_workers_script.example_workers_script" error: Value Conversion Error
2025-01-15T16:31:19.366+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1:
< HTTP/2.0 200 OK
< date: Wed, 15 Jan 2025 08:31:19 GMT
< cf-cache-status: DYNAMIC
< set-cookie: __cflb=0H28vgHxwvgAQtjUGU4yFBDJQfw1pfzuUqbBSnb5jw3; SameSite=Lax; path=/; expires=Wed, 15-Jan-25 11:01:20 GMT; HttpOnly
< set-cookie: __cf_bm=6I6CLtjY.NLg3ZWAEUTK7bab5gl4jOi_l5VksZSSj8k-1736929879-1.0.1.1-NUMUtSaEWPi55nJrepEg7K7Y4sgDjrg_VhXSnluta9wK8LHIvMgQYhc.0pfpzB2YIRlr9jfZ.p25f0ehZsk7FA; path=/; expires=Wed, 15-Jan-25 09:01:19 GMT; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
< set-cookie: __cfruid=7ee4140f208f57e8fa84a86497998e7e62bce786-1736929879; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
< vary: Accept-Encoding
< server: cloudflare
< content-type: application/json; charset=UTF-8
< cf-ray: 9024822fcb409cd1-SIN
< cache-control: no-store, no-cache, must-revalidate
< cf-auditlog-id: 01946916-99f6-7e72-9e6a-226b0df3cc37
<

{
"result": {
"id": "c7d588be7e354bb88f223b3db2dd8f25",
"title": "test",
"supports_url_encoding": true
},
"success": true,
"errors": [],
"messages": []
}

: tf_rpc=ApplyResourceChange @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/logging/logging.go:92 @module=cloudflare tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace timestamp=2025-01-15T16:31:19.366+0800
2025-01-15T16:31:19.367+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Value switched to prior value due to semantic equality logic: @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwschemadata/value_semantic_equality.go:91 tf_attribute_path=title tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=ApplyResourceChange timestamp=2025-01-15T16:31:19.366+0800
cloudflare_workers_kv_namespace.workers_kv_namespace: Creation complete after 4s [id=c7d588be7e354bb88f223b3db2dd8f25]
2025-01-15T16:31:19.370+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Value switched to prior value due to semantic equality logic: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace tf_attribute_path=account_id @module=sdk.framework tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwschemadata/value_semantic_equality.go:91 timestamp=2025-01-15T16:31:19.367+0800
2025-01-15T16:31:19.376+0800 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot

│ Error: Value Conversion Error

│ with cloudflare_workers_script.example_workers_script,
│ An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the
│ provider developer:

│ mismatch between struct and object: Object defines fields not found in struct: etag, placement_status, modified_on, startup_time_ms, placement_mode, has_modules, and has_assets.

2025-01-15T16:31:19.389+0800 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2025-01-15T16:31:19.392+0800 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 pid=43261
2025-01-15T16:31:19.392+0800 [DEBUG] provider: plugin exited

Panic output

cloudflare_workers_kv_namespace.workers_kv_namespace: Creating...
cloudflare_workers_script.example_workers_script: Creating...
cloudflare_workers_kv_namespace.workers_kv_namespace: Creation complete after 5s [id=969df8d80dbb4587902740aedc58e1ef]

│ Error: Value Conversion Error

│ with cloudflare_workers_script.example_workers_script,
│ An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the
│ provider developer:

│ mismatch between struct and object: Object defines fields not found in struct: startup_time_ms, etag, has_assets, placement_mode, modified_on, has_modules, and placement_status.

Expected output

terraform apply successfully

Actual output

cloudflare_workers_kv_namespace.workers_kv_namespace: Creating...
cloudflare_workers_script.example_workers_script: Creating...
cloudflare_workers_kv_namespace.workers_kv_namespace: Creation complete after 5s [id=969df8d80dbb4587902740aedc58e1ef]

│ Error: Value Conversion Error

│ with cloudflare_workers_script.example_workers_script,
│ An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the
│ provider developer:

│ mismatch between struct and object: Object defines fields not found in struct: startup_time_ms, etag, has_assets, placement_mode, modified_on, has_modules, and placement_status.

Steps to reproduce

  1. add provider.tf
    `terraform {
    required_providers {
    cloudflare = {
    source = "cloudflare/cloudflare"
    version = "5.0.0-rc1"
    }
    }
    }

provider "cloudflare" {
api_token = "xxxxxx"

}2. add main.tf
resource "cloudflare_workers_kv_namespace" "workers_kv_namespace" {
account_id = "xxxxxxxx"
title = "test"

}

resource "cloudflare_workers_script" "example_workers_script" {
account_id = "xxxxxxxx"
script_name = "test"
content = file("index.js")

assets = {
  config = {
    html_handling = "auto-trailing-slash"
    not_found_handling = "none"
    serve_directly = true
  }
  jwt = "jwt"
}
bindings = [{
  name = "MY_ENV_VAR"
  type = "plain_text"
}]
compatibility_date = "2025-01-10"
compatibility_flags = ["nodejs_compat_v2"]

}`

  1. terrraform init && terraform apply

Additional factoids

No response

References

No response

@shengjiangfeng shengjiangfeng added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 15, 2025
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

Copy link
Contributor

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 15, 2025
@shengjiangfeng
Copy link
Author

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

2025-01-15T16:31:15.018+0800 [INFO] backend/local: apply calling Apply
2025-01-15T16:31:15.018+0800 [DEBUG] Building and walking apply graph for NormalMode plan
2025-01-15T16:31:15.018+0800 [DEBUG] Resource state not found for node "cloudflare_workers_kv_namespace.workers_kv_namespace", instance cloudflare_workers_kv_namespace.workers_kv_namespace
2025-01-15T16:31:15.018+0800 [DEBUG] Resource state not found for node "cloudflare_workers_script.example_workers_script", instance cloudflare_workers_script.example_workers_script
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_script.example_workers_script" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.018+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_script.example_workers_script (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.019+0800 [DEBUG] ProviderTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace (expand)" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_script.example_workers_script (expand)" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "output.name (expand)" references: [cloudflare_workers_kv_namespace.workers_kv_namespace (expand) cloudflare_workers_kv_namespace.workers_kv_namespace cloudflare_workers_kv_namespace.workers_kv_namespace]
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_kv_namespace.workers_kv_namespace" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "cloudflare_workers_script.example_workers_script" references: []
2025-01-15T16:31:15.019+0800 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/cloudflare/cloudflare"]" references: []
2025-01-15T16:31:15.020+0800 [DEBUG] Starting graph walk: walkApply
2025-01-15T16:31:15.021+0800 [DEBUG] created provider logger: level=debug
2025-01-15T16:31:15.021+0800 [INFO] provider: configuring client automatic mTLS
2025-01-15T16:31:15.025+0800 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1]
2025-01-15T16:31:15.030+0800 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 pid=43261
2025-01-15T16:31:15.030+0800 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1
2025-01-15T16:31:15.053+0800 [INFO] provider.terraform-provider-cloudflare_v5.0.0-rc1: configuring server automatic mTLS: timestamp=2025-01-15T16:31:15.053+0800
2025-01-15T16:31:15.060+0800 [DEBUG] provider: using plugin: version=6
2025-01-15T16:31:15.060+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: plugin address: address=/var/folders/k6/n67v29s97t9g64gp2zd081m80000gq/T/plugin585257130 network=unix timestamp=2025-01-15T16:31:15.060+0800
2025-01-15T16:31:15.107+0800 [DEBUG] No provider meta schema returned
2025-01-15T16:31:15.122+0800 [DEBUG] skipping FixUpBlockAttrs
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:217 tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 tf_resource_type=cloudflare_workers_kv_namespace timestamp=2025-01-15T16:31:15.125+0800
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_kv_namespace @module=sdk.framework tf_attribute_path=AttributeName("id") tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 timestamp=2025-01-15T16:31:15.125+0800
2025-01-15T16:31:15.125+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("supports_url_encoding") tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=887d290a-a7bc-4bb0-c100-debb56a704c6 timestamp=2025-01-15T16:31:15.125+0800
cloudflare_workers_kv_namespace.workers_kv_namespace: Creating...
2025-01-15T16:31:15.125+0800 [INFO] Starting apply for cloudflare_workers_kv_namespace.workers_kv_namespace
2025-01-15T16:31:15.126+0800 [DEBUG] cloudflare_workers_kv_namespace.workers_kv_namespace: applying the planned Create change
2025-01-15T16:31:15.127+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1:
POST /client/v4/accounts/xxxxxxxx/storage/kv/namespaces HTTP/1.1

x-stainless-lang: Terraform
accept: application/json
x-stainless-package-version: 5.0.0-rc1
x-stainless-runtime-version: 1.13.0
x-stainless-retry-count: 0
user-agent: terraform-provider-cloudflare/5.0.0-rc1 terraform-plugin-framework/1.13.0 terraform/1.5.7
x-stainless-runtime: terraform-plugin-framework
x-stainless-os: MacOS
authorization: [redacted]
content-type: application/json
x-stainless-arch: arm64

{"title":"test"}

: tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 @module=cloudflare tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/logging/logging.go:64 tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=ApplyResourceChange timestamp=2025-01-15T16:31:15.127+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:217 @module=sdk.framework tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("etag") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("placement") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_attribute_path=AttributeName("placement_status") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("usage_model") @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.135+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("tail_consumers") tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_attribute_path=AttributeName("placement_mode") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("modified_on") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_attribute_path=AttributeName("startup_time_ms") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare timestamp=2025-01-15T16:31:15.135+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_attribute_path=AttributeName("has_modules") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @module=sdk.framework tf_attribute_path=AttributeName("id") @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @module=sdk.framework tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_attribute_path=AttributeName("observability") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 @module=sdk.framework tf_attribute_path=AttributeName("has_assets") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 @module=sdk.framework tf_attribute_path=AttributeName("migrations") tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_resource_type=cloudflare_workers_script tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.136+0800
2025-01-15T16:31:15.136+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: marking computed attribute that is null in the config as unknown: @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwserver/server_planresourcechange.go:467 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_resource_type=cloudflare_workers_script @module=sdk.framework tf_attribute_path=AttributeName("logpush") tf_req_id=ca7ef130-d6fb-93d7-22d4-b49d834a0132 tf_rpc=PlanResourceChange timestamp=2025-01-15T16:31:15.136+0800
cloudflare_workers_script.example_workers_script: Creating...
2025-01-15T16:31:15.142+0800 [INFO] Starting apply for cloudflare_workers_script.example_workers_script
2025-01-15T16:31:15.142+0800 [DEBUG] skipping FixUpBlockAttrs
2025-01-15T16:31:15.143+0800 [DEBUG] cloudflare_workers_script.example_workers_script: applying the planned Create change
2025-01-15T16:31:15.145+0800 [ERROR] provider.terraform-provider-cloudflare_v5.0.0-rc1: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov6/internal/diag/diagnostics.go:58 diagnostic_attribute= tf_proto_version=6.7 tf_rpc=ApplyResourceChange @module=sdk.proto tf_provider_addr=registry.terraform.io/cloudflare/cloudflare diagnostic_detail="An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the provider developer:

mismatch between struct and object: Object defines fields not found in struct: etag, placement_status, modified_on, startup_time_ms, placement_mode, has_modules, and has_assets." diagnostic_severity=ERROR diagnostic_summary="Value Conversion Error" tf_req_id=2020e7ea-d4e6-d2ce-f8fc-a1470d666433 tf_resource_type=cloudflare_workers_script timestamp=2025-01-15T16:31:15.145+0800
2025-01-15T16:31:15.155+0800 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2025-01-15T16:31:15.155+0800 [ERROR] vertex "cloudflare_workers_script.example_workers_script" error: Value Conversion Error
2025-01-15T16:31:19.366+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1:
< HTTP/2.0 200 OK
< date: Wed, 15 Jan 2025 08:31:19 GMT
< cf-cache-status: DYNAMIC
< set-cookie: __cflb=0H28vgHxwvgAQtjUGU4yFBDJQfw1pfzuUqbBSnb5jw3; SameSite=Lax; path=/; expires=Wed, 15-Jan-25 11:01:20 GMT; HttpOnly
< set-cookie: __cf_bm=6I6CLtjY.NLg3ZWAEUTK7bab5gl4jOi_l5VksZSSj8k-1736929879-1.0.1.1-NUMUtSaEWPi55nJrepEg7K7Y4sgDjrg_VhXSnluta9wK8LHIvMgQYhc.0pfpzB2YIRlr9jfZ.p25f0ehZsk7FA; path=/; expires=Wed, 15-Jan-25 09:01:19 GMT; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
< set-cookie: __cfruid=7ee4140f208f57e8fa84a86497998e7e62bce786-1736929879; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
< vary: Accept-Encoding
< server: cloudflare
< content-type: application/json; charset=UTF-8
< cf-ray: 9024822fcb409cd1-SIN
< cache-control: no-store, no-cache, must-revalidate
< cf-auditlog-id: 01946916-99f6-7e72-9e6a-226b0df3cc37
<

{
"result": {
"id": "c7d588be7e354bb88f223b3db2dd8f25",
"title": "test",
"supports_url_encoding": true
},
"success": true,
"errors": [],
"messages": []
}

: tf_rpc=ApplyResourceChange @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/logging/logging.go:92 @module=cloudflare tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace timestamp=2025-01-15T16:31:19.366+0800
2025-01-15T16:31:19.367+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Value switched to prior value due to semantic equality logic: @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwschemadata/value_semantic_equality.go:91 tf_attribute_path=title tf_provider_addr=registry.terraform.io/cloudflare/cloudflare @module=sdk.framework tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace tf_rpc=ApplyResourceChange timestamp=2025-01-15T16:31:19.366+0800
cloudflare_workers_kv_namespace.workers_kv_namespace: Creation complete after 4s [id=c7d588be7e354bb88f223b3db2dd8f25]
2025-01-15T16:31:19.370+0800 [DEBUG] provider.terraform-provider-cloudflare_v5.0.0-rc1: Value switched to prior value due to semantic equality logic: tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=9f6db453-4b8b-a002-1cf6-4bda46761289 tf_resource_type=cloudflare_workers_kv_namespace tf_attribute_path=account_id @module=sdk.framework tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-framework@v1.13.0/internal/fwschemadata/value_semantic_equality.go:91 timestamp=2025-01-15T16:31:19.367+0800
2025-01-15T16:31:19.376+0800 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot

│ Error: Value Conversion Error

│ with cloudflare_workers_script.example_workers_script,
│ An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the
│ provider developer:

│ mismatch between struct and object: Object defines fields not found in struct: etag, placement_status, modified_on, startup_time_ms, placement_mode, has_modules, and has_assets.

2025-01-15T16:31:19.389+0800 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2025-01-15T16:31:19.392+0800 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/5.0.0-rc1/darwin_arm64/terraform-provider-cloudflare_v5.0.0-rc1 pid=43261
2025-01-15T16:31:19.392+0800 [DEBUG] provider: plugin exited

@shengjiangfeng
Copy link
Author

When set TF_LOG=DEBUG, i execute terraform apply , then i got the error .

@thomasjiangcy
Copy link

I'm getting a similar issue:

�Terraform v1.10.4
on linux_amd64
Initializing plugins and modules...
{"@level":"info","@message":"Terraform 1.10.4","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:38.940682Z","terraform":"1.10.4","type":"version","ui":"1.2"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Plan to create","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.302367Z","change":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create"},"type":"planned_change"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Plan to create","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.302484Z","change":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create"},"type":"planned_change"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Creating...","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.421582Z","hook":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create"},"type":"apply_start"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Creating...","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.421742Z","hook":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create"},"type":"apply_start"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Creation errored after 0s","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.425187Z","hook":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create","elapsed_seconds":0},"type":"apply_errored"}
{"@level":"info","@message":"cloudflare_workers_script.[REDACTED]: Creation errored after 0s","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.425245Z","hook":{"resource":{"addr":"cloudflare_workers_script.[REDACTED]","module":"","resource":"cloudflare_workers_script.[REDACTED]","implied_provider":"cloudflare","resource_type":"cloudflare_workers_script","resource_name":"[REDACTED]","resource_key":null},"action":"create","elapsed_seconds":0},"type":"apply_errored"}
{"@level":"error","@message":"Error: Value Conversion Error","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.959420Z","diagnostic":{"severity":"error","summary":"Value Conversion Error","detail":"An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the provider developer:\n\nmismatch between struct and object: Object defines fields not found in struct: has_assets, placement_mode, has_modules, etag, modified_on, placement_status, and startup_time_ms.","address":"cloudflare_workers_script.[REDACTED]"},"type":"diagnostic"}
{"@level":"error","@message":"Error: Value Conversion Error","@module":"terraform.ui","@timestamp":"2025-01-16T19:13:41.959615Z","diagnostic":{"severity":"error","summary":"Value Conversion Error","detail":"An unexpected error was encountered trying to convert tftypes.Value into workers_script.WorkersScriptModel. This is always an error in the provider. Please report the following to the provider developer:\n\nmismatch between struct and object: Object defines fields not found in struct: startup_time_ms, modified_on, has_modules, has_assets, placement_status, etag, and placement_mode.","address":"cloudflare_workers_script.[REDACTED]"},"type":"diagnostic"}
Operation failed: failed running terraform apply (exit 1)�

It looks like the response from the API doesn't match the shape of the struct:

type WorkersScriptModel struct {
ID types.String `tfsdk:"id" json:"-,computed"`
ScriptName types.String `tfsdk:"script_name" path:"script_name,required"`
AccountID types.String `tfsdk:"account_id" path:"account_id,required"`
// Message types.String `tfsdk:"message" json:"message,optional"`
Content types.String `tfsdk:"content" json:"content,required"`
// CreatedOn timetypes.RFC3339 `tfsdk:"created_on" json:"created_on,computed" format:"date-time"`
// Etag types.String `tfsdk:"etag" json:"etag,computed"`
// HasAssets types.Bool `tfsdk:"has_assets" json:"has_assets,computed"`
// HasModules types.Bool `tfsdk:"has_modules" json:"has_modules,computed"`
// ModifiedOn timetypes.RFC3339 `tfsdk:"modified_on" json:"modified_on,computed" format:"date-time"`
// StartupTimeMs types.Int64 `tfsdk:"startup_time_ms" json:"startup_time_ms,computed"`
WorkersScriptMetadataModel
}

@shengjiangfeng
Copy link
Author

There is nobody can help..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants