You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We faced a strange bug that prevents us from upgrading from Terraform v0.15.4 to v1.0.3.
With v0.15.4 we can't reproduce the bug, with v1.0.3 we can. So the bug was introduced after v0.15.4.
EDIT: See my comment, bug seems to be there since v1.0.2
Imho it is a critical one as it leads to unexpected behavior for each apply.
Terraform Version
Terraform v1.0.3
on linux_amd64
Terraform Configuration Files
locals {
val =64-4
val2 =floor(local.val)
}
output"val" {
value =local.val
}
Expected Behavior
Output val should have the exact value 60.
Actual Behavior
Sometimes the output val has the value 60, sometimes it has a lot of decimals, e.g. 60.00000000000000000325260651745651330202235840260982513427734375
Steps to Reproduce
Call terraform apply -auto-approve multiple times, the output val will have different values.
If you remove the line val2 = floor(local.val) the output val will be stable. Thus it seems that the local val will somehow be changed when using floor (or ceil) on it.. I would expect the local is constant and can't be changed by some other expression.
You can also change val to val = 64 (remove the subtraction) and then it keeps stable. So substracting numbers and then using floor/ceil seems to make trouble.
The text was updated successfully, but these errors were encountered:
@jbardin : Thanks a lot for the fix. What is the usual approach with bugs in other libraries? As the PR was merged in go-cty project, will this dependency updated directly or is there a new go-cty release required? The last one was in 2020, so I don't know about the release train there.. hopefully it will not take a long time until they do a bugfix release.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
We faced a strange bug that prevents us from upgrading from Terraform v0.15.4 to v1.0.3.
With v0.15.4 we can't reproduce the bug, with v1.0.3 we can. So the bug was introduced after v0.15.4.
EDIT: See my comment, bug seems to be there since v1.0.2
Imho it is a critical one as it leads to unexpected behavior for each apply.
Terraform Version
Terraform Configuration Files
Expected Behavior
Output
val
should have the exact value60
.Actual Behavior
Sometimes the output
val
has the value60
, sometimes it has a lot of decimals, e.g.60.00000000000000000325260651745651330202235840260982513427734375
Steps to Reproduce
Call
terraform apply -auto-approve
multiple times, the outputval
will have different values.If you remove the line
val2 = floor(local.val)
the outputval
will be stable. Thus it seems that the localval
will somehow be changed when usingfloor
(orceil
) on it.. I would expect the local is constant and can't be changed by some other expression.You can also change
val
toval = 64
(remove the subtraction) and then it keeps stable. So substracting numbers and then usingfloor
/ceil
seems to make trouble.The text was updated successfully, but these errors were encountered: