terraform-provider-bitbucket icon indicating copy to clipboard operation
terraform-provider-bitbucket copied to clipboard

'404 pipelines_config Not found' when importing bitbucket_repository without Pipelines enabled

Open tdmalone opened this issue 4 years ago • 3 comments

Terraform Version

$ terraform version
Terraform v0.11.14
+ provider.bitbucket v1.2.0

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "bitbucket_repository" "my_repo" {
  owner = "my-team"
  name  = "my-repo"
}

Expected Behavior

Terraform should have imported my-repo without errors.

Actual Behavior

$ terraform import bitbucket_repository.my_repo my-team/my-repo
bitbucket_repository.my_repo: Importing from ID "my-team/my-repo"...
bitbucket_repository.my_repo: Import complete!
  Imported bitbucket_repository (ID: my-team/my-repo)
bitbucket_repository.my_repo: Refreshing state... (ID: my-team/my-repo)

Error: bitbucket_repository.my_repo (import id: my-team/my-repo): 1 error occurred:
        * import bitbucket_repository.my_repo result: my-team/my-repo: bitbucket_repository.my_repo: API Error: 404 2.0/repositories/my-team/my-repo/pipelines_config Not found

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Use the config provided above, but adjust to a team name and repo you have access to
  2. terraform import bitbucket_repository.my_repo my-team/my-repo

Important Factoids

  • The user I'm using has full admin access to the team and repo
  • If I visit https://bitbucket.org/my-team/my-repo/addon/pipelines/home and click 'Commit file' at the bottom (thus enabling pipelines) and try the above again, the import succeeds
  • Creating a repository without enabling pipelines still works ok - it appears to be just importing that is affected
  • Might be a regression in #41?

tdmalone avatar May 31 '20 11:05 tdmalone