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

Error when “@cluster_group” is specified for target #546

Open
tam1192 opened this issue Nov 29, 2024 · 2 comments
Open

Error when “@cluster_group” is specified for target #546

tam1192 opened this issue Nov 29, 2024 · 2 comments
Labels

Comments

@tam1192
Copy link

tam1192 commented Nov 29, 2024

Error Description

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to lxd_instance.backup, provider "provider[\"registry.terraform.io/terraform-lxd/lxd\"]" produced an unexpected new value: .target: was cty.StringVal("@gpu"), but now cty.StringVal("node-2").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

environment

terraform version
Terraform v1.6.3-dev
on linux_amd64
+ provider registry.terraform.io/terraform-lxd/lxd v2.4.0

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html
uname -a
Linux nikki-main 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux

what should happen?

No more errors.

What we tried

Tentatively specifying by node name avoids errors.
If there's anything you'd like me to try, let me know.

@MusicDin
Copy link
Member

Hmm, yeah that one is interesting.

Could you check the result after failure? I'm guessing the instance was created within the expected group (@gpu), but the provider updates the state with the actual instance location which causes the inconsistent result.

If this is the case, we just need to introduce the field location which would track exact location, and target would be used just for user input (as we already do on some resources).

@tam1192
Copy link
Author

tam1192 commented Dec 3, 2024

Sorry for the delay in replying.
I get the above error and the terraform process ends, though,
In fact, an instance exists.

Here is its condition.

lxc ls
+---------------+---------+-----------------------+-------------------------------------------------+-----------------+-----------+----------+
|     NAME      |  STATE  |         IPV4          |                      IPV6                       |      TYPE       | SNAPSHOTS | LOCATION |
+---------------+---------+-----------------------+-------------------------------------------------+-----------------+-----------+----------+
| ex-instance-0 | RUNNING | 192.168.1.10 (enp5s0) | fd42:f573:2540:b54d:216:3eff:fe2d:ee46 (enp5s0) | VIRTUAL-MACHINE | 0         | node-2   |
+---------------+---------+-----------------------+-------------------------------------------------+-----------------+-----------+----------+

@MusicDin MusicDin added the bug label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants