I’m running into an issue where duplicate state en...
# general
h
I’m running into an issue where duplicate state entries have been created for stack resources after their resource names were changed and aliases were added. this prevents anything from being done to the stack until the duplicates are deleted via
pulumi state delete
. the state entries are from a custom
ComponentResource
and appear in the state as follows. does anyone know why this is happening?
Copy code
{
    "urn": "urn:pulumi:STACK::PROJECT::company:scope:CustomComponentResource::get_/http/path_Z_X_Y",
    "custom": false,
    "type": "company:scope:CustomComponentResource",
    "parent": "urn:pulumi:STACK::PROJECT::pulumi:pulumi:Stack::PROJECT-STACK",
    "aliases": [
        // old URN from old resource name; added by: ResourceOptions(aliases=["apilog:STACK:get:/http/path:X:Y:response_time"])
        "urn:pulumi:STACK::PROJECT::company:scope:CustomComponentResource::apilog:STACK:get:/http/path:X:Y:response_time"
    ]
    // does NOT include "outputs"
}
{
    "urn": "urn:pulumi:STACK::PROJECT::company:scope:CustomComponentResource::get_/http/path_Z_X_Y",
    "custom": false,
    "type": "company:scope:CustomComponentResource",
    "outputs": {
        "monitor_id": "0123456789"
    },
    "parent": "urn:pulumi:STACK::PROJECT::pulumi:pulumi:Stack::PROJECT-STACK"
    // does NOT include "aliases"
}
e
Did the update that added that second entry run ok?
h
yes, and every operation after that fails
e
Odd I haven't heard of this before, I'd suggest raising an issue on github.