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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm V3 Release assertion fail on update #1925

Closed
mfzl opened this issue Mar 10, 2022 · 10 comments
Closed

Helm V3 Release assertion fail on update #1925

mfzl opened this issue Mar 10, 2022 · 10 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@mfzl
Copy link

mfzl commented Mar 10, 2022

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

I'm using the Release resource to deploy https://k8s.ory.sh/helm/kratos.html chart. It deploys fine and everything runs normally. But if I do a pulumi up after, it fails with an assertion error, which doesn't have a lot of details except for the stack trace.

  pulumi:pulumi:Stack (idp-app-k8s-dev):
    panic: fatal: An assertion has failed
    goroutine 522 [running]:
    github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.24.1/go/common/util/contract/failfast.go:23
    github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Assert(...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.24.1/go/common/util/contract/assert.go:26
    github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/provider.(*kubeProvider).Check(0xc0001ee180, {0x253b408, 0xc002d21620}, 0xc0022ddef0)
    	/home/runner/work/pulumi-kubernetes/pulumi-kubernetes/provider/pkg/provider/provider.go:1239 +0x1579
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Check_Handler.func1({0x253b408, 0xc002d21620}, {0x2080a00, 0xc0022ddef0})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.24.1/proto/go/provider.pb.go:2593 +0x78
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x253b408, 0xc002d0b440}, {0x2080a00, 0xc0022ddef0}, 0xc002835e40, 0xc0023f77b8)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x425
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Check_Handler({0x2124c60, 0xc0001ee180}, {0x253b408, 0xc002d0b440}, 0xc002b5b800, 0xc0004c4000)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.24.1/proto/go/provider.pb.go:2595 +0x138
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc000150540, {0x257b9a8, 0xc000103040}, 0xc002d15320, 0xc0004ba150, 0x39528b0, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:1282 +0xccf
    google.golang.org/grpc.(*Server).handleStream(0xc000150540, {0x257b9a8, 0xc000103040}, 0xc002d15320, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:1616 +0xa2a
    google.golang.org/grpc.(*Server).serveStreams.func1.2()
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:921 +0x98
    created by google.golang.org/grpc.(*Server).serveStreams.func1
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.43.0/server.go:919 +0x294
 
  kubernetes:helm.sh/v3:Release (kratos):
    error: transport is closing

Steps to reproduce

  1. pulumi up to deploy https://k8s.ory.sh/helm/kratos.html with Release resource
  2. Run pulumi up again

Expected: To run and present a full preview and then prompt to continue
Actual: Crashes with the above stack trace without preview.

I'm using 3.16.0

@mfzl mfzl added the kind/bug Some behavior is incorrect or out of spec label Mar 10, 2022
@mfzl mfzl changed the title Helm V3 Release assertion error on update Helm V3 Release assertion fail on update Mar 10, 2022
@mfzl
Copy link
Author

mfzl commented Mar 10, 2022

Seems it's failing on this assertion

contract.Assert(oldInputs.GetName() != "")

But it's checking for .metadata.name on the Release inputs which doesn't have a metadata object.

@mfzl
Copy link
Author

mfzl commented Mar 10, 2022

So I went ahead and edited the stack and added a metadata.name to inputs and it works as expected and it gets removed after update

@mfzl
Copy link
Author

mfzl commented Mar 10, 2022

Does this line

if len(oldInputs.Object) > 0 {

need to be

	if len(oldInputs.Object) > 0 && !isHelmRelease(urn) 

instead

@viveklak
Copy link
Contributor

Could you share your code? You might have input types in the args to the release.

@mfzl
Copy link
Author

mfzl commented Mar 11, 2022

It indeed does. I'm passing bunch of Input values to chart values. I'm assuming they all need to be resolved. I missed the type on .values.

The error could be better though.

@mfzl
Copy link
Author

mfzl commented Mar 11, 2022

I'm closing it since this is the expected behavior. @viveklak thanks for the hint.

I think the experience could be improved though, starting with the error message.

@RazcoDev
Copy link

RazcoDev commented Apr 1, 2022

@mfzl can you please elaborate on this ?
I'm encountering the same issue and couldn't figure out your resolution from this thread.
My Release's values arg also have Outputs in it.

@viveklak
Copy link
Contributor

viveklak commented Apr 1, 2022

@RazcoDev can you post a repro in #1933 please?

@mfzl
Copy link
Author

mfzl commented Apr 3, 2022

@mfzl can you please elaborate on this ? I'm encountering the same issue and couldn't figure out your resolution from this thread. My Release's values arg also have Outputs in it.

Basically all values needed to be resolved. We wrapped everything in apply with all the values that needed to be resolved was what we went with as a workaround.

@viveklak
Copy link
Contributor

viveklak commented Apr 3, 2022

A fix is upcoming in #1953. Thanks for your patience. In the meantime using prompt (i.e. things you have already awaited) values is a good workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants