https://pulumi.com logo
Title
h

hundreds-greece-25551

01/12/2023, 3:49 PM
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?
{
    "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

echoing-dinner-19531

01/12/2023, 3:52 PM
Did the update that added that second entry run ok?
h

hundreds-greece-25551

01/12/2023, 3:54 PM
yes, and every operation after that fails
e

echoing-dinner-19531

01/12/2023, 3:55 PM
Odd I haven't heard of this before, I'd suggest raising an issue on github.