-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem copying snapshots to regions when building #122
Comments
Hi @wolfsage, Thanks for flagging this issue for us! I've been able to reproduce the problem. Like you, I am pretty confused about this one. I've opened a PR to address this #123 |
Thanks! |
I just want to add this for anyone else having similar trouble: Before this fix, it seems that with the buggy behaviour, we'd kick off a bunch of transfers in quick succession, but never actually wait for them to complete. But with the bugfix in #123, each transfer is waited on before the next is started. This is causing us new problems because one transfer took 1h20m, and so the build timed out. I've hacked around this for now by disabling the "wait for transfers to complete" step, which gets us back to the earlier behaviour:
and it seems to be working. Cheers |
Overview of the Issue
Since yesterday, packer build has bailed out when copying an image to other regions like so:
What's interesting here is 2030587156 is not a valid image id. That's an action id! And it's easy to see where this value came from:
https://github.com/digitalocean/packer-plugin-digitalocean/blob/main/builder/digitalocean/step_snapshot.go#L98
Breaking down what's happening:
Below we create a transfer request. This uses images[0].ID so posts to /images/1234/actions {type:transfer, region:...}
And then we're suppose to poll that action to wait for it to finish. Polling that would be /images/1234/actions/imageTransfer.ID.
But instead, we're passing what seem to me the wrong things to WaitForImageState:
We're passing in the imageTransfer.ID (which is an action id!) to images/<...>/, and then we're passing in action.ID which comes from much higher:
... so that's the ID of a snapshot action on a droplet. This feels like a bug, and I'm not sure how this ever worked. Shouldn't the code be:
I don't understand how this ever worked to be honest. My two theories are:
Reproduction Steps
packer build with a configuration like this:
Plugin and Packer version
Packer v1.9.2
packer-plugin-digitalocean_v1.1.1_x5.0_linux_amd64
Operating system and Environment details
Linux 4.19.0-23-cloud-amd64 #1 SMP Debian 4.19.269-1 (2022-12-20) x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: