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

mist_org_wlan: Error: Provider produced inconsistent result after apply #66

Open
guineveresaenger opened this issue Dec 17, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@guineveresaenger
Copy link

Describe the bug

When running terraform apply to provision mist_org_wlan, program errors out with "inconsistent result after apply" on confirmation.

To Reproduce

main.tf:

terraform {
  required_providers {
    mist = {
      source = "registry.terraform.io/juniper/mist"
    }
  }
}

provider "mist" {
  host     = <redacted>
  apitoken = <redacted>
}

variable "organization_id" {
  description = "The organization ID for Juniper Mist"
  type        = string
}

# data "mist_sites" "sites" {
#   org_id = var.organization_id
# }

resource "mist_org_wlantemplate" "org_template" {
  org_id = var.organization_id
  name   = "wlan_org_template"
}

resource "mist_org_wlan" "org_portal_wlan_one" {
  org_id     = var.organization_id
  template_id = mist_org_wlantemplate.org_template.id
  ssid       = "wlan_portal_template_ts"
  auth = {
    type = "psk"
    psk  = "secretpsk!"
  }
  interface = "all"
}
  1. Run terraform plan; observe all is well
  2. Run terraform apply
  3. Confirm yes

Output:

mist_org_wlantemplate.org_template: Creating...
mist_org_wlantemplate.org_template: Creation complete after 0s [id=2a721b16-2f8a-4a0a-b83a-362eb453ee0e]
mist_org_wlan.org_portal_wlan_one: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to mist_org_wlan.org_portal_wlan_one, provider "provider[\"registry.terraform.io/juniper/mist\"]" produced an unexpected new value: .mxtunnel_ids: was null, but now cty.ListValEmpty(cty.String).
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to mist_org_wlan.org_portal_wlan_one, provider "provider[\"registry.terraform.io/juniper/mist\"]" produced an unexpected new value: .ap_ids: was null, but now cty.ListValEmpty(cty.String).
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to mist_org_wlan.org_portal_wlan_one, provider "provider[\"registry.terraform.io/juniper/mist\"]" produced an unexpected new value: .acct_servers: was cty.ListValEmpty(cty.Object(map[string]cty.Type{"host":cty.String, "keywrap_enabled":cty.Bool, "keywrap_format":cty.String,
│ "keywrap_kek":cty.String, "keywrap_mack":cty.String, "port":cty.Number, "secret":cty.String})), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to mist_org_wlan.org_portal_wlan_one, provider "provider[\"registry.terraform.io/juniper/mist\"]" produced an unexpected new value: .mxtunnel_name: was null, but now cty.ListValEmpty(cty.String).
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
[more]

Expected behavior

I should be getting a wlan template with no diffs.

Error Message

See above

Software

Terraform v1.10.2
on darwin_arm64

  • provider registry.terraform.io/juniper/mist v0.2.12

Additional context

Add any other context about the problem here.

@tmunzer
Copy link
Collaborator

tmunzer commented Dec 18, 2024

Hi @guineveresaenger,

Thanks for the report.
This error is related to the changes made with v0.2.12 to reduce configuration drifts when someone is saving the WLAN from the UI.
This required to change some default values to match the UI default values, which is triggering this error message.

This should only occur once, during the first refresh/sync.

Can you confirm you are not getting these messages afterward?

Thanks

@tmunzer
Copy link
Collaborator

tmunzer commented Dec 18, 2024

ok, just tested again and I'm able to reproduce this issue. Will fix it.

@guineveresaenger
Copy link
Author

Hi @tmunzer - thank you for your attention! It sounds like you've verified this too - but confirming it does happen on every terraform apply.

Are you saying that the expected behavior is for this to always fail on the first apply?

@tmunzer
Copy link
Collaborator

tmunzer commented Dec 18, 2024

Hi @guineveresaenger ,
No, this is not an expecting behavior... I didn't detected this issue during the pre-release testing process.
I'm currently working on fixing it (my goal is to release a new version to fix this before the end of the week, but it may be delayed to next week)

@guineveresaenger
Copy link
Author

Thank you so much! And there's no rush at all; please enjoy your holidays 😄

@tmunzer
Copy link
Collaborator

tmunzer commented Dec 20, 2024

Hi @guineveresaenger ,

No problem :)
I just released v0.2.13. Can you test it?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants