Skip to content

ASM-15848 | Fix Panic Reading Static Secret#151

Closed
kgal-akl wants to merge 2 commits into
masterfrom
ASM-15848-fix-ignore-secret
Closed

ASM-15848 | Fix Panic Reading Static Secret#151
kgal-akl wants to merge 2 commits into
masterfrom
ASM-15848-fix-ignore-secret

Conversation

@kgal-akl
Copy link
Copy Markdown
Contributor

Fix plugin crashing when attempting to read static secret:

Stack trace from the terraform-provider-akeyless_v1.11.0 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 39 [running]:
github.com/akeylesslabs/terraform-provider-akeyless/akeyless.dataSourceStaticSecretRead(0xc00070c510, {0x1b69780?, 0xc0006c0530})
	github.com/akeylesslabs/terraform-provider-akeyless/akeyless/data_source_static_secret.go:91 +0xaf3
github.com/akeylesslabs/terraform-provider-akeyless/akeyless.dataSourceSecretRead(0xc00070c510, {0x1b69780, 0xc0006c0530})
	github.com/akeylesslabs/terraform-provider-akeyless/akeyless/data_source_secret.go:63 +0x2c5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x230f8a0?, {0x230f8a0?, 0xc0006e8ea0?}, 0xd?, {0x1b69780?, 0xc0006c0530?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.37.0/helper/schema/resource.go:854 +0x15f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0005b4a00, {0x230f8a0, 0xc0006e8ea0}, 0x0?, {0x1b69780, 0xc0006c0530})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.37.0/helper/schema/resource.go:1088 +0x13e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc0005420a8, {0x230f8a0?, 0xc0006e8de0?}, 0xc0006e8d80)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.37.0/helper/schema/grpc_provider.go:1860 +0x6ac
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc000463400, {0x230f8a0?, 0xc0006e82d0?}, 0xc000693860)
	github.com/hashicorp/terraform-plugin-go@v0.27.0/tfprotov5/tf5server/server.go:757 +0x26a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x1e8f080, 0xc000463400}, {0x230f8a0, 0xc0006e82d0}, 0xc000440200, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.27.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:741 +0x1a9
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003aa000, {0x230f8a0, 0xc0006e8240}, 0xc00068dd40, 0xc000549ec0, 0x3587b30, 0x0)
	google.golang.org/grpc@v1.73.0/server.go:1405 +0x1036
google.golang.org/grpc.(*Server).handleStream(0xc0003aa000, {0x2310430, 0xc0005c4340}, 0xc00068dd40)
	google.golang.org/grpc@v1.73.0/server.go:1815 +0xb88
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/grpc@v1.73.0/server.go:1035 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 18
	google.golang.org/grpc@v1.73.0/server.go:1046 +0x11d

Error: The terraform-provider-akeyless_v1.11.0 plugin crashed!

Copy link
Copy Markdown
Collaborator

@tuvia-akeyless tuvia-akeyless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data source secret in this file handles static + dynamic + rotated secrets. But the gateway supports ignore_cache param only for static and rotated secrets. I will do another pr.

@kgal-akl
Copy link
Copy Markdown
Contributor Author

Closed for #152

@kgal-akl kgal-akl closed this Oct 13, 2025
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

Successfully merging this pull request may close these issues.

2 participants