Skip to content

400 when planning after creating artifactory_repository_layout resource #221

@acrois

Description

@acrois

Describe the bug

After a successful apply, subsequent plan/apply operations fail for any resource that relies upon the /artifactory/api/system/configuration endpoint in JFrog Cloud (as it is disabled).

│ Error: Unable to Refresh Resource
│ 
│   with artifactory_repository_layout.plugins,
│   on plugins.tf line 1, in resource "artifactory_repository_layout" "plugins":
│    1: resource "artifactory_repository_layout" "plugins" {
│ 
│ An unexpected error occurred while attempting to refresh resource state. Please retry the operation or report this issue to the provider
│ developers.
│ 
│ Error: failed to retrieve data from API: /artifactory/api/system/configuration during Read: {
│   "errors" : [ {
│     "status" : 400,
│     "message" : "Artifactory Online does not support accessing this API endpoint, please contact [email protected] for further assistance if required."
│   } ]
│ }

Requirements for and issue

  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that's part of the issue)
    resource "artifactory_repository_layout" "plugins" {
      name                               = "test-plugins"
      artifact_path_pattern              = "([org]/)[module]/v[baseRev](-[folderItegRev])/[type]/[plugin<(?:[0-9a-z]+)>](.[ext])"
      file_integration_revision_regexp   = ".*"
      folder_integration_revision_regexp = "(?:[\\w\\d_.\\/-]+?)?(?:\\.\\d+)*?"
    }
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
    7.123.4
    
  • Your version of terraform
    Terraform v1.10.5
    

Expected behavior

A plan and apply to work after the resource is initially created.

Additional context

Workaround by forcibly remove it from the state, so that it does not poll it. Subsequent plan/apply operations succeed.

terraform state rm artifactory_repository_layout.plugins

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions