I'm not too sure if I'm doing something wrong, but...
# general
a
I'm not too sure if I'm doing something wrong, but
pulumi refresh
doesn't seem to be working for digital ocean droplets. I'm currently facing the following error, when trying to delete an existing droplet:
Copy code
* Error waiting for droplet to be unlocked for destroy (xxx): Error retrieving droplet: GET <https://api.digitalocean.com/v2/droplets/xxx>: 404 (request "xxx") The resource you were accessing could not be found.
The droplet no longer exists on the digital ocean dashboard, which probably suggests there is a mismatch between the pulumi state and what's actually on digital ocean. However, when I run
pulumi refresh
, it states that there are no changes and the issue persists.
i
you mention
pulumi refresh
twice, but was one of those mentions supposed to be
pulumi up
?
a
Not really,
pulumi up
seems to be working as intended reporting back the error message. But
pulumi refresh
should sync the states correctly, which doesn't appear to be happening.
i
I’m confused then because you say that refresh shows no changes, but then you also posted an error message. So is it failing on the error message or is it saying no changes? It can’t be both
Okay got it, the error message is coming from up, not refresh
a
The error message shows when I run
pulumi up
because pulumi thinks the droplet is still live when in fact it no longer exists. From my understanding, sometimes the state of pulumi vs what is actually provisioned can go out of sync for various reasons.
pulumi refresh
is supposed to fix such discrepancy but for some reason, it doesn't seem to be doing anything on digital ocean droplets.
i
When you run refresh what does it show on the right hand side for the droplet resource? I think you can also add a parameter to show a detailed diff
a
nothing appears on the right side of the droplet. (the plan column is empty) when I select details, this shows:
Copy code
details
  pulumi:pulumi:Stack: (same)
i
Try —diff and —show-sames
You may also need to stack export > state.json just to get an understanding of what’s in the stack state
a
Thanks @icy-controller-6092! I got it working by force deleting the state. https://www.pulumi.com/docs/cli/commands/pulumi_state_delete/
i
Nice, you could also raise a bug for the digital ocean provider. It should have refreshed state properly