Can't delete a child state due to a missing parent...
# general
s
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:<http://helm.sh/v3:Chart|helm.sh/v3:Chart> (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:<http://helm.sh/v3:Chart::mesh-viz|helm.sh/v3:Chart::mesh-viz> 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
mesh-viz
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:<http://helm.sh/v3:Chart::mesh-viz|helm.sh/v3:Chart::mesh-viz>
 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:<http://helm.sh/v3:Chart::mesh-viz|helm.sh/v3:Chart::mesh-viz>" exists in the current state
Not able to escape this race conditions. I also can't delete the inexistent parent either 😂
w
Looks like you are running into the combination of https://github.com/pulumi/pulumi/issues/3583 and https://github.com/pulumi/pulumi/issues/4984. Per the latter - I expect you can work around with
pulumi state delete --disable-integrity-checking
?
s
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:<http://helm.sh/v3:Chart::in|helm.sh/v3:Chart::in> 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
'ed)
heh, being asked to
--force
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
w
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.
s
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:<http://admissionregistration.k8s.io/v1:ValidatingWebhookConfiguration|admissionregistration.k8s.io/v1:ValidatingWebhookConfiguration> (in-ingress-nginx-admission):
    error: resource in-ingress-nginx-admission was not successfully created by the Kubernetes API server : <http://validatingwebhookconfigurations.admissionregistration.k8s.io|validatingwebhookconfigurations.admissionregistration.k8s.io> "in-ingress-nginx-admission" already exists
w
Easiest may be to export the stack and then just remove this resource from it manually, then reimport.