question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Random Helm Errors

See original GitHub issue

Problem description

I am attempting to use Pulumi to deploy the Nginx Ingress Helm Chart and I am encountering an issue where it seems to somewhat randomly fail on certain parts. Some times it will run absolutely fine, but sometimes it will fail on a particular resource, throwing the object reference not set error below. This seems to be random in what resource it fails on, I have seen it on a service account, role, PSP. It also seems to be random whether the issue happens in the preview, or in the actual create.

  • Other:

Errors & Logs

ServiceAccount

Diagnostics:
  pulumi:pulumi:Stack (apps-apps.scdev):
    error: Running program 'C:\repos\pulumi-examples\aks-deployment\apps\bin\Debug\netcoreapp3.1\apps.dll' failed with an unhandled exception:
    System.NullReferenceException: Object reference not set to an instance of an object.
       at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value)
       at System.Collections.Generic.HashSet`1.Add(T item)
       at Pulumi.Resource..ctor(String type, String name, Boolean custom, ResourceArgs args, ResourceOptions options)
       at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options)
       at Pulumi.Kubernetes.KubernetesResource..ctor(String type, String name, DictionaryResourceArgs args, CustomResourceOptions options)
       at Pulumi.Kubernetes.Core.V1.ServiceAccount..ctor(String name, ImmutableDictionary`2 dictionary, CustomResourceOptions options)
       at Pulumi.Kubernetes.Yaml.Parser.<>c__DisplayClass3_0.<ParseYamlObject>b__58(String id)
       at Pulumi.Output`1.<>c__DisplayClass12_0`1.<Apply>b__0(T t)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.AllHelperAsync(ImmutableArray`1 inputs)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.<TupleHelperAsync>g__GetData|20_0[T1,T2,T3,T4,T5,T6,T7,T8,X](Input`1 input)
       at Pulumi.Output`1.TupleHelperAsync[T1,T2,T3,T4,T5,T6,T7,T8](Input`1 item1, Input`1 item2, Input`1 item3, Input`1 item4, Input`1 item5, Input`1 item6, Input`1 item7, Input`1 item8)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.Pulumi.IOutput.GetDataAsync()
       at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop)
       at Pulumi.Deployment.SerializeFilteredPropertiesAsync(String label, IDictionary`2 args, Predicate`1 acceptKey)
       at Pulumi.Deployment.SerializeAllPropertiesAsync(String label, IDictionary`2 args)
       at Pulumi.Deployment.RegisterResourceOutputsAsync(Resource resource, Output`1 outputs)
       at Pulumi.Deployment.Runner.<>c__DisplayClass7_0.<<WhileRunningAsync>g__HandleCompletion|0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at Pulumi.Deployment.Runner.WhileRunningAsync()

PSP:


Diagnostics:
  pulumi:pulumi:Stack (apps-apps.scdev):
    error: Running program 'C:\repos\pulumi-examples\aks-deployment\apps\bin\Debug\netcoreapp3.1\apps.dll' failed with an unhandled exception:
    System.NullReferenceException: Object reference not set to an instance of an object.
       at System.Collections.Generic.HashSet`1.AddIfNotPresent(T value)
       at Pulumi.Resource..ctor(String type, String name, Boolean custom, ResourceArgs args, ResourceOptions options)
       at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options)
       at Pulumi.Kubernetes.KubernetesResource..ctor(String type, String name, DictionaryResourceArgs args, CustomResourceOptions options)
       at Pulumi.Kubernetes.Policy.V1Beta1.PodSecurityPolicy..ctor(String name, ImmutableDictionary`2 dictionary, CustomResourceOptions options)
       at Pulumi.Kubernetes.Yaml.Parser.<>c__DisplayClass3_0.<ParseYamlObject>b__79(String id)
       at Pulumi.Output`1.<>c__DisplayClass12_0`1.<Apply>b__0(T t)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.AllHelperAsync(ImmutableArray`1 inputs)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.<TupleHelperAsync>g__GetData|20_0[T1,T2,T3,T4,T5,T6,T7,T8,X](Input`1 input)
       at Pulumi.Output`1.TupleHelperAsync[T1,T2,T3,T4,T5,T6,T7,T8](Input`1 item1, Input`1 item2, Input`1 item3, Input`1 item4, Input`1 item5, Input`1 item6, Input`1 item7, Input`1 item8)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.ApplyHelperAsync[U](Task`1 dataTask, Func`2 func)
       at Pulumi.Output`1.Pulumi.IOutput.GetDataAsync()
       at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop)
       at Pulumi.Deployment.SerializeFilteredPropertiesAsync(String label, IDictionary`2 args, Predicate`1 acceptKey)
       at Pulumi.Deployment.SerializeAllPropertiesAsync(String label, IDictionary`2 args)
       at Pulumi.Deployment.RegisterResourceOutputsAsync(Resource resource, Output`1 outputs)
       at Pulumi.Deployment.Runner.<>c__DisplayClass7_0.<<WhileRunningAsync>g__HandleCompletion|0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at Pulumi.Deployment.Runner.WhileRunningAsync()

Affected product version(s)

Pulumi 2.13.2

Reproducing the issue

Attempt to deploy the Nginx Ingress Helm Chart. Example configuration:

            _ = new Pulumi.Kubernetes.Helm.V3.Chart(name + $"ingress",
                new ChartArgs()
                {
                    Namespace = ingressNameSpace.Metadata.Apply(x => x.Name),
                    Chart = "ingress-nginx",
                    Version = args.ChartVersion,
                    Repo = args.ChartContainerRegistryName,
                    Values = ingressValues ,
                    Transformations ={
                        SetLbIp
                    }
                }, opts);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mikhailshilkovcommented, Nov 12, 2020

@joeduffy Yeah, I did not communicate the fix properly, so I believe @lblackstone didn’t have it on the radar. I will open a PR to the changelog, at least. Let’s try to release it soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with randAlphaNum and upgrades #3053 - GitHub
There are problems with using randAlphaNum in charts when upgrades occur. I'm sure this is working as expected right now, but is problematic ......
Read more >
Chart Development Tips and Tricks - Helm
Covers some of the tips and tricks Helm chart developers have learned while building production-quality charts.
Read more >
How not to overwrite randomly generated secrets in Helm ...
So if there is no such secret, it will be created. If the secret is present, it will be removed from the chart,...
Read more >
13 Best Practices for using Helm - Coder Society
Helm functions are used to generate random data, such as passwords, keys, and certificates. Random generation creates new arbitrary values and ...
Read more >
Azure CLI task failing randomly on Helm task
The task fails without more context than that. The task just before that is a HelmInstaller@1 and it executed without error so Helm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found