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 performing a refresh after a scm_address_object is deleted #22

Open
zbuchheit opened this issue Jul 10, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@zbuchheit
Copy link

zbuchheit commented Jul 10, 2024

Describe the bug

When attempting to refresh after an scm_address_object has been deleted, I receive an error.

│ 
│ [HTTP 400] API_I00013 Your configuration is not valid. Please review the error message for more details. - map[errorType:Object Not Present message:Failed to find obj-uuid for command
│ get]
╵

Expected behavior

I expect the refresh to detect that the scm_address_object is no longer present and remove it from state.

Current behavior

The refresh returns an error and fails.

Possible solution

I believe this is actually a bug with the API response. It should be responding with a 404 not found but is responding back with a 400 bad request which leads the read to handle the error different that what would be expected as you can see here.

Steps to reproduce

  1. Run terraform apply
provider "scm" {
  logging = "detailed"
  host = "api.sase.paloaltonetworks.com"
}

terraform {
  required_providers {
    scm = {
      source = "paloaltonetworks/scm"
      version = "0.9.2"
    }
  }
}

resource scm_address_object "example" {
  name = "1-terraform.com"
  folder = "Shared"
  fqdn = "1-terraform.com"
}
  1. Delete scm_address_object outside of TF
  2. Run terraform refresh

Screenshots

Context

This appears to also be the case with most other resources as well.

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:
@zbuchheit zbuchheit added the bug Something isn't working label Jul 10, 2024
@zbuchheit zbuchheit changed the title error when performing a scm_address_object refresh on a deleted scm_address_object error when performing a refresh after a scm_address_object is deleted Jul 10, 2024
@javierjeronimo
Copy link

Same error here with a scm_address_group resource that has been deleted from webUI and Terraform does not detect such event when planning/applying changes:
│ [HTTP 400] API_I00013 Your configuration is not valid. Please review the error message for more details. - map[errorType:Object Not Present message:Failed to find obj-uuid for command get]

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