Can't delete a child state due to a missing parent...
# general
Can't delete a child state due to a missing parent state (tried refreshing, and deleting resources out of band..., also tried recreating the missing namespace and
pulumi refresh
ing, but the same error pops up(!))
Copy code
$ pulumi up -fy
  kubernetes:<|> (in):
    error: resource complete event returned an error: failed to verify snapshot: child resource urn:pulumi:omega::haze::kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:<|> refers to missing parent urn:pulumi:omega::haze::kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace::linkerd-viz
so it claims
chart URN exists, yet it doesn't...
Copy code
$ pulumi state delete urn:pulumi:omega::haze::kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:core/v1:Namespace$kubernetes:<|>
 warning: This command will edit your stack's state directly. Confirm? Yes
error: No such resource "urn:pulumi:omega::haze::kubernetes:core/v1:Namespace:core/v1:Namespace:core/v1:Namespace:core/v1:Namespace:<|>" exists in the current state
Not able to escape this race conditions. I also can't delete the inexistent parent either 😂
Looks like you are running into the combination of and Per the latter - I expect you can work around with
pulumi state delete --disable-integrity-checking
Copy code
error: the current deployment has 2 resource(s) with pending operations:
  * urn:pulumi:omega::haze::kubernetes:core/v1:Namespace::ingress, interrupted while creating
  * urn:pulumi:omega::haze::kubernetes:core/v1:Namespace::pulumi, interrupted while creating
Copy code
$ pulumi state delete --disable-integrity-checking urn:pulumi:omega::haze::kubernetes:core/v1:Namespace::ingress
 warning: This command will edit your stack's state directly. Confirm? Yes
error: No such resource "urn:pulumi:omega::haze::kubernetes:core/v1:Namespace::ingress" exists in the current state
tried also
Copy code
$ pulumi stack export | pulumi stack import
error: 2 errors occurred:
    1) state file contains errors: child resource urn:pulumi:omega::haze::kubernetes:core/v1:Namespace$kubernetes:<|> refers to missing parent urn:pulumi:omega::haze::kubernetes:core/v1:Namespace::ingress
    2) importing this file could be dangerous; rerun with --force to proceed anyway
how can I wipe everything and start over? 🙂 (I already
microk8s reset
heh, being asked to
on a freshly restored microk8s 1-node cluster with zero resources
Copy code
pulumi stack rm
This will permanently remove the 'omega' stack!
Please confirm that this is what you'd like to do by typing ("omega"): omega
error: 'omega' still has resources; removal rejected; pass --force to override
I'm not precisely following the set of steps you took here that led to each of these. It is certainly the case that once you have a corrupted checkpoint file, many other CLI features will behave incorrectly or surprisingly - and the two linked issues are about (1) fixing the one known case where a checkpoint file can become corrupted and (2) ensuring that at least
pulumi state delete
can behave reliably even in face of a corrupted checkpoint file, as this is a primary tool for fixing things up if this ever does happen. If you are still stuck here - could you summarize the state you are in - and we can likely provide some guidance on steps to get back into a good state.
thanks @white-balloon-205 is there a way to delete the clusterrolebindings (etc.) that pulumi would have managed? (seems to be the last thing remaining for a "clean slate")
Copy code
kubernetes:<|> (in-ingress-nginx-admission):
    error: resource in-ingress-nginx-admission was not successfully created by the Kubernetes API server : <|> "in-ingress-nginx-admission" already exists
Easiest may be to export the stack and then just remove this resource from it manually, then reimport.