-
Notifications
You must be signed in to change notification settings - Fork 554
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
Disk: bool is required #702
Comments
Version: 2.9.13
Output:
This used to work. |
I'm having the same problem. Anything new regarding this? |
The backup option was changed to a bool with this PR included in 2.9.13: #669 |
Hi @n8rade: I did try changing the value to "true" and I still get the same error. It seems to not accept any kind of value - at least for me. |
Since it doesn't seem to be recognizing "true" as a bool for whatever reason can you try defining the variable as so?
And see if that might work better? I would expect it to convert the type automatically but for whatever reason that doesn't seem to be working in you case: https://developer.hashicorp.com/terraform/language/expressions/types#type-conversion |
The issue is that the saved state contains the integer still. This breaking change could have been handled better tbh. |
Then, do we have to modify the state file to modify this flag somehow? |
@angelbarrera92 I had this issue, breaking change should have taken the version up to 2.x.x so people were aware but hey ho not much we can do about that :) I updated the state file and it worked for me. |
How you did it? |
Just edited the terraform.state file directly changed the 0 to false. |
I downgraded to 2.9.11, changing the state is not really a good option for us right now. |
I can confirm changing in the terraform state file worked for me: Steps I`ve followed: $ terraform state pull > backup.state
$ cp backup.state new.state Then, modify
$ terraform state push new.state Check everything is working fine by re-running: |
As a user, I would like version v2.9.13 and later to be able to use terraform.tfstate files created with v2.9.11 and earlier. I'm not really a Go programmer, but it looks like there's a StateFun attribute that can be added to the backup parameter which could convert from a number to a boolean if necessary. If I understand everything correctly, that should fix this issue. The code should accept integers or booleans for the input, and only store and output boolean values. We just need someone who can write Go (or at least someone who is willing to hack it out and has a test environment to verify things work as expected) to make the change. My test environment is currently called "production", so I do not qualify for this task at this time. |
This issue is stale because it has been open for 60 days with no activity. Please update the provider to the latest version and, in the issue persist, provide full configuration and debug logs |
This issue is stale because it has been open for 60 days with no activity. Please update the provider to the latest version and, in the issue persist, provide full configuration and debug logs |
Dear @github-actions: please do not remove issues from the backlog just because nobody has gotten to them yet. |
This is in my queue to investigate after #687. My plan is to:
At that point, I should be in that wedged state. From there, I'll branch off of the latest working commit (currently 4c0c8fc) and see if I can create a patch to automatically convert from a zero to a "false". If my patch works, I should be able to deploy the VM without making any manual changes to terraform state files. |
I deployed this small example with v2.9.11 of the provider (I did have to change the Then I updated the terrafor to use v3.0.1-rc1, and did When I then ran |
I've submitted a patch that fixes this error without having to manually change any tfstate files. I do not expect that it will make the 3.0.1 release, as that already has a release candidate that is in testing. Hopefully this will be included in the following release, which will probably be 3.0.2. |
…mate#702 (Telmate#923) * fix: enable new versions of providers to run on old tfstate files Telmate#702 * feat: re-applying patch to restore backward compatibility with tfstate files --------- Co-authored-by: hestia <hestia@hax0rbana.org>
…mate#702 (Telmate#923) * fix: enable new versions of providers to run on old tfstate files Telmate#702 * feat: re-applying patch to restore backward compatibility with tfstate files --------- Co-authored-by: hestia <hestia@hax0rbana.org>
I upgrade from Version v2.9.11 -> v2.9.13 and now get an error
Error: bool is required
disk {
with TF_Log=DEBUG get his error message. looks like "AttributeName("backup") " becomes mandatory.
[ERROR] provider.terraform-provider-proxmox_v2.9.13: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 tf_req_id=8a1111f2-24fa-086b-11cc-a35d385b9ccb @module=sdk.proto diagnostic_detail= diagnostic_summary="bool is required" tf_provider_addr=registry.terraform.io/telmate/proxmox tf_resource_type=proxmox_vm_qemu diagnostic_attribute=AttributeName("disk").ElementKeyInt(0).AttributeName("backup") tf_proto_version=5.3 tf_rpc=UpgradeResourceState diagnostic_severity=ERROR timestamp=2023-02-23T23:16:04.584+0100
Rollback to version v2.9.11 works fine
The text was updated successfully, but these errors were encountered: