hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.11k stars 3.33k forks source link

Error importing SSH public key for oslogin on GCP GCE #10170

Closed stevoscot92 closed 3 years ago

stevoscot92 commented 4 years ago

Overview of the Issue

GCE temporary builder instance is unable to import the ssh pub key for OSlogin. I believe the specific request made to add the temp key generated by packer to login profile is users.importSshPublicKey. This appears to be the root cause of the issue I am having. It appears the request made is not including the user which is resulting in the error. I have tested this by executing the request, with user specified, on the GCE temporary builder instance where the error is occurring. This request is successful when the user is specified. Whereas if I execute this request without specifying the user, the same error occurs.

Reproduction Steps

Steps to reproduce this issue

  1. Create GCE temporary builder instance with service account 'image-builder' that is granted Compute instance admin v1 and Compute OS Admin Login IAM roles.
  2. Install below Packer version
  3. Execute Packer using the below config.

Packer version

Packer v1.6.4

Simplified Packer Buildfile

"builders": [{
--
  | "name":         "shell",
  | "type":                  "googlecompute",
  | "image_name":     "oslogin-test-image",
  | "image_family":   "oslogin",
  | "project_id":     "test-project",
  | "source_image_family": "gce-rhel7-stage2",
  | "source_image_project_id": "image-project",
  | "disk_size":      "60",
  | "machine_type":   "n1-standard-1",
  | "subnetwork": "projects/vpchost-dev/regions/europe-west2/subnetworks/vpc1-europe-west2",
  | "zone":                  "europe-west2-a",
  | "tags" : "firewall-tag",
  | "omit_external_ip": true,
  | "use_internal_ip": true,
  | "use_os_login": true,
  | "ssh_username": "packer",
  | "service_account_email": "gce-stage3-image-builder@test-project.iam.gserviceaccount.com",
  | "image_encryption_key": {
  | "kmsKeyName": "projects/kms-project/locations/europe-west2/keyRings/computeEngine/cryptoKeys/HSMcomputeEngine"
  | },
  | "scopes": [
  | "https://www.googleapis.com/auth/cloud-platform"
  | ],
  | "image_labels": {
  | "type": "shell",
  | "iac_terraform": "terraform_11"
  | }

Operating system and Environment details

OS: RHEL 7

Log Fragments and crash.log files

module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 [INFO] Packer version: 1.6.4 [go1.15.2 linux amd64]
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Checking 'PACKER_CONFIG' for a config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 'PACKER_CONFIG' not set; checking the default config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Attempting to open config file: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 [WARN] Config file doesn't exist: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Setting cache directory: /tmp/build/test-project/imagefactory/packer_cache
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=xxxxxea8-f903-xxxx-2264-xxxxxxxx6e8c&version=1.6.4": dial tcp: lookup checkpoint-api.hashicorp.com on 169.254.169.254:53: no such host
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Creating plugin client for path: /tmp/build/terraform/packer
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Starting plugin: /tmp/build/terraform/packer []string{"/tmp/build/terraform/packer", "plugin", "packer-builder-googlecompute"}
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Waiting for RPC address for: /tmp/build/terraform/packer
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: [INFO] Packer version: 1.6.4 [go1.15.2 linux amd64]
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Checking 'PACKER_CONFIG' for a config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: 'PACKER_CONFIG' not set; checking the default config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Attempting to open config file: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: [WARN] Config file doesn't exist: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Setting cache directory: /tmp/build/test-project/imagefactory/packer_cache
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Received unix RPC address for /tmp/build/terraform/packer: addr is /tmp/packer-plugin009735448
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: args: []string{"packer-builder-googlecompute"}
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Plugin address: unix /tmp/packer-plugin009735448
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Waiting for connection...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Creating plugin client for path: /tmp/build/terraform/packer
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Starting plugin: /tmp/build/terraform/packer []string{"/tmp/build/terraform/packer", "plugin", "packer-provisioner-shell"}
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: Serving a plugin connection...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=xxxxxx-f903-xxxxx-2264-xxxxxxxx&version=1.6.4": dial tcp: lookup checkpoint-api.hashicorp.com on 169.254.169.254:53: no such host
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Waiting for RPC address for: /tmp/build/terraform/packer
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: [INFO] Packer version: 1.6.4 [go1.15.2 linux amd64]
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Checking 'PACKER_CONFIG' for a config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: 'PACKER_CONFIG' not set; checking the default config file path
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Attempting to open config file: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Setting cache directory: /tmp/build/test-project/imagefactory/packer_cache
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Received unix RPC address for /tmp/build/terraform/packer: addr is /tmp/packer-plugin689964338
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin689964338
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Waiting for connection...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: Serving a plugin connection...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Preparing build: shell
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-provisioner-shell plugin: [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=xxxxxxx-f903-xxxxx-2264-xxxxxxxxxx&version=1.6.4": dial tcp: lookup checkpoint-api.hashicorp.com on 169.254.169.254:53: no such host
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Build debug mode: false
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Force build: false
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 On error:
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Waiting on builds to complete...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Starting build run: shell
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 Running builder: googlecompute
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 [INFO] (telemetry) Starting builder googlecompute
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: [INFO] Requesting Google token via GCE API Default Client Token Source...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:43 packer-builder-googlecompute plugin: [INFO] Instantiating GCE client...
module.middleware.null_resource.create_image (local-exec): ==> shell: Checking image does not exist...
module.middleware.null_resource.create_image (local-exec): ==> shell: Creating temporary SSH key for instance...
module.middleware.null_resource.create_image (local-exec): ==> shell: Importing SSH public key for OSLogin...
module.middleware.null_resource.create_image (local-exec): ==> shell: Error importing SSH public key for OSLogin: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
module.middleware.null_resource.create_image (local-exec): ==> shell: <html lang=en>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec): ==> shell:   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <style>
module.middleware.null_resource.create_image (local-exec): ==> shell: <html lang=en>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec): ==> shell:   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <style>
module.middleware.null_resource.create_image (local-exec): ==> shell:     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec): ==> shell:   </style>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>
module.middleware.null_resource.create_image (local-exec): ==> shell:
module.middleware.null_resource.create_image (local-exec): ==> shell:     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec): ==> shell:   </style>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec): ==> shell:   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>
module.middleware.null_resource.create_image (local-exec): ==> shell:
module.middleware.null_resource.create_image (local-exec): ==> shell: Deleting SSH public key for OSLogin...
module.middleware.null_resource.create_image (local-exec): ==> shell: Error deleting SSH public key for OSLogin. Please delete it manually.
module.middleware.null_resource.create_image (local-exec): ==> shell:
module.middleware.null_resource.create_image (local-exec): ==> shell: Error: googleapi: Error 401: End user credentials not provided., unauthorized
module.middleware.null_resource.create_image (local-exec): Build 'shell' errored after 669 milliseconds 868 microseconds: Error importing SSH public key for OSLogin: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
module.middleware.null_resource.create_image (local-exec): <html lang=en>
module.middleware.null_resource.create_image (local-exec):   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec):   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec):   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec):   <style>
module.middleware.null_resource.create_image (local-exec):     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec):   </style>
module.middleware.null_resource.create_image (local-exec):   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec):   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec):   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>

module.middleware.null_resource.create_image (local-exec): ==> Wait completed after 669 milliseconds 948 microseconds

module.middleware.null_resource.create_image (local-exec): ==> Some builds didn't complete successfully and had errors:
module.middleware.null_resource.create_image (local-exec): ==> shell:
module.middleware.null_resource.create_image (local-exec): ==> shell: Error: googleapi: Error 401: End user credentials not provided., unauthorized
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 [INFO] (telemetry) ending googlecompute
module.middleware.null_resource.create_image (local-exec): <html lang=en>
module.middleware.null_resource.create_image (local-exec):   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec):   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec):   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec):   <style>
module.middleware.null_resource.create_image (local-exec):     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec):   </style>
module.middleware.null_resource.create_image (local-exec):   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec):   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec):   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>
module.middleware.null_resource.create_image (local-exec): ==> Wait completed after 669 milliseconds 948 microseconds
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 machine readable: error-count []string{"1"}
module.middleware.null_resource.create_image (local-exec): ==> Some builds didn't complete successfully and had errors:
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 machine readable: shell,error []string{"Error importing SSH public key for OSLogin: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>\n<html lang=en>\n  <meta charset=utf-8>\n  <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n  <title>Error 404 (Not Found)!!1</title>\n  <style>\n    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n  </style>\n  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n  <p><b>404.</b> <ins>That’s an error.</ins>\n  <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>\n"}
module.middleware.null_resource.create_image (local-exec): <html lang=en>
module.middleware.null_resource.create_image (local-exec):   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec):   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec):   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec):   <style>
module.middleware.null_resource.create_image (local-exec):     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec):   </style>
module.middleware.null_resource.create_image (local-exec):   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec):   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec):   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>
module.middleware.null_resource.create_image (local-exec): ==> Builds finished but no artifacts were created.
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 [INFO] (telemetry) Finalizing.
module.middleware.null_resource.create_image (local-exec): --> shell: Error importing SSH public key for OSLogin: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
module.middleware.null_resource.create_image (local-exec): <html lang=en>
module.middleware.null_resource.create_image (local-exec):   <meta charset=utf-8>
module.middleware.null_resource.create_image (local-exec):   <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
module.middleware.null_resource.create_image (local-exec):   <title>Error 404 (Not Found)!!1</title>
module.middleware.null_resource.create_image (local-exec):   <style>
module.middleware.null_resource.create_image (local-exec):     *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
module.middleware.null_resource.create_image (local-exec):   </style>
module.middleware.null_resource.create_image (local-exec):   <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
module.middleware.null_resource.create_image (local-exec):   <p><b>404.</b> <ins>That’s an error.</ins>
module.middleware.null_resource.create_image (local-exec):   <p>The requested URL <code>/v1/users/:importSshPublicKey?alt=json&amp;prettyPrint=false</code> was not found on this server.  <ins>That’s all we know.</ins>

module.middleware.null_resource.create_image (local-exec): ==> Builds finished but no artifacts were created.
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 [WARN] (telemetry) Error finalizing report. This is safe to ignore. Post "https://checkpoint-api.hashicorp.com/v1/telemetry/packer": dial tcp: lookup checkpoint-api.hashicorp.com on 169.254.169.254:53: no such host
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 waiting for all plugin processes to complete...
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 /tmp/build/terraform/packer: plugin process exited
module.middleware.null_resource.create_image (local-exec): 2020/10/26 18:04:44 /tmp/build/terraform/packer: plugin process exited
nywilken commented 4 years ago

Hi there @stevoscot92 thanks for opening up this issue. We will take a look as soon as we get a chance to see what might be going on. Cheers!

sylviamoss commented 3 years ago

Hello, @seventieskid implemented a solution for this, and here are the binaries you can use to test it. https://app.circleci.com/pipelines/github/hashicorp/packer/8242/workflows/ff70433d-686c-4fb6-b8b9-d9bb214ab628/jobs/96190/artifacts Please, let us know if it works as expected. Thanks!

ghost commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.