Open AlexVasiukov opened 2 months ago
Thanks for reporting this issue @AlexVasiukov! We did fix #318 and #293 in 1.70.0 (context).
Could you try to run terraform refresh -target=confluent_schema.avas-sbx-value-1
(make sure to create a backup for your TF state file before running this command)? Thank you!
@linouk23, sure, here is an output:
terraform refresh -target=confluent_schema.avas-sbx-value-1 -var-file=local-variables.tfvars -state=avas-sbx.json
╷
│ Warning: Resource targeting is in effect
│
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration.
│
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically
│ suggests to use it as part of an error message.
╵
╷
│ Error: error updating Schema "lsrc-abcdef/avas-sbx-value/100123": reimport the current resource instance and set recreate_on_update = false to evolve a schema using the same resource instance.
│ In this case, on an update resource instance will reference the updated (latest) schema by overriding schema_identifier, schema and version attributes and the old schema will be orphaned.
│
│ with confluent_schema.avas-sbx-value-1,
│ on main.tf line 17, in resource "confluent_schema" "avas-sbx-value-1":
│ 17: resource "confluent_schema" "avas-sbx-value-1" {
│
╵
The full debug could be found in attach tf-refresh.txt
Hi @linouk23, Do you have any updates regarding this issue?
Some _confluentschema deployed resources became corrupted starting from provider version 1.70.0.
Example: main.tf:
avas-sbx-value-v1.schema.json:
variables.tf:
terraform init/terraform plan passed successfully. If we will bump provider version from 1.68.0 to 1.70.0 - we will receive the error for terraform plan:
state file (partially masked):
I also noticed that the error may be resolved by compressing schema file in terraform and state (schema section): avas-sbx-value-v1.schema.json:
state:
^^ In this case terraform plan runs without errors. The check appears to have failed due to space/line break characters.