https://pulumi.com logo
#google-cloud
Title
# google-cloud
b

boundless-potato-44574

07/16/2023, 11:31 PM
Question: Phantom Locks? Hi all! First time poster--so apologies for any etiquette missteps! I’ve been using pulumi for a GCP project for almost a year now--implemented by someone else, and maintained by me. I’ve seen my fair share of orphaned locks through that time, and occasionally had to dig into our Google Cloud Storage bucket where those
.pulumi/locks
live, and delete them manually if push comes to shove. Today, however, my Github action that runs pulumi up (and has done so historically) is throwing an error after some rough treatment (
pulumi destroy/refresh/up
with some GUI interference).
Copy code
error: the stack is currently locked by 1 lock(s). Either wait for the other process(es) to end or delete the lock file with `pulumi cancel`.
    <gs://mybucket//.pulumi/locks/test/33cd4732-e6ea-4e4f-a901-12777979d41a.json>: created by runner@fv-az267-906 (pid 2144) at 2023-07-16T18:45:19Z
And finally the puzzle: there is NO file at that URL. In fact, the entire locks directory is absent (as it usually is when there are no locks). This error is persisting even after
pulumi cancel/refresh/destroy
and I’m at my wit’s end! Has anyone seen this behavior before? Has anyone figured out how to get past it? Maybe resetting the stack some other way, or forcing the github action to refresh its cache? Thanks!
(To be clear, there are no official caches listed on my github actions management page)
Alright--here’s the workaround I worked up, for anyone interested. 1. Create an actual lock on the stack by starting a
pulumi refresh
2. Copy/paste/rename it to match the phantom lock 3. Complete the refresh 4. Finally
gsutil rm <gs://mybucket/.pulumi/locks/test/33cd4732-e6ea-4e4f-a901-12777979d41a.json>
to delete the fake lock (NB the URL is slightly different) Voila! The 👻 is gone!