Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

get error in octopus_projects when branch name and protection field are the same #876

@jcafarelli-dotmatics

Description

@jcafarelli-dotmatics

Describe the bug
under projects -> version control -> branch settings there are 2 fields for settings Default Branch and Protected branch patterns

If these 2 fields are set to the same thing, and you try to use data resource octopusdeploy_projects, you get the below error output in terraform

Error: Duplicate Set Element

data "octopusdeploy_projects" "all" {}

Steps to reproduce

  1. under projects -> version control -> branch settings, set Default Branch and Protected branch patterns to "main"
  2. setup a terraform repo locally, and in main.tf add this data block
data "octopusdeploy_projects" "all" {}
  1. run terraform apply
  2. See error
╷
│ Error: Duplicate Set Element
│ 
│   with data.octopusdeploy_projects.nall,
│ This attribute contains duplicate values of: tftypes.String<"main">

Expected behavior
Terraform apply from above examples cleanly applys

Logs and other supporting information

╷
│ Error: Duplicate Set Element
│ 
│   with data.octopusdeploy_projects.nall,
│ This attribute contains duplicate values of: tftypes.String<"main">

Environment and versions:

  • OS: OSX
  • Octopus Server Version: newest cloud version
  • Terraform Version: v1.5.7
  • Octopus Terraform Provider Version: latest main line or "0.7.63"

Additional context
I ran a debug session and was able to track it down to this line of code that was causing the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions