Skip to content

Terraform provider crashes (w/ segfault) when creating Git-backed project specifying a release version strategy #9848

@RobMcCarther

Description

@RobMcCarther

Severity

No response

Version

latest

Latest Version

None

What happened?

When using the Octopus Deploy Terraform provider v1.7.1, Terraform crashes with a segmentation fault when creating or managing a Git-backed (version-controlled) project in combination with a octopusdeploy_project_versioning_strategy resource.

This issue blocks upgrades from older provider versions (e.g. v0.7.x) and also occurs in fresh configurations using v1.7.1.

Reproduction

  • Use Terraform with provider version 1.7.1:
terraform {
  required_providers {
    octopusdeploy = {
      source  = "OctopusDeploy/octopusdeploy"
      version = "1.7.1"
    }
  }
}

  • Create a version-controlled (Git-backed) project, for example:
    `resource "octopusdeploy_project" "example" {
    name = "Git-backed Project"
    project_group_id = octopusdeploy_project_group.example.id
    lifecycle_id = octopusdeploy_lifecycle.example.id
    is_version_controlled = true

    git_library_persistence_settings {
    git_credential_id = octopusdeploy_git_credential.example.id
    url = "https://github.com/example/repo.git"
    default_branch = "main"
    base_path = ".octopus"
    protected_branches = []
    }
    }
    `

  • Define a project versioning strategy for the same project:
    resource "octopusdeploy_project_versioning_strategy" "example" { project_id = octopusdeploy_project.example.id template = "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}" }

  • Run terraform apply

Error and Stacktrace

Stack trace from the terraform-provider-octopusdeploy_v1.7.1 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xd5a492]

More Information

No response

Workaround

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugThis issue represents a verified problem we are committed to solving

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions