Skip to content
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

Shared Image Gallery Deadline Exceeded Error #8802

Closed
alex-ogden opened this issue Feb 27, 2020 · 3 comments
Closed

Shared Image Gallery Deadline Exceeded Error #8802

alex-ogden opened this issue Feb 27, 2020 · 3 comments

Comments

@alex-ogden
Copy link

alex-ogden commented Feb 27, 2020

Overview of the Issue

We are trying to deploy our Windows 10 1809 64-bit image into our shared image gallery and whilst trying to deploy it is failing with the following error message:

2020-02-26T17:39:58Z: ==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded

Reproduction Steps

Deploy a customised Windows 10 1809 image into a shared image gallery within the same region

Packer version

1.5.3 (also tested in 1.5.1, 1.4.5 and 1.4.3)

Simplified Packer Buildfile

gist

Operating system and Environment details

Packer runner server: CentOS Linux release 7.7.1908 3.10.0-1062.12.1.el7.x86_64
Image: Windows 10 1809 64-bit
Cloud provider: Microsoft Azure

Log Fragments and crash.log files

2020-02-26T17:39:58Z: ==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded 2020-02-26T17:39:58Z: ==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded 2020-02-26T17:39:58Z: ==> azure-arm: Step "StepPublishToSharedImageGallery" failed

If you need any more detail please let me know!

@pmozbert
Copy link

I am also seeing this on 1.5.5. The timeout is exactly 1 hour after start of publishing to the image gallery. Looks like it is ignoring the polling_duration_timout parameter which is set to 3h

�[1;32m==> azure-arm: Publishing to Shared Image Gallery ...�[0m
�[1;32m==> azure-arm:  -> MDI ID used for SIG publish		: '/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/packer-7b38ad67-db10-4a0b-83d5-dcaaed41b16a/providers/Microsoft.Compute/images/packertempwin10prog1'�[0m
�[1;32m==> azure-arm:  -> SIG publish resource group		: 'prod.pce.sharedservices.imagegallery.eastus2'�[0m
�[1;32m==> azure-arm:  -> SIG gallery name				: 'prod.pce.sharedservices.imagegallery.eastus2.01'�[0m
�[1;32m==> azure-arm:  -> SIG image name				: 'GF-Base-Windows10-Pro-G1'�[0m
�[1;32m==> azure-arm:  -> SIG image version			: '2020.210.79598'�[0m
�[1;32m==> azure-arm:  -> SIG replication regions			: '[eastus eastus2 northcentralus]'�[0m
�[1;32m==> azure-arm:  -> SIG image version endoflife date		: ''�[0m
�[1;32m==> azure-arm:  -> SIG image version exclude from latest	: 'false'�[0m
�[1;32m==> azure-arm:  -> SIG replica count [1, 10] 		: '1'�[0m
2020/07/28 22:25:17 packer-builder-azure-arm plugin: Azure request method="PUT" request="https://management.azure.com/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/prod.pce.sharedservices.imagegallery.eastus2/providers/Microsoft.Compute/galleries/prod.pce.sharedservices.imagegallery.eastus2.01/images/GF-Base-Windows10-Pro-G1/versions/2020.210.79598?api-version=2019-03-01" body="{\"location\":\"eastus2\",\"properties\":{\"publishingProfile\":{\"replicaCount\":1,\"excludeFromLatest\":false,\"targetRegions\":[{\"name\":\"eastus\"},{\"name\":\"eastus2\"},{\"name\":\"northcentralus\"}],\"source\":{\"managedImage\":{\"id\":\"/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/packer-7b38ad67-db10-4a0b-83d5-dcaaed41b16a/providers/Microsoft.Compute/images/packertempwin10prog1\"}}}},\"tags\":{\"ImageBase\":\"Windows-10-19h2-pro-latest\",\"ImageExpireDate\":\"2020-10-28\"}}"
2020/07/28 22:25:18 packer-builder-azure-arm plugin: Azure response x-ms-request-id="18ea1017-7dec-4c4a-9559-41774d016718" body="{\r\n  \"name\": \"2020.210.79598\",\r\n  \"id\": \"/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/prod.pce.sharedservices.imagegallery.eastus2/providers/Microsoft.Compute/galleries/prod.pce.sharedservices.imagegallery.eastus2.01/images/GF-Base-Windows10-Pro-G1/versions/2020.210.79598\",\r\n  \"type\": \"Microsoft.Compute/galleries/images/versions\",\r\n  \"location\": \"eastus2\",\r\n  \"tags\": {\r\n    \"ImageBase\": \"Windows-10-19h2-pro-latest\",\r\n    \"ImageExpireDate\": \"2020-10-28\",\r\n    \"pces.identity:costcenter\": \"213061\",\r\n    \"pces.identity:envc\": \"prod\",\r\n    \"pces.identity:id\": \"prod.pce.hub\",\r\n    \"pces.identity:org-id\": \"PC0\",\r\n    \"pces.identity:reference-architecture\": \"Foundation-Hubs-0.9\",\r\n    \"pces.identity:version\": \"0.9\"\r\n  },\r\n  \"properties\": {\r\n    \"publishingProfile\": {\r\n      \"source\": {\r\n        \"managedImage\": {\r\n          \"id\": \"/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/packer-7b38ad67-db10-4a0b-83d5-dcaaed41b16a/providers/Microsoft.Compute/images/packertempwin10prog1\"\r\n        }\r\n      },\r\n      \"targetRegions\": [\r\n        {\r\n          \"name\": \"East US\",\r\n          \"regionalReplicaCount\": 1,\r\n          \"storageAccountType\": \"Standard_LRS\"\r\n        },\r\n        {\r\n          \"name\": \"East US 2\",\r\n          \"regionalReplicaCount\": 1,\r\n          \"storageAccountType\": \"Standard_LRS\"\r\n        },\r\n        {\r\n          \"name\": \"North Central US\",\r\n          \"regionalReplicaCount\": 1,\r\n          \"storageAccountType\": \"Standard_LRS\"\r\n        }\r\n      ],\r\n      \"replicaCount\": 1,\r\n      \"excludeFromLatest\": false,\r\n      \"publishedDate\": \"2020-07-28T22:25:18.1266454+00:00\",\r\n      \"storageAccountType\": \"Standard_LRS\"\r\n    },\r\n    \"storageProfile\": {},\r\n    \"provisioningState\": \"Creating\"\r\n  }\r\n}" status="201 Created" method="PUT" request="https://management.azure.com/subscriptions/12ef276f-c342-456f-b802-909283fed03a/resourceGroups/prod.pce.sharedservices.imagegallery.eastus2/providers/Microsoft.Compute/galleries/prod.pce.sharedservices.imagegallery.eastus2.01/images/GF-Base-Windows10-Pro-G1/versions/2020.210.79598?api-version=2019-03-01"
2020/07/28 22:25:18 packer-builder-azure-arm plugin: Azure request method="GET" request="https://management.azure.com/subscriptions/12ef276f-c342-456f-b802-909283fed03a/providers/Microsoft.Compute/locations/eastus2/capsOperations/18ea1017-7dec-4c4a-9559-41774d016718?api-version=2019-03-01" body=""
2020/07/28 22:25:18 packer-builder-azure-arm plugin: Azure response request="https://management.azure.com/subscriptions/12ef276f-c342-456f-b802-909283fed03a/providers/Microsoft.Compute/locations/eastus2/capsOperations/18ea1017-7dec-4c4a-9559-41774d016718?api-version=2019-03-01" x-ms-request-id="48b3dedf-3aa5-487b-b0ce-c8619c8a54a2" body="{\r\n  \"startTime\": \"2020-07-28T22:25:18.1266454+00:00\",\r\n  \"status\": \"InProgress\",\r\n  \"name\": \"18ea1017-7dec-4c4a-9559-41774d016718\"\r\n}" status="200 OK" method="GET"
...


2020/07/28 23:24:24 packer-builder-azure-arm plugin: Azure response status="200 OK" method="GET" request="https://management.azure.com/subscriptions/12ef276f-c342-456f-b802-909283fed03a/providers/Microsoft.Compute/locations/eastus2/capsOperations/18ea1017-7dec-4c4a-9559-41774d016718?api-version=2019-03-01" x-ms-request-id="96ecbd4e-cf66-405d-aa58-cdcde25f74c8" body="{\r\n  \"startTime\": \"2020-07-28T22:25:18.1266454+00:00\",\r\n  \"status\": \"InProgress\",\r\n  \"name\": \"18ea1017-7dec-4c4a-9559-41774d016718\"\r\n}"
�[1;32m==> azure-arm:�[0m
�[1;31m==> azure-arm: Future#WaitForCompletion: context has been cancelled: StatusCode=200 -- Original Error: context deadline exceeded�[0m

Replication is to 3 nearby regions:

"polling_duration_timeout": "3h",
			"shared_image_gallery_destination": {
				"resource_group": "{{user `gallery_resource_group`}}",
				"gallery_name": "{{user `gallery_name`}}",
				"image_name": "{{user `image_name`}}",
				"image_version": "{{user `gallery_image_version`}}",
				"replication_regions": ["eastus", "eastus2", "northcentralus"]
			},

@CellsReinvent
Copy link

I think it's the replication that's taking the time. Have you set the shared_image_gallery_timeout? I bumped mine to 2h (only replicating to 1 region) and it worked for me.

@ghost
Copy link

ghost commented Apr 30, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-azure#36 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-azure#36.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants