api-v2 icon indicating copy to clipboard operation
api-v2 copied to clipboard

NYC2 shutdown/snapshot race issue

Open gabriel403 opened this issue 9 years ago • 3 comments

I think this is a bit of a compound problem, I use packer to build base snapshots on digital ocean On LON1, NYC3 I have no problems, however on NYC2 after the build process completes I seem to run into a shutdown/snapshot race issue

NYC2

==> digitalocean: Gracefully shutting down droplet...
==> digitalocean: Creating snapshot: staging-14.10-snap
==> digitalocean: Error creating snapshot: digitalocean request error: map[id:unprocessable_entity message:Droplet already has a pending event.]
==> digitalocean: Destroying droplet...
==> digitalocean: Error destroying droplet. Please destroy it manually: curl 'https://api.digitalocean.com/droplets/[droplet_id_redacted]/destroy?client_id=&api_key='
==> digitalocean: Deleting temporary ssh key...
Build 'digitalocean' errored: Error creating snapshot: digitalocean request error: map[id:unprocessable_entity message:Droplet already has a pending event.]

NYC3

==> digitalocean: Gracefully shutting down droplet...
==> digitalocean: Creating snapshot: staging-14.10-snap
==> digitalocean: Waiting for snapshot to complete...
==> digitalocean: Destroying droplet...
==> digitalocean: Deleting temporary ssh key...
Build 'digitalocean' finished.

gabriel403 avatar Mar 28 '15 11:03 gabriel403

Seems like this would be worth bringing up to packer. We only allow certain events to process serially. The completion of the shutdown should be verified before the snapshot is issued.

macb avatar Mar 28 '15 15:03 macb

From curl 'https://api.digitalocean.com/droplets/[droplet_id_redacted]/destroy?client_id=&api_key=' it looks to be using the V1 api, but to echo what @macb said it looks like the shutdown event is still pending when the snapshot event is issued.

brookemckim avatar Mar 28 '15 21:03 brookemckim

OK I'll bump it over to packer see what they say, thanks @macb @brookemckim

gabriel403 avatar Mar 31 '15 19:03 gabriel403