I am unable to destroy the stack that was created ...
# typescript
g
I am unable to destroy the stack that was created with what I believe is a bug. Now I am stuck doing a stack surgery... I started with targeting SSM parameters because they have no dependencies (apart form a ComponentResource)
pulumi up --target '**ssm**'
everything as expected
Copy code
Previewing update (myOrg/staging)

View in Browser (Ctrl+O): <https://app.pulumi.com/myOrg/myProject-backend/staging/previews/><redacted>

     Type                                     Name                                            Plan       Info
 +   pulumi:pulumi:Stack                      myProject-backend-staging                         create     2 messages
 +   ├─ pulumi:providers:aws                  myProject-backend-staging-eu-central-1            create     
 +   ├─ pulumi:providers:aws                  myProject-backend-staging-us-east-1               create     
     └─ myOrg:infrastructure:aws:app-backend  myProject-backend-staging-component                          
 +      ├─ aws:ssm:Parameter                  myProject-backend-staging-app-user-password       create     
 +      ├─ aws:ssm:Parameter                  myProject-backend-staging-migrator-user-password  create     
 +      └─ aws:ssm:Parameter                  myProject-backend-staging-db-endpoint             create     


Do you want to perform this update? yes
but then during the
up
phase something went wrong and pulumi tried to deploy a CloudFront resource that wasn't in the preview.
Copy code
Updating (myOrg/staging)

View in Browser (Ctrl+O): <https://app.pulumi.com/myOrg/myProject-backend/staging/updates/1>

     Type                                                  Name                                            Status                       Info
 +   pulumi:pulumi:Stack                                   myProject-backend-staging                         **creating failed (3s)**     2 errors; 2 messages
 +   ├─ pulumi:providers:aws                               myProject-backend-staging-us-east-1               created (0.22s)              
 +   ├─ pulumi:providers:aws                               myProject-backend-staging-eu-central-1            created (0.46s)              
     └─ myOrg:infrastructure:aws:app-backend               myProject-backend-staging-component                                            
 +      ├─ aws:ssm:Parameter                               myProject-backend-staging-migrator-user-password  **creating failed (1s)**     1 error
 +      ├─ aws:ssm:Parameter                               myProject-backend-staging-app-user-password       **creating failed (1s)**     1 error
        └─ myOrg:infrastructure:aws:cloudfront:CloudFront  myProject-backend-staging-cf                      **failed**                   1 error
the whole operation resulted in error and most importantly missing the component resource
myOrg:infrastructure:aws:app-backend
in the state
Copy code
Diagnostics:
  pulumi:pulumi:Stack (myProject-backend-staging):
    Deploying image: 294336126331.dkr.ecr.eu-central-1.amazonaws.com/myProject:08279aac3466f40f38db91017ac92fcd6c048b8d
    error: update failed
    error: Error: invocation of aws:route53/getZone:getZone returned an error: error reading from server: read tcp 127.0.0.1:52645->127.0.0.1:52643: use of closed network connection
        at Object.callback (/Users/user/work/myOrg/takeables/myProject/infrastructure/node_modules/.pnpm/@pulumi+pulumi@3.91.1/node_modules/@pulumi/runtime/invoke.ts:172:37)
        at Object.onReceiveStatus (/Users/user/work/myOrg/takeables/myProject/infrastructure/node_modules/.pnpm/@grpc+grpc-js@1.9.9/node_modules/@grpc/grpc-js/src/client.ts:360:26)
        at Object.onReceiveStatus (/Users/user/work/myOrg/takeables/myProject/infrastructure/node_modules/.pnpm/@grpc+grpc-js@1.9.9/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
        at Object.onReceiveStatus (/Users/user/work/myOrg/takeables/myProject/infrastructure/node_modules/.pnpm/@grpc+grpc-js@1.9.9/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
        at /Users/user/work/myOrg/takeables/myProject/infrastructure/node_modules/.pnpm/@grpc+grpc-js@1.9.9/node_modules/@grpc/grpc-js/src/resolving-call.ts:132:24
        at processTicksAndRejections (node:internal/process/task_queues:77:11)

    Using provided image

  aws:ssm:Parameter (myProject-backend-staging-app-user-password):
    error: post-step event returned an error: failed to verify snapshot: child resource urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend$aws:ssm/parameter:Parameter::myProject-backend-staging-migrator-user-password refers to missing parent urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend::myProject-backend-staging-component

  myOrg:infrastructure:aws:cloudfront:CloudFront (myProject-backend-staging-cf):
    error: resource complete event returned an error: failed to verify snapshot: child resource urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend$aws:ssm/parameter:Parameter::myProject-backend-staging-migrator-user-password refers to missing parent urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend::myProject-backend-staging-component

  aws:ssm:Parameter (myProject-backend-staging-migrator-user-password):
    error: post-step event returned an error: failed to verify snapshot: child resource urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend$aws:ssm/parameter:Parameter::myProject-backend-staging-migrator-user-password refers to missing parent urn:pulumi:staging::myProject-backend::myOrg:infrastructure:aws:app-backend::myProject-backend-staging-component

Resources:
    + 5 created
    14 unchanged

Duration: 10s
now I cannot run even
pulumi destroy
due to
pre-step
error
pre-step event returned an error: failed t ...
I was only able to destroy the resources after I manually removed the missing parent property from the stack. As I did not dare to create the parent component manually, since
"sourcePosition"
was added to the state. I am now really afraid that this may have a huge impact on my next work which relies on stack surgery a lot
m
Could you list the version of pulumi that was used to perform the update with the specified command
Copy code
pulumi up --target '**ssm**'
In the pulumi UI, updates now have metadata associated with them that include the
pulumi.version
There have been a few bugs involving
--target
that are now fixed and it would help us verify which bug you are facing
l
Check your credentials. This error message is associated with expired session tokens:
Copy code
error: Error: invocation of aws:route53/getZone:getZone returned an error: error reading from server: read tcp 127.0.0.1:52645->127.0.0.1:52643: use of closed network connection
g
@mammoth-salesclerk-61945 I used
3.90.0
@little-cartoon-10569 this error message is sadly associated with dozens of other issues 😞
m
@great-sunset-355 I opened an issue to track this https://github.com/pulumi/pulumi/issues/14531
g
Thanks! I had a feeling this was woking before. I wish it could squish the import of component resources as well 🤞