datadrivers/terraform-provider-nexus

runtime error: index out of range [0] with length 0

Closed this issue ยท 2 comments

jouve commented

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.4.1

Nexus Provider Version

v1.21.2

Nexus Version

3.38.1-01

Affected Resource(s)/Data Source(s)

nexus_repository_raw_proxy

Terraform Configuration Files

resource "nexus_repository_raw_proxy" "github_raw_proxy" {
  name = "github-raw-proxy"

  storage {
    blob_store_name = data.nexus_blobstore_s3.s3.id
  }

  proxy {
    remote_url = "https://github.com/"
  }

  http_client {
    auto_block = false
    blocked    = false
  }
}


### Debug Output/Panic Output

```shell
goroutine 43 [running]:
github.com/datadrivers/terraform-provider-nexus/internal/services/repository.getRawProxyRepositoryFromResourceData(0x19e7480?)
	github.com/datadrivers/terraform-provider-nexus/internal/services/repository/resource_repository_raw_proxy.go:43 +0xcfc
github.com/datadrivers/terraform-provider-nexus/internal/services/repository.resourceRawProxyRepositoryCreate(0x0?, {0x177a6a0?, 0xc000463110})
	github.com/datadrivers/terraform-provider-nexus/internal/services/repository/resource_repository_raw_proxy.go:147 +0x66
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x19e3700?, {0x19e3700?, 0xc000187440?}, 0xd?, {0x177a6a0?, 0xc000463110?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0004a3420, {0x19e3700, 0xc000187440}, 0xc0000980d0, 0xc00011a300, {0x177a6a0, 0xc000463110})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/resource.go:837 +0xa7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003ab1a0, {0x19e3700?, 0xc000097440?}, 0xc0003ffbd0)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0003e6460, {0x19e3700?, 0xc0005a1a10?}, 0xc000458620)
	github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x18844a0?, 0xc0003e6460}, {0x19e3700, 0xc0005a1a10}, 0xc000458460, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000468000, {0x19e62e0, 0xc0000eb860}, 0xc00034e6c0, 0xc00049ed20, 0x1e9fac0, 0x0)
	google.golang.org/grpc@v1.50.1/server.go:1340 +0xd13
google.golang.org/grpc.(*Server).handleStream(0xc000468000, {0x19e62e0, 0xc0000eb860}, 0xc00034e6c0, 0x0)
	google.golang.org/grpc@v1.50.1/server.go:1713 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.50.1/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.50.1/server.go:963 +0x28a

Expected Behaviour

validation error

Actual Behaviour

crash

Steps to Reproduce

terraform apply

References

similar to #212

but for raw proxy / negative_cache

ref:
https://github.com/datadrivers/terraform-provider-nexus/blob/main/internal/services/repository/resource_repository_raw_proxy.go#L43

Can report that I'm still getting this issue with provider version 1.22.0 and terraform 1.6.1

we discussed internally, that we will follow the sonatype Nexus API.
so we make the block negative_cache and it's fields as required
https://github.com/datadrivers/terraform-provider-nexus/releases/tag/v2.4.0