Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteBeforeReplace with failed create - inconsistent state #16179

Open
jesse-triplewhale opened this issue May 12, 2024 · 1 comment
Open

deleteBeforeReplace with failed create - inconsistent state #16179

jesse-triplewhale opened this issue May 12, 2024 · 1 comment
Labels
area/engine Pulumi engine area/resource-options kind/bug Some behavior is incorrect or out of spec

Comments

@jesse-triplewhale
Copy link

What happened?

If I use deleteBeforeReplace: true and the resource deletion succeeds, but the creation fails, the result is inconsistent state. The resource does not exist in the provider, but does exist in pulumi state

Example

new gcp.secretmanager.Secret(
  'testsecret',
  {
    secretId: 'my-test-secret',
    replication: {
      auto: {},
    },
  },
  {
    deleteBeforeReplace: true,
  }
);
  1. pulumi up
    resource now exists in pulumi state and in provider
  2. change secretId to a taken value, my-existing-secret
  3. pulumi up
    resource is successfully deleted, but then not created. resource now exists in pulumi state but not in provider

Output of pulumi about

❯ pulumi about

CLI
Version 3.94.2
Go Version go1.21.3
Go Compiler gc

Plugins
NAME VERSION
clickhouse 0.0.26
cloudflare 5.27.0
datadog 4.28.0
docker 4.5.3
ec 0.8.0
gcp 7.21.1
gcp 7.21.1
google-native 0.32.0
kafka 3.7.3
kubernetes 4.11.0
kubernetes 4.11.0
mongodbatlas 3.15.0
mongodbatlas 3.15.0
nodejs unknown
postgresql 3.11.0
rabbitmq 3.3.2
random 4.16.1
slack 0.4.4

Host
OS darwin
Version 14.4.1
Arch arm64

This project is written in nodejs: executable='/Users/.../.nvm/versions/node/v18.17.1/bin/node' version='v18.17.1'

Current Stack: ...

Found no pending operations associated with shofifi

Backend
Name pulumi.com
URL https://app.pulumi.com/...
User ...
Organizations ...
Token type organization: ...
Token type cloud-build

Pulumi locates its logs in /var/folders/q5/.../T/ by default
warning: Failed to get information about the Pulumi program's dependencies: failed to run "/Users/.../.nvm/versions/node/v18.17.1/bin/npm ls --json --depth=0": exit status 1

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).

@jesse-triplewhale jesse-triplewhale added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 12, 2024
@jesse-triplewhale jesse-triplewhale changed the title deleteBeforeReplace with failed create deleteBeforeReplace with failed create results in inconsistent state May 12, 2024
@jesse-triplewhale jesse-triplewhale changed the title deleteBeforeReplace with failed create results in inconsistent state deleteBeforeReplace with failed create - inconsistent state May 12, 2024
@justinvp justinvp added area/engine Pulumi engine area/resource-options and removed needs-triage Needs attention from the triage team labels May 20, 2024
@justinvp
Copy link
Member

Thanks for opening the issue and sorry for the trouble!

I was able to reproduce the same behavior with a Bucket resource in AWS. I would expect the resource to be removed from the state after it was deleted (and not remain when the create fails).

This looks like it's potentially the same as #8354 (very old issue).

We'll look into picking this up soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Pulumi engine area/resource-options kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants