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

Panic on invalid resource when valid error is expected #668

Closed
zbuchheit opened this issue Nov 9, 2024 · 1 comment · Fixed by #677
Closed

Panic on invalid resource when valid error is expected #668

zbuchheit opened this issue Nov 9, 2024 · 1 comment · Fixed by #677
Assignees
Labels
customer/feedback Feedback from customers impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@zbuchheit
Copy link

zbuchheit commented Nov 9, 2024

What happened?

In latest Pulumi yaml dependencies, the new client version panics when I instead expect the following error resources.badResource must be an object;

Note

This may be more appropriate in https://github.com/pulumi/pulumi feel free to move the issue there for tracking

Example

name: my-test-yaml
description: A stack that will throw an error.
runtime: yaml
template:
  description: A minimal Pulumi YAML program

config: {}
variables:     {}
resources:     {badResource}
outputs:       {}

Panic

Diagnostics:
  pulumi:pulumi:Stack (my-test-yaml-panic-repro):
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x2 addr=0x108 pc=0x10180f4dc]
    goroutine 37 [running]:
    github.com/pulumi/pulumi-yaml/pkg/pulumiyaml.LoadDir({0x101a45f20, 0x1})
    	/home/runner/work/pulumi-yaml/pulumi-yaml/pkg/pulumiyaml/run.go:145 +0x25c
    github.com/pulumi/pulumi-yaml/pkg/pulumiyaml.Load(...)
    	/home/runner/work/pulumi-yaml/pulumi-yaml/pkg/pulumiyaml/run.go:50
    github.com/pulumi/pulumi-yaml/pkg/server.(*yamlLanguageHost).loadTemplate(0x14000628540, {0x0?, 0x1400028f638?, 0x100d9bad0?})
    	/home/runner/work/pulumi-yaml/pulumi-yaml/pkg/server/server.go:77 +0x6c
    github.com/pulumi/pulumi-yaml/pkg/server.(*yamlLanguageHost).GetRequiredPlugins(0x1025bef50?, {0x101cb3780?, 0x40?}, 0x101b32640?)
    	/home/runner/work/pulumi-yaml/pulumi-yaml/pkg/server/server.go:97 +0x30
    github.com/pulumi/pulumi/sdk/v3/proto/go._LanguageRuntime_GetRequiredPlugins_Handler.func1({0x101d3e6b8?, 0x140006afe00?}, {0x101c76d60?, 0x14000300900?})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.133.0/proto/go/language_grpc.pb.go:311 +0xd0
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x101d3e6b8, 0x140006af020}, {0x101c76d60, 0x14000300900}, 0x140006a6440, 0x140003b2ba0)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2e4
    github.com/pulumi/pulumi/sdk/v3/proto/go._LanguageRuntime_GetRequiredPlugins_Handler({0x101cb3780, 0x14000628540}, {0x101d3e6b8, 0x140006af020}, 0x1400021c380, 0x140003d2320)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.133.0/proto/go/language_grpc.pb.go:313 +0x148
    google.golang.org/grpc.(*Server).processUnaryRPC(0x140002c2000, {0x101d3e6b8, 0x140006aef90}, {0x101d4b500, 0x140002d8000}, 0x14000000900, 0x140003af140, 0x1025d7f40, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xb58
    google.golang.org/grpc.(*Server).handleStream(0x140002c2000, {0x101d4b500, 0x140002d8000}, 0x14000000900)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1780 +0xb20
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 65
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x13c

error: failed to discover plugin requirements: error reading from server: EOF

Expected Error

resources.badResource must be an object;

Output of pulumi about

This actually causes Pulumi about to panic as well. I am on pulumi cli v3.137.0

Additional context

No response

Contributing

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).

@zbuchheit zbuchheit added customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team p1 A bug severe enough to be the next item assigned to an engineer labels Nov 9, 2024
@justinvp justinvp added this to the 0.113 milestone Nov 12, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Nov 12, 2024
@justinvp justinvp added the impact/regression Something that used to work, but is now broken label Nov 15, 2024
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 16, 2024
@pulumi-bot
Copy link

This issue has been addressed in PR #677 and shipped in release v1.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer/feedback Feedback from customers impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants