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

Indescript "Invalid Watch" error when applying despite watch definitions being in-spec #217

Closed
eelginUPS opened this issue Jul 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eelginUPS
Copy link

Describe the bug
Terraform can plan two watches I am implementing but give weird indesript "Got invalid watch" errors when attempting to apply. As far as I can tell they are in spec and all the resources they require exist.

Source:

resource "xray_watch" "dev" {
  name        = "dev-watch"
  description = "all development repos"
  active      = true

  dynamic "watch_resource" {
    for_each = local.dev_repos
    content {
      type      = "repository"
      name      = watch_resource.value.name
      repo_type = watch_resource.value.repo_type
    }
  }

  assigned_policy {
    name = xray_security_policy.dev-env.name
    type = "security"
  }
}

Plan

  # module.terraform-jfrog-xray.xray_watch.dev will be created
  + resource "xray_watch" "dev" {
      + active      = true
      + description = "all development repos"
      + id          = (known after apply)
      + name        = "dev-watch"

      + assigned_policy {
          + name = "dev-env"
          + type = "security"
        }

      + watch_resource {
          + bin_mgr_id = "default"
          + name       = "xxx-dev-remote-external"
          + repo_type  = "remote"
          + type       = "repository"
        }
      + # ~150 other [watch_resources]
    }

Error

│ Error: {"error":"Got invalid watch"}
│ 
│   with module.terraform-jfrog-xray.xray_watch.dev,
│   on ../../terraform-jfrog-xray/watches.tf line 62, in resource "xray_watch" "dev":
│   62: resource "xray_watch" "dev" {
│ 
╵

Versions of tf + providers:
terraform_1.7.5_linux_amd64.zip
jfrog/project v1.5.2
jfrog/platform v1.7.4
jfrog/artifactory v10.8.0
jfrog/xray v2.8.1

Expected behavior
I'd expect it to apply properly or at least give me a clue as to what is going wrong here.

@eelginUPS eelginUPS added the bug Something isn't working label Jul 11, 2024
@alexhung
Copy link
Member

@eelginUPS The error message comes directly from Xray API so something in the resource configuration is triggering this.

@alexhung
Copy link
Member

Closing this as stale.

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