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

Number numeric attribute plan modifier failed error on 3.4.0 #299

Closed
1 task done
ericzarcone opened this issue Aug 30, 2022 · 15 comments
Closed
1 task done

Number numeric attribute plan modifier failed error on 3.4.0 #299

ericzarcone opened this issue Aug 30, 2022 · 15 comments
Assignees
Labels

Comments

@ericzarcone
Copy link

Terraform CLI and Provider Versions

  • random provider version 3.4.0
  • Terraform v1.1.0

Terraform Configuration

resource "random_password" "password" {
  length           = 16
  override_special = "_%$!"
}

Expected Behavior

No changes are detected to the previously created random password resource.

Actual Behavior

Error: Number numeric attribute plan modifier failed
│ 
│   with module.app_db.random_password.password,
│   on ../../../../infrastructure/rds/rds.tf line 1, in resource "random_password" "password":
│    1: resource "random_password" "password" {
│ 
│ Cannot specify both number and numeric in config

The following error is received as part of the plan

Steps to Reproduce

  1. Install latest version of the random provider
  2. terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

Reverting back to v3.3.2 resolves the issues.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ericzarcone ericzarcone changed the title Number numeric attribute plan modifier failed error on 3.4.0 Number numeric attribute plan modifier failed error on 3.4.0 Aug 30, 2022
@lra
Copy link

lra commented Aug 30, 2022

We experienced the problem and can reproduce it if you need help fixing it.
For now we'll stick to 3.3.2.

@NJITman
Copy link

NJITman commented Aug 30, 2022

Confirmed as well - broke several of our projects today, reverted to 3.3.2.

@bflad bflad self-assigned this Aug 30, 2022
@bflad
Copy link
Contributor

bflad commented Aug 30, 2022

Hi @lra 👋 Thank you for the offer. Could you share your reproduction?

I'm unable to reproduce with this configuration:

resource "random_password" "password" {
  length           = 16
  override_special = "_%$!"
}

By first applying it with 3.3.2 then again with 3.4.0.

@bflad
Copy link
Contributor

bflad commented Aug 30, 2022

Also @ericzarcone if you are actually running on v1.1.0 of Terraform, you may want to upgrade to at least v1.1.2 as soon as possible.

@NJITman
Copy link

NJITman commented Aug 31, 2022

Terraform v1.2.8
on windows_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.22.0
+ provider registry.terraform.io/dopplerhq/doppler v1.0.0
+ provider registry.terraform.io/hashicorp/aws v4.28.0
+ provider registry.terraform.io/hashicorp/random v3.4.0
+ provider registry.terraform.io/mongodb/mongodbatlas v1.4.3
# Random Access Token
resource "random_password" "access-token" {
  length           = 16
  special          = true
  override_special = "_!%^"
  lifecycle {
    ignore_changes = all
  }
}
Error: Number numeric attribute plan modifier failed

  with random_password.access-token,
  on service-waf.tf line 8, in resource "random_password" "access-token":
   8: resource "random_password" "access-token" {

Cannot specify both number and numeric in config

After changing to 3.3.2, the error is removed.

Terraform v1.2.8
on windows_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.22.0
+ provider registry.terraform.io/dopplerhq/doppler v1.0.0
+ provider registry.terraform.io/hashicorp/aws v4.28.0
+ provider registry.terraform.io/hashicorp/random v3.3.2
+ provider registry.terraform.io/mongodb/mongodbatlas v1.4.3

@terencewhitenz
Copy link

+1 confirmed broken on our environment as well, same symptoms.

@bendbennett
Copy link
Contributor

@ericzarcone 👋, unfortunately I cannot reproduce the issue using the configuration you supplied. Are you able to let us see the complete configuration that you are using?

@NJITman 👋, thank you for the reproduction. Using the configuration you supplied I can reproduce the issue.

@lra
Copy link

lra commented Aug 31, 2022

Here's an example of a random_password resource replacement due to the upgrade.

Prior to upgrade:

Terraform v1.2.8
on darwin_arm64
+ provider registry.terraform.io/hashicorp/random v3.3.2
resource "random_password" "prod_az_eastus_raptor_pg_ns" {
  length = 20
}
$ terraform plan
No changes. Your infrastructure matches the configuration.
$ terraform state show random_password.prod_az_eastasia_bison_pg_ns
# random_password.prod_az_eastasia_bison_pg_ns:
resource "random_password" "prod_az_eastasia_bison_pg_ns" {
    bcrypt_hash = (sensitive value)
    id          = "none"
    result      = (sensitive value)
}

Post upgrade to 3.4.0:

Terraform v1.2.8
on darwin_arm64
+ provider registry.terraform.io/hashicorp/random v3.4.0
$ terraform plan

Terraform will perform the following actions:

  # random_password.prod_az_eastasia_bison_pg_ns must be replaced
-/+ resource "random_password" "prod_az_eastasia_bison_pg_ns" {
      ~ bcrypt_hash      = (sensitive value)
      ~ id               = "none" -> (known after apply)
      + length           = 16
      + lower            = true # forces replacement
      + min_lower        = 0 # forces replacement
      + min_numeric      = 0 # forces replacement
      + min_special      = 0 # forces replacement
      + min_upper        = 0 # forces replacement
      + number           = true # forces replacement
      + numeric          = true # forces replacement
      + override_special = (known after apply)
      ~ result           = (sensitive value)
      + special          = true # forces replacement
      + upper            = true # forces replacement
    }

Plan: 1 to add, 0 to change, 1 to destroy.

We have plenty of other occurrences by I guess they are all due to the same reasons.

@bflad bflad assigned bendbennett and unassigned bflad Aug 31, 2022
@bendbennett
Copy link
Contributor

@ericzarcone @NJITman can you confirm whether the issue you described persists with v3.4.1. Thanks!

@NJITman
Copy link

NJITman commented Aug 31, 2022

3.4.1 is a winner!

Terraform v1.2.8
on windows_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.22.0
+ provider registry.terraform.io/dopplerhq/doppler v1.0.0
+ provider registry.terraform.io/hashicorp/aws v4.28.0
+ provider registry.terraform.io/hashicorp/random v3.4.1

@lra
Copy link

lra commented Aug 31, 2022

Our issue #299 (comment) is still valid in v3.4.1. Should I open a new issue?

@bendbennett
Copy link
Contributor

@lra it looks like the issue you have described is a little different from the description @ericzarcone and @NJITman gave in that you do not appear to be seeing an error output indicating Cannot specify both number and numeric in config. However, the issue you describe does have some similarities with Upgrade v2.2.1 -> v3.4.0 forces replacement. Perhaps you could comment on that issue? Thanks.

@lra
Copy link

lra commented Aug 31, 2022

Done, thanks.

@bendbennett
Copy link
Contributor

I'm going to close this issue as the issue described by @NJITman has been fixed and there has been no further upvotes or indication from @ericzarcone that this issue persists. The issue that @lra described is now included in #302 (comment).

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants