Hello, we have started seeing an error today when ...
# general
f
Hello, we have started seeing an error today when running
pulumi up
. The error is
Error: cannot ignore changes to the following properties because one or more elements of the path are missing: "tags.tag_created_date"
We have added a
ResourceTransformation
in our
StackOptions
to ignore changes to the
tag_created_date
. We are using
pulumi-azure-native
and on vers
3.72.2
of the CLI. This has been working without any issue till today. We can fix it by deleting the tag in question from the resource, doing a
pulumi refresh
and then
pulumi up
. A very cumbersome workaround and would appreciate if anyone can help us diagnose the issue. Thanks
e
Ah I recently change the ignore changes logic to try and fix an odd case where arrays were getting zero'd out rather than ignored. That may have changed this as well. But I think the error is probably correct, I don't see any property tag_created_date (or tagCreatedDate) in azure-native.
f
Thanks @echoing-dinner-19531. tag_created_date is a custom tag we set on our resources
e
Ah right, "ignoreChanges" won't understand that. The tags property is an array and ignore changes only knows how to ignore specific indices in an array. Not how to ignore a specific value in it.
f
We are using
StackOptions
to ignore changes to our custom tag like so
Copy code
public StackOptions GetStackOptions()
    {
        return new StackOptions
        {
            ResourceTransformations = new List<ResourceTransformation>
            {
                IgnoreCreatedDateTags
            }
        };
    }

    public ResourceTransformationResult? IgnoreCreatedDateTags(ResourceTransformationArgs args)
    {
        var tagp = args.Args.GetType().GetProperty("Tags");
        
        if (tagp != null)
        {
            args.Options.IgnoreChanges = new List<string> { "tags." + TagHelper.CreatedDate };
        }
        return new ResourceTransformationResult(args.Args, args.Options);
    }
Nothing has changed from our end for it to suddenly throw an error related to the custom tag
e
Yeh as I said above I recently changed the ignore code which is probably what caused this to start erroring. But that ignore path does look like an invalid path because "tags" is an array and ignore paths don't work on values but just on property names and indices.
f
Right, so this behaviour has been changed for 3.72.2? Is there a fix we can do to stop this from breaking?
e
Just re-checking this, the change I was thinking of shouldn't be effecting this because it was specifically for array properties and also never actually got merged. Also the key is valid because it looks like "tags" is normally a dictionary, not an array like I thought. So it should be fine to ignore a specific key from it. Do you know what version of the CLI you were on before 3.72.2? We've had three releases in the last week it would help to narrow this search down to when this changed.
f
Thanks for digging further into this. The last version of the CLI this has worked was 3.69.0
e
OK I can have a look into 3.70
Just to check, are you using --targets as part of these (or previous deployments)?
f
No, we are not using --targets as part of the deployment. We are using the GH Pulumi action to deploy