hashicorp / packer-plugin-googlecompute

Packer plugin for Google Compute Builder
https://www.packer.io/docs/builders/googlecompute
Mozilla Public License 2.0
23 stars 51 forks source link

Packer fails on Gitlab-CI with {message:401 Unauthorized}: command not found for chmod #138

Closed alonbnhubsecurity closed 1 year ago

alonbnhubsecurity commented 1 year ago

Community Note

Overview of the Issue

I am trying to use packer with GCP in gitlab-ci but every time I get to the packer build it will fail with the following error:

starting remote command: chmod +x /tmp/script_5147.sh; DEBIAN_FRONTEND='noninteractive' PACKER_BUILDER_TYPE='googlecompute' PACKER_BUILD_NAME='my_vm'  /tmp/script_5147.sh
==> googlecompute.my_vm: /tmp/script_5147.sh: line 1: {message:401 Unauthorized}: command not found
2022/11/13 13:26:05 [INFO] 0 bytes written for 'stdout'
2022/11/13 13:26:05 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/13 13:26:05 [ERROR] Remote command exited with '127': chmod +x /tmp/script_5147.sh; DEBIAN_FRONTEND='noninteractive' PACKER_BUILDER_TYPE='googlecompute' PACKER_BUILD_NAME='my_vm'  /tmp/script_5147.sh
2022/11/13 13:26:05 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/13 13:26:05 [INFO] RPC endpoint: Communicator ended with: 127

Reproduction Steps

I used the hashicorp/packer image for the pipeline as it said to do and it keeps failing for me (running it locally works perfect). The pipeline will start the VM and fail for the reason stated up there, I tried changing the user or image but it did not work as well.

Packer version

for the docker image I used the following tags:

Simplified Packer Template

The packer works locally the first stage which fails in pipeline is

  provisioner "shell" {
    environment_vars = [
      "DEBIAN_FRONTEND=noninteractive"
    ]
    script = "test-vm-setup.sh"
  }

This is installation script and as I get it from the error it's not even starting to run the script.

Operating system and Environment details

I used multiple gitlab runners for that, at first they were gitlab shared runners, after that we used of our own runners each in a different environment. non of them worked

Log Fragments and crash.log files

The full log:

