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

Pulumi program hangs when resource transformation throws an exception #174

Open
Zaid-Ajaj opened this issue Aug 30, 2023 · 0 comments
Open
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@Zaid-Ajaj
Copy link
Contributor

Zaid-Ajaj commented Aug 30, 2023

What happened?

When using a ResourceTransformation as a stack option and that transform throws an exception, pulumi preview and pulumi up hang forever.

Expected Behavior

pulumi preview and pulumi up should not hang, instead, the transformation should catch errors and show them to users.

Steps to reproduce

The following C# Pulumi program demonstrates the problem:

using System.Threading.Tasks;
using Pulumi;
using Pulumi.Aws.S3;

class MyStack : Stack
{
    static StackOptions Options() => new StackOptions()
    {
        ResourceTransformations = { FailingTransform() } 
    };

    public MyStack() : base(Options())
    {
        var bucket = new Bucket("my-bucket");
    }

    static ResourceTransformation FailingTransform() 
    {
        return args => 
        {
            throw new System.Exception("Boom!");
            return null;
        };
    }
}


class Program
{
    static Task<int> Main() => Deployment.RunAsync<MyStack>();
}

Output of pulumi about

CLI          
Version      3.78.1
Go Version   go1.20.7
Go Compiler  gc

Plugins
NAME    VERSION
aws     6.0.2
dotnet  unknown

Host     
OS       darwin
Version  13.2.1
Arch     arm64

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

@Zaid-Ajaj Zaid-Ajaj added the kind/bug Some behavior is incorrect or out of spec label Aug 30, 2023
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

1 participant