pulumi / pulumi-digitalocean

A DigitalOcean Pulumi resource package, providing multi-language access to DigitalOcean
Apache License 2.0
83 stars 13 forks source link

Can not delete VPC with members #753

Closed sudocovik closed 3 months ago

sudocovik commented 3 months ago

Describe what happened

I tried to destroy k8s cluster and load balancer which belong to the same VPC. The load balancer got destroyed before destroying VPC unlike the k8s cluster. The program tried to delete VPC before deleting the cluster which resulted in the following error: * Error deleting VPC: DELETE https://api.digitalocean.com/v2/vpcs/<<uuid>>: 409 (request "<<uuid>>") Can not delete VPC with members

Sample program

import * as digitalocean from '@pulumi/digitalocean';

const vpc = new digitalocean.Vpc('vpc', {
  region: 'fra1',
});

new digitalocean.KubernetesCluster('k8s', {
  region: 'fra1',
  version: '1.29.5-do.0',
  vpcUuid: vpc.vpcUrn,
  nodePool: {
    size: 's-1vcpu-2gb',
    nodeCount: 1,
    name: 'worker',
  },
});

new digitalocean.LoadBalancer('lb', {
  region: 'fra1',
  size: 'lb-small',
  vpcUuid: vpc.id,
});

Log output

* Error deleting VPC: DELETE https://api.digitalocean.com/v2/vpcs/<<uuid>>: 409 (request "<<uuid>>") Can not delete VPC with members

Affected Resource(s)

VPC & KubernetesCluster

Output of pulumi about

CLI          
Version      3.120.0
Go Version   go1.22.4
Go Compiler  gc

Plugins
KIND      NAME          VERSION
resource  digitalocean  4.30.2
resource  digitalocean  4.30.2
resource  digitalocean  4.21.0
resource  kubernetes    4.13.1
resource  kubernetes    4.13.1
resource  kubernetes    4.1.0
language  nodejs        unknown

Host     
OS       debian
Version  11.9
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v21.7.3'

Current Stack: covik/fms/dev

TYPE                           URN
pulumi:pulumi:Stack            urn:pulumi:dev::fms::pulumi:pulumi:Stack::fms-dev
pulumi:providers:digitalocean  urn:pulumi:dev::fms::pulumi:providers:digitalocean::default_4_30_2
digitalocean:index/vpc:Vpc     urn:pulumi:dev::fms::digitalocean:index/vpc:Vpc::primary-vpc
pulumi:providers:digitalocean  urn:pulumi:dev::fms::pulumi:providers:digitalocean::default_4_27_0

Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/covik
User           covik
Organizations  covik
Token type     personal

Dependencies:
NAME                               VERSION
@pulumi/digitalocean               4.30.2
@pulumi/kubernetes                 4.13.1
@pulumi/pulumi                     3.120.0
@commitlint/cli                    19.3.0
@commitlint/config-conventional    19.2.2
@types/node                        20.14.2
@typescript-eslint/eslint-plugin   7.13.0
@typescript-eslint/parser          7.13.0
eslint                             8.57.0
eslint-config-prettier             9.1.0
eslint-import-resolver-typescript  3.6.1
eslint-plugin-import               2.29.1
eslint-plugin-n                    16.6.2
eslint-plugin-promise              6.2.0
husky                              9.0.11
prettier                           3.3.2
ts-node                            10.9.2
typescript                         5.4.5
yarn-deduplicate                   6.0.2

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

guineveresaenger commented 3 months ago

Hi @sudocovik - I'm so sorry you're experiencing this issue.

This seems to be a longstanding issue in the upstream provider/the DO service.

For such cases, where the cloud provider is having quirks, we'd recommend you use a custom timeout to prevent this from happening in the future.

sudocovik commented 3 months ago

Hi @guineveresaenger - Thanks for reply. I did increase timeout with customTimeouts: { delete: '3m', }, but progrma exists immediately without respecting any timeouts.

It makes no sense for me that timeout will do anything. It's not waiting for anything, program receives error and exits.