Using Kubernetes namespace: gitlab-runners
Using Kubernetes executor with image hashicorp/packer:latest ...
Using attach strategy to execute scripts...
Preparing environment
00:03
Waiting for pod gitlab-runners/runner-bhdxjxua-project-41120360-concurrent-0lqg6z to be running, status is Pending
Running on runner-bhdxjxua-project-41120360-concurrent-0lqg6z via prod-gitlab-runner-6fdc4bc6df-64dhn...
Getting source from Git repository
00:01
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/hub/test/test-vm/.git/
Created fresh repository.
Checking out 9b90efd8 as Fix-Pipeline...
Skipping Git submodules setup
Downloading artifacts
00:01
Downloading artifacts for import-scripts (3339502901)...
Downloading artifacts from coordinator... ok        id=3339502901 responseStatus=200 OK token=51UEPE1-
Executing "step_script" stage of the job script
01:47
$ packer init ./GCP
2022/11/17 14:25:01 [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:01 [TRACE] discovering plugins in /bin
2022/11/17 14:25:01 [TRACE] discovering plugins in /root/.config/packer/plugins
2022/11/17 14:25:01 [TRACE] discovering plugins in .
2022/11/17 14:25:01 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:01 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:01 [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:01 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2022/11/17 14:25:01 [TRACE] init: plugingetter.ListInstallationsOptions{FromFolders:[]string{"/bin/packer", ".", "/root/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000b08480)}}}}
2022/11/17 14:25:01 [TRACE] listing potential installations for "github.com/hashicorp/googlecompute" that match ">= 0.0.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/bin/packer", ".", "/root/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000b08480)}}}}
2022/11/17 14:25:01 [TRACE] for plugin github.com/hashicorp/googlecompute found 0 matching installation(s)
2022/11/17 14:25:01 [TRACE] getting available versions for the github.com/hashicorp/googlecompute plugin
2022/11/17 14:25:01 [WARNING] github-getter: no GitHub token set, if you intend to install plugins often, please set the PACKER_GITHUB_API_TOKEN env var
2022/11/17 14:25:01 [DEBUG] github-getter: getting "https://api.github.com/repos/hashicorp/packer-plugin-googlecompute/git/matching-refs/tags"
2022/11/17 14:25:01 [DEBUG] will try to install: [1.0.16 1.0.15 1.0.14 1.0.13 1.0.12 1.0.11 1.0.10 1.0.9 1.0.8 1.0.7 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 0.0.2 0.0.1]
2022/11/17 14:25:01 [TRACE] fetching checksums file for the "1.0.16" version of the github.com/hashicorp/googlecompute plugin in "/root/.config/packer/plugins/github.com/hashicorp/googlecompute"...
2022/11/17 14:25:01 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-googlecompute/releases/download/v1.0.16/packer-plugin-googlecompute_v1.0.16_SHA256SUMS"
2022/11/17 14:25:01 [TRACE] ignoring invalid remote binary packer-plugin-googlecompute_v1.0.16_x5.0_windows_amd64.zip: wrong system, expected linux_amd64 
2022/11/17 14:25:01 [TRACE] ignoring invalid remote binary packer-plugin-googlecompute_v1.0.16_x5.0_darwin_arm64.zip: wrong system, expected linux_amd64 
2022/11/17 14:25:01 [TRACE] ignoring invalid remote binary packer-plugin-googlecompute_v1.0.16_x5.0_windows_386.zip: wrong system, expected linux_amd64 
2022/11/17 14:25:01 [TRACE] ignoring invalid remote binary packer-plugin-googlecompute_v1.0.16_x5.0_freebsd_amd64.zip: wrong system, expected linux_amd64 
2022/11/17 14:25:01 [TRACE] ignoring invalid remote binary packer-plugin-googlecompute_v1.0.16_x5.0_openbsd_amd64.zip: wrong system, expected linux_amd64 
2022/11/17 14:25:01 [TRACE] About to get: packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64.zip
2022/11/17 14:25:01 [DEBUG] github-getter: getting "https://github.com/hashicorp/packer-plugin-googlecompute/releases/download/v1.0.16/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64.zip"
2022/11/17 14:25:02 [INFO] (telemetry) Finalizing.
Installed plugin github.com/hashicorp/googlecompute v1.0.16 in "/root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64"
2022/11/17 14:25:02 waiting for all plugin processes to complete...
$ packer validate ./GCP
2022/11/17 14:25:03 [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 [TRACE] discovering plugins in /bin
2022/11/17 14:25:03 [TRACE] discovering plugins in /root/.config/packer/plugins
2022/11/17 14:25:03 [DEBUG] Discovered plugin: googlecompute = /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64
2022/11/17 14:25:03 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/11/17 14:25:03 [INFO] found external [export import] post-processors from googlecompute plugin
2022/11/17 14:25:03 [TRACE] discovering plugins in .
2022/11/17 14:25:03 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2022/11/17 14:25:03 [TRACE] listing potential installations for "github.com/hashicorp/googlecompute" that match ">= 0.0.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/bin/packer", ".", "/root/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000160800)}}}}
2022/11/17 14:25:03 [TRACE] Found the following "github.com/hashicorp/googlecompute" installations: [{/root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 v1.0.16}]
2022/11/17 14:25:03 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/11/17 14:25:03 [INFO] found external [export import] post-processors from googlecompute plugin
2022/11/17 14:25:03 [TRACE] validateValue: not active for ssh_username, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for account_file, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for image_name, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for region, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for size, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for image_family, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for web_client_version, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for arch, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for gitlab_token, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for netdev, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for confidential_host_addr, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for linux_tools_version, so skipping
2022/11/17 14:25:03 [TRACE] validateValue: not active for core_version, so skipping
2022/11/17 14:25:03 [TRACE] Starting external plugin /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2022/11/17 14:25:03 Starting plugin: /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 []string{"/root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2022/11/17 14:25:03 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64
2022/11/17 14:25:03 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:03 Plugin address: unix /tmp/packer-plugin4205389346
2022/11/17 14:25:03 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:03 Waiting for connection...
2022/11/17 14:25:03 Received unix RPC address for /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64: addr is /tmp/packer-plugin4205389346
2022/11/17 14:25:03 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:03 Serving a plugin connection...
2022/11/17 14:25:03 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:03 [TRACE] starting builder -packer-default-plugin-name-
2022/11/17 14:25:03 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:03 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:03 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:03 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin922699084
2022/11/17 14:25:03 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin922699084
2022/11/17 14:25:03 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:03 packer-provisioner-shell plugin: Serving a plugin connection...
2022/11/17 14:25:03 [TRACE] Starting internal plugin packer-provisioner-file
2022/11/17 14:25:03 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-file"}
2022/11/17 14:25:03 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:03 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2022/11/17 14:25:03 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin3149365271
2022/11/17 14:25:03 packer-provisioner-file plugin: Waiting for connection...
2022/11/17 14:25:03 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin3149365271
2022/11/17 14:25:03 packer-provisioner-file plugin: Serving a plugin connection...
2022/11/17 14:25:03 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:03 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:03 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:03 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin2921988408
2022/11/17 14:25:03 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:03 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin2921988408
2022/11/17 14:25:03 packer-provisioner-shell plugin: Serving a plugin connection...
2022/11/17 14:25:03 [TRACE] Starting internal plugin packer-provisioner-file
2022/11/17 14:25:03 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-file"}
2022/11/17 14:25:03 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-file plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:03 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2022/11/17 14:25:03 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin3079808815
2022/11/17 14:25:03 packer-provisioner-file plugin: Waiting for connection...
2022/11/17 14:25:03 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin3079808815
2022/11/17 14:25:03 packer-provisioner-file plugin: Serving a plugin connection...
2022/11/17 14:25:03 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:03 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:03 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:03 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:03 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:03 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin933973122
2022/11/17 14:25:03 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:03 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin933973122
2022/11/17 14:25:03 packer-provisioner-shell plugin: Serving a plugin connection...
The configuration is valid.
2022/11/17 14:25:03 [INFO] (telemetry) Finalizing.
2022/11/17 14:25:03 waiting for all plugin processes to complete...
2022/11/17 14:25:03 /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64: plugin process exited
2022/11/17 14:25:03 /bin/packer: plugin process exited
2022/11/17 14:25:03 /bin/packer: plugin process exited
2022/11/17 14:25:03 /bin/packer: plugin process exited
2022/11/17 14:25:03 /bin/packer: plugin process exited
2022/11/17 14:25:03 /bin/packer: plugin process exited
$ PACKER_LOG=1 packer build ./GCP
2022/11/17 14:25:04 [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 [TRACE] discovering plugins in /bin
2022/11/17 14:25:04 [TRACE] discovering plugins in /root/.config/packer/plugins
2022/11/17 14:25:04 [DEBUG] Discovered plugin: googlecompute = /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64
2022/11/17 14:25:04 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/11/17 14:25:04 [INFO] found external [export import] post-processors from googlecompute plugin
2022/11/17 14:25:04 [TRACE] discovering plugins in .
2022/11/17 14:25:04 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2022/11/17 14:25:04 [TRACE] listing potential installations for "github.com/hashicorp/googlecompute" that match ">= 0.0.1". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/bin/packer", ".", "/root/.config/packer/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0009a6180)}}}}
2022/11/17 14:25:04 [TRACE] Found the following "github.com/hashicorp/googlecompute" installations: [{/root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 v1.0.16}]
2022/11/17 14:25:04 [INFO] found external [-packer-default-plugin-name-] builders from googlecompute plugin
2022/11/17 14:25:04 [INFO] found external [export import] post-processors from googlecompute plugin
2022/11/17 14:25:04 [TRACE] validateValue: not active for core_version, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for web_client_version, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for gitlab_token, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for region, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for image_family, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for ssh_username, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for netdev, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for confidential_host_addr, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for account_file, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for image_name, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for size, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for linux_tools_version, so skipping
2022/11/17 14:25:04 [TRACE] validateValue: not active for arch, so skipping
2022/11/17 14:25:04 [TRACE] Starting external plugin /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2022/11/17 14:25:04 Starting plugin: /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 []string{"/root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2022/11/17 14:25:04 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 Plugin address: unix /tmp/packer-plugin1502783976
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 Waiting for connection...
2022/11/17 14:25:04 Received unix RPC address for /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64: addr is /tmp/packer-plugin1502783976
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 Serving a plugin connection...
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [TRACE] starting builder -packer-default-plugin-name-
2022/11/17 14:25:04 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:04 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:04 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:04 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin552023979
2022/11/17 14:25:04 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin552023979
2022/11/17 14:25:04 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:04 packer-provisioner-shell plugin: Serving a plugin connection...
2022/11/17 14:25:04 [TRACE] Starting internal plugin packer-provisioner-file
2022/11/17 14:25:04 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-file"}
2022/11/17 14:25:04 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:04 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2022/11/17 14:25:04 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin1274509638
2022/11/17 14:25:04 packer-provisioner-file plugin: Waiting for connection...
2022/11/17 14:25:04 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin1274509638
2022/11/17 14:25:04 packer-provisioner-file plugin: Serving a plugin connection...
2022/11/17 14:25:04 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:04 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:04 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:04 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin3783468881
2022/11/17 14:25:04 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:04 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin3783468881
2022/11/17 14:25:04 packer-provisioner-shell plugin: Serving a plugin connection...
2022/11/17 14:25:04 [TRACE] Starting internal plugin packer-provisioner-file
2022/11/17 14:25:04 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-file"}
2022/11/17 14:25:04 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-file plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:04 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2022/11/17 14:25:04 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin3588266905
2022/11/17 14:25:04 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin3588266905
2022/11/17 14:25:04 packer-provisioner-file plugin: Waiting for connection...
2022/11/17 14:25:04 packer-provisioner-file plugin: Serving a plugin connection...
2022/11/17 14:25:04 [TRACE] Starting internal plugin packer-provisioner-shell
2022/11/17 14:25:04 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-shell"}
2022/11/17 14:25:04 Waiting for RPC address for: /bin/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Packer version: 1.8.4 [go1.18.5 linux amd64]
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2022/11/17 14:25:04 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/.cache/packer
2022/11/17 14:25:04 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2022/11/17 14:25:04 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin4129819748
2022/11/17 14:25:04 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin4129819748
2022/11/17 14:25:04 packer-provisioner-shell plugin: Waiting for connection...
2022/11/17 14:25:04 packer-provisioner-shell plugin: Serving a plugin connection...
2022/11/17 14:25:04 Build debug mode: false
2022/11/17 14:25:04 Force build: false
2022/11/17 14:25:04 On error: 
2022/11/17 14:25:04 Waiting on builds to complete...
2022/11/17 14:25:04 Starting build run: googlecompute.test_vm
2022/11/17 14:25:04 Running builder: 
2022/11/17 14:25:04 [INFO] (telemetry) Starting builder googlecompute.test_vm
googlecompute.test_vm: output will be in this color.
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO] Requesting Google token via account_file...
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO]   -- Email: packer-service-account@test-vm.iam.gserviceaccount.com
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO]   -- Private Key Length: 1704
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO] Instantiating GCE client...
2022/11/17 14:25:04 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:04 [INFO] Instantiating OS Login client...
==> googlecompute.test_vm: Checking image does not exist...
==> googlecompute.test_vm: Creating temporary RSA SSH key for instance...
==> googlecompute.test_vm: Using image: ubuntu-2204-jammy-v20221117
==> googlecompute.test_vm: Creating instance...
2022/11/17 14:25:11 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:11 [DEBUG] Adding metadata during instance creation...
    googlecompute.test_vm: Loading zone: us-central1-a
    googlecompute.test_vm: Loading machine type: n1-standard-2
2022/11/17 14:25:11 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:11 [DEBUG] using google-managed encryption key for boot disk
    googlecompute.test_vm: Requesting instance creation...
    googlecompute.test_vm: Waiting for creation operation to complete...
2022/11/17 14:25:12 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:12 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:25:15 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:15 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:25:17 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:17 Retryable error: retrying for state DONE, got RUNNING
    googlecompute.test_vm: Instance has been created!
==> googlecompute.test_vm: Waiting for the instance to become running...
    googlecompute.test_vm: IP: 34.134.26.32
2022/11/17 14:25:19 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:19 Skipping step launch IAP tunnel; "iap" is false.
==> googlecompute.test_vm: Using SSH communicator to connect: 34.134.26.32
2022/11/17 14:25:19 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:19 [INFO] Waiting for SSH, up to timeout: 1h0m0s
==> googlecompute.test_vm: Waiting for SSH to become available...
2022/11/17 14:25:34 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:34 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 34.134.26.32:22: i/o timeout
2022/11/17 14:25:40 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:40 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 34.134.26.32:22: connect: connection refused
2022/11/17 14:25:45 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:45 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 34.134.26.32:22: connect: connection refused
2022/11/17 14:25:50 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:50 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 34.134.26.32:22: connect: connection refused
2022/11/17 14:25:55 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:55 [INFO] Attempting SSH connection to 34.134.26.32:22...
2022/11/17 14:25:55 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:55 [DEBUG] reconnecting to TCP connection for SSH
2022/11/17 14:25:55 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:55 [DEBUG] handshaking with SSH
2022/11/17 14:25:56 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:56 [DEBUG] handshake complete!
2022/11/17 14:25:56 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:56 [INFO] no local agent socket, will not connect agent
==> googlecompute.test_vm: Connected to SSH!
2022/11/17 14:25:56 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:56 Running the provision hook
2022/11/17 14:25:56 [INFO] (telemetry) Starting provisioner shell
==> googlecompute.test_vm: Provisioning with shell script: test-vm-setup.sh
2022/11/17 14:25:56 packer-provisioner-shell plugin: Opening test-vm-setup.sh for reading
2022/11/17 14:25:56 packer-provisioner-shell plugin: [INFO] 31 bytes written for 'uploadData'
2022/11/17 14:25:56 [INFO] 31 bytes written for 'uploadData'
2022/11/17 14:25:56 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:56 [DEBUG] Opening new ssh session
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] Starting remote scp process:  scp -vt /tmp
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] Started SCP session, beginning transfers...
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] Copying input data into temporary file so we can read the length
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] scp: Uploading script_8844.sh: perms=C0644 size=31
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] SCP session complete, closing stdin pipe.
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] Waiting for SSH session to complete.
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] scp stderr (length 69): Sink: C0644 31 script_8844.sh
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: scp: debug1: fd 0 clearing O_NONBLOCK
2022/11/17 14:25:57 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:57 [DEBUG] Opening new ssh session
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [DEBUG] starting remote command: chmod 0755 /tmp/script_8844.sh
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [INFO] RPC endpoint: Communicator ended with: 0
2022/11/17 14:25:58 [INFO] RPC client: Communicator ended with: 0
2022/11/17 14:25:58 [INFO] RPC endpoint: Communicator ended with: 0
2022/11/17 14:25:58 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 0
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [DEBUG] Opening new ssh session
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [DEBUG] starting remote command: chmod +x /tmp/script_8844.sh; DEBIAN_FRONTEND='noninteractive' PACKER_BUILDER_TYPE='googlecompute' PACKER_BUILD_NAME='test_vm'  /tmp/script_8844.sh
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [ERROR] Remote command exited with '127': chmod +x /tmp/script_8844.sh; DEBIAN_FRONTEND='noninteractive' PACKER_BUILDER_TYPE='googlecompute' PACKER_BUILD_NAME='test_vm'  /tmp/script_8844.sh
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 [INFO] RPC endpoint: Communicator ended with: 127
==> googlecompute.test_vm: /tmp/script_8844.sh: line 1: {message:401 Unauthorized}: command not found
2022/11/17 14:25:58 [INFO] 0 bytes written for 'stdout'
2022/11/17 14:25:58 [INFO] 75 bytes written for 'stderr'
2022/11/17 14:25:58 [INFO] RPC client: Communicator ended with: 127
2022/11/17 14:25:58 [INFO] RPC endpoint: Communicator ended with: 127
2022/11/17 14:25:58 packer-provisioner-shell plugin: [INFO] 0 bytes written for 'stdout'
2022/11/17 14:25:58 packer-provisioner-shell plugin: [INFO] 75 bytes written for 'stderr'
2022/11/17 14:25:58 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 127
2022/11/17 14:25:58 [INFO] (telemetry) ending shell
==> googlecompute.test_vm: Provisioning step had errors: Running the cleanup provisioner, if present...
2022/11/17 14:25:58 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:58 Skipping cleanup of IAP tunnel; "iap" is false.
==> googlecompute.test_vm: Deleting instance...
2022/11/17 14:25:59 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:25:59 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:01 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:01 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:03 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:03 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:05 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:05 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:07 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:07 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:10 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:10 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:12 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:12 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:14 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:14 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:16 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:16 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:18 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:18 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:21 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:21 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:23 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:23 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:25 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:25 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:28 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:28 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:30 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:30 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:32 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:32 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:34 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:34 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:36 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:36 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:39 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:39 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:41 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:41 Retryable error: retrying for state DONE, got RUNNING
2022/11/17 14:26:43 packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64 plugin: 2022/11/17 14:26:43 Retryable error: retrying for state DONE, got RUNNING
    googlecompute.test_vm: Instance has been deleted!
==> googlecompute.test_vm: Deleting disk...
    googlecompute.test_vm: Disk has been deleted!
2022/11/17 14:26:46 [INFO] (telemetry) ending googlecompute.test_vm
==> Wait completed after 1 minute 41 seconds
2022/11/17 14:26:46 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/11/17 14:26:46 machine readable: googlecompute.test_vm,error []string{"Script exited with non-zero exit status: 127. Allowed exit codes are: [0]"}
==> Builds finished but no artifacts were created.
Build 'googlecompute.test_vm' errored after 1 minute 41 seconds: Script exited with non-zero exit status: 127. Allowed exit codes are: [0]
==> Wait completed after 1 minute 41 seconds
2022/11/17 14:26:46 [INFO] (telemetry) Finalizing.
==> Some builds didn't complete successfully and had errors:
--> googlecompute.test_vm: Script exited with non-zero exit status: 127. Allowed exit codes are: [0]
==> Builds finished but no artifacts were created.
2022/11/17 14:26:46 waiting for all plugin processes to complete...
2022/11/17 14:26:46 /root/.config/packer/plugins/github.com/hashicorp/googlecompute/packer-plugin-googlecompute_v1.0.16_x5.0_linux_amd64: plugin process exited
2022/11/17 14:26:46 /bin/packer: plugin process exited
2022/11/17 14:26:46 /bin/packer: plugin process exited
2022/11/17 14:26:46 /bin/packer: plugin process exited
2022/11/17 14:26:46 /bin/packer: plugin process exited
2022/11/17 14:26:46 /bin/packer: plugin process exited
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: command terminated with exit code 1
nywilken commented 1 year ago

Thanks for reaching out. We’ll take a look when we get a chance

alonbnhubsecurity commented 1 year ago

Thank you

alonbnhubsecurity commented 1 year ago

Ok, I figured out the problem. I curled some files and the token was not good so when it got to packer it failed because the files were not as expected. I printing the 401 of the curl.