Closed hc-github-team-packer closed 2 years ago
I ran into this issue. Google support told me they had updated the behavior of IAP so that it returns the 4047 error code in cases where a Compute Engine instance is still being created. They've added this code to the IAP documentation. Packer should treat 4047 as a retryable error.
Hi there @ketanjoshi10, apologies for the delayed response here. I believe this issue has been resolved in the latest release of Packer and the Google Compute plugin. I'm going to close this issue. But please upgrade and advise if you are still running into issues here.
This issue was originally opened by @ketanjoshi10 in https://github.com/hashicorp/packer/issues/11245 and has been migrated to this repository. The original issue description is below.
Overview of the Issue
I am trying to create a simple image using Packer in GCP. I have all the required access to GCP console through CLI. On triggering the Packer.json script it fails with below error:
Can anyone suggest a resolution for this?
Reproduction Steps
First created the VPC, subnet and firewall rule to allow ssh IAP access in this VPC.
I have created a service account with the following permissions:
Packer version
Tried on 1.7.4 as well as 1.6.6
Simplified Packer Buildfile
{ "variables": { "project_id": "my-gcp-project", "image_name": "my-packer-image", "instance_name": "my-packer-instance", "service_account_email": "my-service-account@my-gcp-project.iam.gserviceaccount.com", "zone": "us-east4-c", "subnetwork": "my-gcp-subnet" },