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
HTTP 500
on some resources when reinstalling Proxmox
#1152
Comments
Hi @aleprovencio! 👋🏼 Was there any error messages reported by PVE? These issues are quite hard to debug without reproducing, which means quite a bit of efforts with reinstalling PVE. So any additional details is really appreciated. In general, if you reset the remote state of the resource (i.e. deleted the resource outside of terraform), the local TF state should be also deleted, so there is no inconsistency or "state drift" for the provider to reconcile. |
Hello @bpg, thanks for the reply and of course, also for this awesome project. It does makes sense to me that I should probably remove all However I still would like to understand why resources like Regarding errors, I don't see anything special on |
It looks like the affected resource are "compound resources", i.e. they have references to other separate proxmox entities that are on different API paths. When provider applies a change, first it has to read the resource state from the remote to detect the "drift". I think there are logical or implementation bugs in those resources,they probably are trying to read the dependent objects first (like ACLs for a user, or rules for a security group) using the "parent" object ID as a request criteria. Those parents do not exist, and requests fail. That's my hypothesis, without any actual debugging. There is definitely something in the provider's implementation that can be improved in this regard, though a proper investigation is needed to make a fix. |
Yeah I guess you are on the right path. I've done a new test where I did remove those resources from state, reinstalled |
Describe the bug
I have several resources created by this provider on a node, but when reinstalling
Proxmox
on it and trying to getting it back to the previous state by applyingterraform
, although it works fine for most resources I have found a few problems.I'm unsure whether I should have done prior modifications on
terraform
's state, because I did not, butterraform
recreates all resources (VM
,containers
, etc) and returnsHTTP 500
errors on the following:proxmox_virtual_environment_group
proxmox_virtual_environment_user
proxmox_virtual_environment_role
proxmox_virtual_environment_cluster_firewall_security_group
To Reproduce
Steps to reproduce the behavior:
terraform apply
Proxmox
terraform apply
Please also provide a minimal Terraform configuration that reproduces the issue.
Expected behavior
Resources are recreated like the other ones
Additional context
Add any other context about the problem here.
Archlinux
TF_LOG=DEBUG terraform apply
):The text was updated successfully, but these errors were encountered: