Hi there, I'm attempting to destroy my stack using...
# general
h
Hi there, I'm attempting to destroy my stack using
pulumi destroy
(I'm using Pulumi Cloud). When I run that command it fails (as expected) because there are protected resources.
Copy code
node ➜ /workspaces/evilapp/infrastructure (main) $ pulumi destroy
Previewing destroy (evilcorp/dev)

View in Browser (Ctrl+O): <https://app.pulumi.com/evilcorp/evilapp/dev/previews/da03a63e-2b01-4659-85c4-2b22658efac2>

     Type                                            Name                             Plan       Info
     pulumi:pulumi:Stack                             evilapp-dev                                1 error
 -   ├─ kubernetes:cert-manager.io/v1:ClusterIssuer  letsencrypt-staging              delete     
 -   ├─ kubernetes:cert-manager.io/v1:ClusterIssuer  letsencrypt-prod                 delete     
 -   ├─ kubernetes:helm.sh/v3:Release                cert-manager-release             delete     
 -   ├─ kubernetes:helm.sh/v3:Release                ingress-nginx-release            delete     
 -   ├─ kubernetes:core/v1:Namespace                 ingress-nginx-namespace          delete     
 -   ├─ kubernetes:core/v1:Namespace                 cert-manager-namespace           delete     
 -   ├─ pulumi:providers:kubernetes                  k8s-provider                     delete     
 -   ├─ digitalocean:index:Project                   do-project                       delete     
 -   ├─ gitlab:index:ProjectVariable                 project-var-pulumi-access-token  delete     1 error
 -   ├─ gitlab:index:ProjectHook                     pulumi-cloud-hook                delete     1 error
 -   └─ digitalocean:index:KubernetesCluster         do-cluster                       delete     

Diagnostics:
  pulumi:pulumi:Stack (evilapp-dev):
    error: preview failed

  gitlab:index:ProjectVariable (project-var-pulumi-access-token):
    error: Preview failed: resource "urn:pulumi:dev::evilapp::gitlab:index/projectVariable:ProjectVariable::project-var-pulumi-access-token" cannot be deleted
    because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
    `pulumi state unprotect 'urn:pulumi:dev::evilapp::gitlab:index/projectVariable:ProjectVariable::project-var-pulumi-access-token'`

  gitlab:index:ProjectHook (pulumi-cloud-hook):
    error: Preview failed: resource "urn:pulumi:dev::evilapp::gitlab:index/projectHook:ProjectHook::pulumi-cloud-hook" cannot be deleted
    because it is protected. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up`, or use the command:
    `pulumi state unprotect 'urn:pulumi:dev::evilapp::gitlab:index/projectHook:ProjectHook::pulumi-cloud-hook'`
However, when I run
pulumi destroy --exclude-protected
I get a unhelpful grpc client related error.
Copy code
node ➜ /workspaces/evilapp/infrastructure (main) $ pulumi destroy --exclude-protected
Previewing destroy (evilcorp/dev)

View in Browser (Ctrl+O): <https://app.pulumi.com/evilcorp/evilapp/dev/previews/03b380cd-2e1e-435e-aadf-5eb8d737450f>

     Type                 Name          Plan     Info
     pulumi:pulumi:Stack  evilapp-dev           1 error

Diagnostics:
  pulumi:pulumi:Stack (evilapp-dev):
    error: rpc error: code = Canceled desc = grpc: the client connection is closing
If I increase the verbosity of Pulumi I get these related log lines.
Copy code
deploymentExecutor.Execute(...): error performing deletes: rpc error: code = Canceled desc = grpc: the client connection is closing
eventSink::Error(<{%reset%}>rpc error: code = Canceled desc = grpc: the client connection is closing<{%reset%}>)
StepExecutor worker(-1): StepExecutor.waitForCompletion(): waiting for worker threads to exit
StepExecutor worker(-2): worker received nil chain, exiting
StepExecutor worker(-1): StepExecutor.waitForCompletion(): worker threads all exited
deploymentExecutor.Execute(...): step executor has completed
Any idea on how to proceed?
s
sometimes pulumi has a slow timeout for deleting kubernetes because of the cloud api provider is slow. I sometimes have to manually delete the nodegroup and eks cluster to move it forward.
h
Is there anyway to increase the timeout, this happens consistently for me it isn't a once in awhile failure.
s
that indicates there is something wrong with your code. it shouldnt take more then 15 minutes usually.
h
my code, doesn't cause an issue when running
pulumi destroy
without the
--exclude-protected
option.
The preview is displayed without issue, it's only when I add
--exclude-protected
I get this error relating to a grpc client.