Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider crashes if missing default_archs #84

Open
jdolitsky opened this issue Jun 8, 2023 · 1 comment
Open

provider crashes if missing default_archs #84

jdolitsky opened this issue Jun 8, 2023 · 1 comment

Comments

@jdolitsky
Copy link
Member

using the following (missing the default_archs array):

provider "apko" {
  extra_repositories = ["https://dl-cdn.alpinelinux.org/alpine/edge/main"]
}

causes the following error

$ terraform apply
module.latest.module.this.data.apko_config.this: Reading...
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more
│ details.
╵

Stack trace from the terraform-provider-apko_v0.8.5 plugin:

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

goroutine 44 [running]:
github.com/chainguard-dev/terraform-provider-apko/internal/provider.unify({0x1400004eaa0, 0x5, 0x104faaf90?}, {0x105d49d48, 0x0, 0x0})
	github.com/chainguard-dev/terraform-provider-apko/internal/provider/config_data_source.go:255 +0xf10
github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*ConfigDataSource).resolvePackageList(_, {{{0x140004c1650, 0x1, 0x1}, {0x0, 0x0, 0x0}, {0x1400004eaa0, 0x5, 0x5}}, ...})
	github.com/chainguard-dev/terraform-provider-apko/internal/provider/config_data_source.go:221 +0x2ec
github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*ConfigDataSource).Read(0x140004de420, {0x1054a73b0, 0x140001aede0}, {{{{0x1054ad8c8, 0x140002a5d70}, {0x1052e54a0, 0x140002a4ed0}}, {0x1054af7b8, 0x1400026cb40}}, {{{0x0, ...}, ...}, ...}}, ...)
	github.com/chainguard-dev/terraform-provider-apko/internal/provider/config_data_source.go:141 +0x788
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadDataSource(0x140001fb340, {0x1054a73b0, 0x140001aede0}, 0x140001aeed0, 0x140005b35e8)
	github.com/hashicorp/terraform-plugin-framework@v1.2.0/internal/fwserver/server_readdatasource.go:75 +0x394
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadDataSource(0x140001fb340, {0x1054a73b0?, 0x140001aec90?}, 0x1400037c4e0)
	github.com/hashicorp/terraform-plugin-framework@v1.2.0/internal/proto6server/server_readdatasource.go:52 +0x1b0
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadDataSource(0x140001b6a00, {0x1054a73b0?, 0x140001ae330?}, 0x1400004e5a0)
	github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov6/tf6server/server.go:656 +0x368
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadDataSource_Handler({0x10544e460?, 0x140001b6a00}, {0x1054a73b0, 0x140001ae330}, 0x14000226930, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:455 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400027a000, {0x1054adfe0, 0x14000237520}, 0x1400027f560, 0x14000615dd0, 0x105d00ab0, 0x0)
	google.golang.org/grpc@v1.54.0/server.go:1345 +0xc64
google.golang.org/grpc.(*Server).handleStream(0x1400027a000, {0x1054adfe0, 0x14000237520}, 0x1400027f560, 0x0)
	google.golang.org/grpc@v1.54.0/server.go:1722 +0x82c
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.54.0/server.go:966 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.54.0/server.go:964 +0x290

Error: The terraform-provider-apko_v0.8.5 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.

@mattmoor
Copy link
Member

@joshrwolf I believe this is fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants