Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Crashing on snyk_project #13

@mkohn

Description

@mkohn

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.2.9
on darwin_arm64

Affected Resource(s)

  • snyk_project

Terraform Configuration Files

resource "snyk_organization" "org" {
  name = var.project_name
}

data "snyk_integration" "example" {
  count = var.enable_projects ? 1 : 0
  orgid = snyk_organization.org.id
  type  = "bitbucket-connect-app"
}

resource "snyk_project" "repo" {
  for_each          = bitbucket_repository.infrastructure
  organization     = snyk_organization.org.id
  repository_owner = "lakesidesoftware"
  repository_name  = each.key
  branch           = "main"
  integration      = data.snyk_integration.example[0].id
}

Panic Output

Stack trace from the terraform-provider-snyk_0.4.1 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10260eb28]

goroutine 55 [running]:
github.com/formstack/terraform-provider-snyk/snyk/api.ImportProject({{0x1400003c1e0, 0x24}, {0x1400003c1b0, 0x24}, {0x14000046310, 0x65}}, {0x1400051a360, 0x24}, {0x1400051a330, 0x24}, ...)
        github.com/formstack/terraform-provider-snyk/snyk/api/targets.go:66 +0x328
github.com/formstack/terraform-provider-snyk/snyk.resourceProjectCreate({0x102c1dca0?, 0x1400058b1a0?}, 0x0?, {0x102b96540?, 0x140000ab230?})
        github.com/formstack/terraform-provider-snyk/snyk/resource_project.go:72 +0x1bc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x14000207340, {0x102c1dca0, 0x1400058b1a0}, 0xd?, {0x102b96540, 0x140000ab230})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0xec
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14000207340, {0x102c1dca0, 0x1400058b1a0}, 0x140005924e0, 0x14000577780, {0x102b96540, 0x140000ab230})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0x874
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140002c8480, {0x102c1dca0?, 0x1400058b080?}, 0x14000511d60)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xb94
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140002debe0, {0x102c1dca0?, 0x1400058a870?}, 0x140005330a0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x3c0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x102bea680?, 0x140002debe0}, {0x102c1dca0, 0x1400058a870}, 0x14000533030, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x174
google.golang.org/grpc.(*Server).processUnaryRPC(0x140002da1e0, {0x102c207c0, 0x140002e7520}, 0x1400057eea0, 0x14000434c60, 0x103076960, 0x0)
        google.golang.org/[email protected]/server.go:1340 +0xb90
google.golang.org/grpc.(*Server).handleStream(0x140002da1e0, {0x102c207c0, 0x140002e7520}, 0x1400057eea0, 0x0)
        google.golang.org/[email protected]/server.go:1713 +0x840
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/[email protected]/server.go:965 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:963 +0x298
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x30 pc=0x10298293c]

goroutine 53 [running]:
github.com/formstack/terraform-provider-snyk/snyk.resourceProjectCreate({0x102dedca0?, 0x140005940c0?}, 0x0?, {0x102d66540?, 0x140005026c0?})
        github.com/formstack/terraform-provider-snyk/snyk/resource_project.go:78 +0x22c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x140001ff340, {0x102dedca0, 0x140005940c0}, 0xd?, {0x102d66540, 0x140005026c0})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0xec
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140001ff340, {0x102dedca0, 0x140005940c0}, 0x14000131d40, 0x14000590900, {0x102d66540, 0x140005026c0})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0x874
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x14000422480, {0x102dedca0?, 0x14000173f80?}, 0x1400013b720)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xb94
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140002d6aa0, {0x102dedca0?, 0x14000173770?}, 0x1400014cd90)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x3c0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x102dba680?, 0x140002d6aa0}, {0x102dedca0, 0x14000173770}, 0x1400014cd20, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x174
google.golang.org/grpc.(*Server).processUnaryRPC(0x140002d21e0, {0x102df07c0, 0x140003964e0}, 0x14000586360, 0x1400042cc90, 0x103246960, 0x0)
        google.golang.org/[email protected]/server.go:1340 +0xb90
google.golang.org/grpc.(*Server).handleStream(0x140002d21e0, {0x102df07c0, 0x140003964e0}, 0x14000586360, 0x0)
        google.golang.org/[email protected]/server.go:1713 +0x840
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/[email protected]/server.go:965 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:963 +0x298

Error: The terraform-provider-snyk_0.4.1 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Actual Behavior

Crashing

Steps to Reproduce

  1. terraform apply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions