Azure builder context deadline exceeded

1,355 views
Skip to first unread message

goffries

unread,
Oct 11, 2018, 6:08:39 PM10/11/18
to Packer
I'm starting to see the below error with the azure builder. Is there a way to increase the timeout during the resource group deployment?

==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded
==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded

Alvaro Miranda Aguilera

unread,
Oct 15, 2018, 4:56:57 PM10/15/18
to packe...@googlegroups.com
Hello 

Can you provide more context?

what do you mean by resource group deployment?

alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/6e541aff-cb32-4b42-bf0e-deedbcdd9242%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Prashanth Venugopal

unread,
Jul 3, 2019, 4:24:10 PM7/3/19
to Packer
Reviving this thread, since it seems like the closest match to the issue i am seeing.

Running packer 1.4.2 on an ubuntu machine (invoked through a jenkins job, not through the packer plugin on jenkins, but through a shell invocation).
Running azure builder and tried to use shared image gallery replication for all available regions and i run into the following issue -:

On a side note, 
Does SIG image name really mean SIG image definition ?
Is there a way to stipulate how many replications we want, per region for this image (the --replica-count argument in the azure CLI command for shared image galleries).

 [1;36m==> azure: Capturing image ... [0m
 [1;36m==> azure:  -> Compute ResourceGroupName : 'temp-image-resource-group-215' [0m
 [1;36m==> azure:  -> Compute Name              : 'cbn-img-215' [0m
 [1;36m==> azure:  -> Compute Location          : 'West US' [0m
 [1;36m==> azure:  -> Image ResourceGroupName   : 'cbn-base-image' [0m
 [1;36m==> azure:  -> Image Name                : 'test-cbn-base-image-215' [0m
 [1;36m==> azure:  -> Image Location            : 'westus' [0m
 [1;36m==> azure: Publishing to Shared Image Gallery ... [0m
 [1;36m==> azure:  -> MDI ID used for SIG publish     : '/subscriptions/****/resourceGroups/cbn-base-image/providers/Microsoft.Compute/images/test-cbn-base-image-215' [0m
 [1;36m==> azure:  -> SIG publish resource group     : 'cbn-shared-images' [0m
 [1;36m==> azure:  -> SIG gallery name     : 'cbnGallery' [0m
 [1;36m==> azure:  -> SIG image name     : 'cbn-base-beta' [0m
 [1;36m==> azure:  -> SIG image version     : '0.0.215' [0m
 [1;36m==> azure:  -> SIG replication regions    : '[eastus eastus2 westus westeurope eastasia southeastasia japaneast japanwest northcentralus southcentralus centralus northeurope brazilsouth australiaeast australiasoutheast southindia centralindia westindia canadaeast canadacentral westus2 westcentralus uksouth ukwest koreacentral koreasouth francecentral southafricanorth]' [0m
 [1;36m==> azure: [0m
 [1;31m==> azure: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded [0m
 [1;36m==> azure: 
==> azure: Cleanup requested, deleting resource group ... [0m
 [1;36m==> azure: Resource group has been deleted. [0m
 [1;31mBuild 'azure' errored: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded [0m

==> Some builds didn't complete successfully and had errors:
--> azure: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded


JSON file -:



{

"name":"azure",

"client_id": "{{user `az_client_id`}}",

"client_secret": "{{user `az_client_secret`}}",

"subscription_id": "{{user `az_subscription_id`}}",

"image_offer": "UbuntuServer",

"image_publisher": "Canonical",

"image_sku": "18.04-LTS",

"image_version": "18.04.201810030",

"location": "West US",

"os_type": "Linux",

"type": "azure-arm",

"vm_size": "Standard_F16s_v2",

"shared_image_gallery_destination": {

"resource_group": "{{user `az_shrd_resource_group`}}",

"gallery_name": "{{user `az_shrd_gallery_name`}}",

"image_name": "{{user `az_shrd_gallery_img_dfn`}}",

"image_version": "0.0.{{user `build_number`}}",

"replication_regions": ["eastus","eastus2","westus","westeurope","eastasia","southeastasia","japaneast","japanwest","northcentralus","southcentralus","centralus","northeurope","brazilsouth","australiaeast","australiasoutheast","southindia","centralindia","westindia","canadaeast","canadacentral","westus2","westcentralus","uksouth","ukwest","koreacentral","koreasouth","francecentral","southafricanorth"]

},

"managed_image_name": "test-cbn-base-image-{{user `build_number`}}",

"managed_image_resource_group_name": "{{user `az_resource_group`}}",

"temp_compute_name" : "{{user `cbn_image_name`}}",

"temp_resource_group_name" : "{{user `temp_az_resource_group`}}",

"os_disk_size_gb" : 64

},


On Monday, October 15, 2018 at 1:56:57 PM UTC-7, Alvaro Miranda Aguilera wrote:
Hello 

Can you provide more context?

what do you mean by resource group deployment?

alvaro

On Fri, Oct 12, 2018 at 1:08 AM goffries <goff...@gmail.com> wrote:
I'm starting to see the below error with the azure builder. Is there a way to increase the timeout during the resource group deployment?

==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded
==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.


--
Alvaro

Allan Dao

unread,
Oct 25, 2021, 4:37:26 PM10/25/21
to Packer
Hey, this is a bit late but I wanted to post what I found since I was working through similar issues/questions!

In regards to a time out error similar to ==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded, Packer now offers shared_image_gallery_timeout (duration string | ex: "1h5m2s").
The default of around 1 hour is too low, especially given growing dependencies and/or an increased amount of replications (multiple regions replicated to or higher replication count will lead to longer time needed, which is the the timeout field needs to be increased).

For regional replication counts, Packer also now has shared_image_gallery_replica_count (int32)

In regards to image_name (inside of shared_image_gallery_destination), it also seems to me that image_name represents an Image Definition in the Azure portal.

This is a notice I see from Packer when I am publishing to an Azure Shared Image gallery, which might be why there are references to resource group deployment:
==> azure-arm: The resource group was not created by Packer, not deleting

Aside from that,  Prashanth's Packer JSON and the corresponding logs are a great reference for any other details.
Reply all
Reply to author
Forward
0 new messages