Hi, I'm using Pulumi C# AWS - I'm recently getting...
# general
s
Hi, I'm using Pulumi C# AWS - I'm recently getting a lot of random
System.InvalidOperationException: This operation cannot be performed on a default instance of ImmutableArray<T>
errors. They pop up at random places and the only thing I can do is comment code, do
pulumi up
, and then uncomment the code and hopefully it will go away. Anyone coming across this
c
Just experienced this myself, too 😞 Thing is, in my case it's not giving me any details on where exactly in the code this is failing (no line numbers, and the stacktrace isn't pointing to any of my code), so I have no idea where to start looking. I even set
--verbose 9
but the output just stays the same.
Copy code
error: Running program '/Users/hognevevle/Projects/xxx/bin/Debug/netcoreapp3.1/Foo.dll' failed with an unhandled exception:
    System.InvalidOperationException: This operation cannot be performed on a default instance of ImmutableArray<T>.  Consider initializing the array, or checking the ImmutableArray<T>.IsDefault property.
       at void System.Collections.Immutable.ImmutableArray<T>.ThrowInvalidOperationIfNotInitialized()
       at int System.Collections.Immutable.ImmutableArray<T>.System.Collections.ICollection.get_Count()
       at async Task<ImmutableArray<object>> Pulumi.Serialization.Serializer.SerializeListAsync(string ctx, IList list, bool keepResources, bool keepOutputValues)
       at async Task<object> Pulumi.Serialization.Serializer.SerializeAsync(string ctx, object prop, bool keepResources, bool keepOutputValues) x 2
       at async Task<RawSerializationResult> Pulumi.Deployment.SerializeFilteredPropertiesRawAsync(string label, IDictionary<string, object> args, Predicate<string> acceptKey, bool keepResources, bool keepOutputValues)
       at async Task<SerializationResult> Pulumi.Deployment.SerializeFilteredPropertiesAsync(string label, IDictionary<string, object> args, Predicate<string> acceptKey, bool keepResources, bool keepOutputValues)
       at async Task<Struct> Pulumi.Deployment.SerializeAllPropertiesAsync(string label, IDictionary<string, object> args, bool keepResources, bool keepOutputValues)
       at async Task Pulumi.Deployment.RegisterResourceOutputsAsync(Resource resource, Output<IDictionary<string, object>> outputs)
w
I haven't seen those errors. What versions are you using?
s
Looks like someone else has also encountered this and I have filed the issue here
@worried-city-86458 I'm using 3.18.0 - but from the comments on GitHub it looks like the issue was introduced in 3.18.0 and fixed in 3.18.1 so I'll update and retest
👍 1