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

Packer skips provisioning steps during Windows build #13301

Open
kdlugajczyk opened this issue Feb 18, 2025 · 0 comments
Open

Packer skips provisioning steps during Windows build #13301

kdlugajczyk opened this issue Feb 18, 2025 · 0 comments
Labels

Comments

@kdlugajczyk
Copy link

kdlugajczyk commented Feb 18, 2025

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Overview of the Issue

Occasionally, Packer skips certain steps during the Windows image build process. Based on my yesterday tests, this occurs approximately once every 10 runs. In that case, Packer skipped the Windows Update step and one of three PowerShell scripts (script-3.ps1, but that also seems to be random). Despite these omissions, Packer does not provide any indication that the image is incomplete — the build still completes successfully. Additionally, the faulty run was significantly shorter (~15 minutes) compared to a proper run (~30 minutes).

Reproduction Steps

Build Windows image using similar template multiple times, search for incomplete image and shorter build time.

Packer version

1.12.0

Simplified Packer Template

packer {
  required_plugins {
    azure = {
      version = ">= 1.0.0"
      source  = "github.com/hashicorp/azure"
    }
    windows-update = {
      version = "0.16.8"
      source  = "github.com/rgl/windows-update"
    }
  }
}

source "azure-arm" "autogenerated_1" {

  image_offer = "windows-10"
  image_publisher = "MicrosoftWindowsDesktop"
  image_sku = "win10-22h2-pro-g2"

  <...>
}

build {
  sources = ["source.azure-arm.autogenerated_1"]

  provisioner "windows-update" {
  }

  provisioner "powershell" {
    scripts = [
      "./scripts/windows/script-1.ps1",
      "./scripts/windows/script-2.ps1",
      "./scripts/windows/script-3.ps1"
      ]
  }
}

All scripts contain $ErrorActionPreference = 'Stop'; at the very beginning.

Operating system and Environment details

Ubuntu 24

Log Fragments and crash.log files

Logs with PACKER_LOG=1 option. I've compared proper and faulty run logs line by line, and pasted here only the differences.

Windows update

Faulty run
2025-02-17T15:29:49.7974824Z 2025/02/17 15:29:49 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:29:49 Uploading file to 'C:/Windows/Temp/packer-windows-update.ps1'
2025-02-17T15:29:51.6246427Z   azure-arm.autogenerated_1: Running Windows update... 
2025-02-17T15:29:51.6310417Z 2025/02/17 15:29:51 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
2025-02-17T15:29:51.6321212Z 2025/02/17 15:29:51 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 0
2025-02-17T15:29:51.6321848Z 2025/02/17 15:29:51 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:29:51.6322249Z 2025/02/17 15:29:51 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:29:51.6322522Z 2025/02/17 15:29:51 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:29:51.6323409Z 2025/02/17 15:29:51 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:29:51.6323885Z 2025/02/17 15:29:51 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:29:51.6326597Z 2025/02/17 15:29:51 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:29:51.6327091Z 2025/02/17 15:29:51 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:29:51.6328255Z 2025/02/17 15:29:51 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:29:51 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:29:51.6330519Z 2025/02/17 15:29:51 [INFO] (telemetry) ending windows-update
Proper run
2025-02-17T15:25:54.5920876Z 2025/02/17 15:25:54 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:25:54 Uploading file to 'C:/Windows/Temp/packer-windows-update.ps1'
2025-02-17T15:25:56.6854142Z   azure-arm.autogenerated_1: Running Windows update... 
2025-02-17T15:25:56.9163470Z 2025/02/17 15:25:56 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:25:56 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
2025-02-17T15:26:06.0626223Z      azure-arm.autogenerated_1: Searching for Windows updates... 
2025-02-17T15:26:21.1251288Z      azure-arm.autogenerated_1: Found Windows update (2023-10-20; 67.69 MB): Microsoft .NET Framework 4.8.1 for Windows 10 Version 22H2 for x64 (KB5011048) 
2025-02-17T15:26:21.1254780Z      azure-arm.autogenerated_1: Found Windows update (2024-10-10; 0.81 MB): 2024-10 Update for Windows 10 Version 22H2 for x64-based Systems (KB5001716) 
2025-02-17T15:26:21.1258960Z      azure-arm.autogenerated_1: Found Windows update (2025-01-28; 76.04 MB): 2025-01 Cumulative Update Preview for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 22H2 for x64 (KB5050593) 
2025-02-17T15:26:21.1264572Z      azure-arm.autogenerated_1: Found Windows update (2025-02-11; 77.52 MB): Windows Malicious Software Removal Tool x64 - v5.132 (KB890830) 
2025-02-17T15:26:21.1269349Z      azure-arm.autogenerated_1: Found Windows update (2025-02-17; 185.42 MB): Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.421.1945.0) - Current Channel (Broad) 
2025-02-17T15:26:21.1273366Z      azure-arm.autogenerated_1: Found Windows update (2023-10-26; 3.07 MB): 2023-10 Update for Windows 10 Version 22H2 for x64-based Systems (KB4023057) 
2025-02-17T15:26:21.1276617Z      azure-arm.autogenerated_1: Downloading Windows updates (6 updates; 410.55 MB)... 
2025-02-17T15:26:51.1871927Z      azure-arm.autogenerated_1: Installing Windows updates... 
2025-02-17T15:27:03.6577354Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 100% cpu; 32% memory)... 
2025-02-17T15:28:05.4207803Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 7% cpu; 25% memory)... 
2025-02-17T15:29:06.5297096Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 31% cpu; 24% memory)... 
2025-02-17T15:30:07.7157377Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 4% cpu; 26% memory)... 
2025-02-17T15:31:08.8384324Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 1% cpu; 24% memory)... 
2025-02-17T15:31:23.8663654Z      azure-arm.autogenerated_1: Waiting for the Windows Modules Installer to exit... 
2025-02-17T15:31:53.3815461Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 101
2025-02-17T15:31:53.3816273Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 101
2025-02-17T15:31:53.3816703Z 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:31:53.3817037Z 2025/02/17 15:31:53 [INFO] 1387 bytes written for 'stdout'
2025-02-17T15:31:53.3817412Z 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 101
2025-02-17T15:31:53.3817826Z 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 101
2025-02-17T15:31:53.3821135Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 1387 bytes written for 'stdout'
2025-02-17T15:31:53.3821862Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:31:53.3822365Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 101
2025-02-17T15:31:53.3828059Z   azure-arm.autogenerated_1: Restarting the machine... 
2025-02-17T15:31:53.5047098Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] starting remote command: shutdown.exe -f -r -t 0 -c "packer restart"
2025-02-17T15:31:53.5552871Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] command 'shutdown.exe -f -r -t 0 -c "packer restart"' exited with code: 0
2025-02-17T15:31:53.5553741Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:31:53.5554162Z 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:31:53.5554990Z 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:31:53.5555359Z 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:31:53.5555724Z 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:31:53.5556377Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:31:53.5556913Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:31:53.5559256Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:31:53.5563054Z   azure-arm.autogenerated_1: Waiting for machine to become available... 
2025-02-17T15:31:53.8265813Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] starting remote command: shutdown.exe -f -r -t 60 -c "packer restart test"
2025-02-17T15:31:53.8820877Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] command 'shutdown.exe -f -r -t 60 -c "packer restart test"' exited with code: 1115
2025-02-17T15:31:53.8821481Z 2025/02/17 15:31:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 1115
2025-02-17T15:31:53.8824550Z 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:31:53.8825024Z 2025/02/17 15:31:53 [INFO] 40 bytes written for 'stderr'
2025-02-17T15:31:53.8826174Z 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 1115
2025-02-17T15:31:53.8826882Z 2025/02/17 15:31:53 [INFO] RPC endpoint: Communicator ended with: 1115
2025-02-17T15:31:53.8827314Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:31:53.8827822Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] 40 bytes written for 'stderr'
2025-02-17T15:31:53.8828553Z   azure-arm.autogenerated_1: A system shutdown is in progress.(1115) 
2025-02-17T15:31:53.8829019Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 [INFO] RPC client: Communicator ended with: 1115
2025-02-17T15:31:53.8829557Z 2025/02/17 15:31:53 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:31:53 Retryable error: Machine not yet available (exit status 1115)
2025-02-17T15:32:25.6172790Z 2025/02/17 15:32:25 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:25.6173391Z 2025/02/17 15:32:25 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:25.6174118Z 2025/02/17 15:32:25 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:25 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:25.6174824Z 2025/02/17 15:32:25 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:25 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:25.6177217Z 2025/02/17 15:32:25 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:25 Retryable error: unknown error Post "https://10.2.1.50:5986/wsman": read tcp 10.2.1.62:42820->10.2.1.50:5986: read: connection reset by peer
2025-02-17T15:32:41.8292717Z 2025/02/17 15:32:41 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:41.8293590Z 2025/02/17 15:32:41 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:41.8294216Z 2025/02/17 15:32:41 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:41 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:41.8294836Z 2025/02/17 15:32:41 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:41 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:41.8295260Z 2025/02/17 15:32:41 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:41 Retryable error: unknown error Post "https://10.2.1.50:5986/wsman": dial tcp 10.2.1.50:5986: connect: connection refused
2025-02-17T15:32:48.3881937Z 2025/02/17 15:32:48 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] starting remote command: shutdown.exe -f -r -t 60 -c "packer restart test"
2025-02-17T15:32:48.4789712Z 2025/02/17 15:32:48 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] command 'shutdown.exe -f -r -t 60 -c "packer restart test"' exited with code: 0
2025-02-17T15:32:48.4790607Z 2025/02/17 15:32:48 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:32:48.4791184Z 2025/02/17 15:32:48 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:48.4791595Z 2025/02/17 15:32:48 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:48.4791995Z 2025/02/17 15:32:48 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:32:48.4792404Z 2025/02/17 15:32:48 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:32:48.4793401Z 2025/02/17 15:32:48 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:48.4795335Z 2025/02/17 15:32:48 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:48.4796042Z 2025/02/17 15:32:48 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:32:48.7616362Z 2025/02/17 15:32:48 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:48 [INFO] starting remote command: shutdown.exe -a
2025-02-17T15:32:49.2874172Z 2025/02/17 15:32:49 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] command 'shutdown.exe -a' exited with code: 0
2025-02-17T15:32:49.2875208Z 2025/02/17 15:32:49 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:32:49.2875986Z 2025/02/17 15:32:49 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:49.2876419Z 2025/02/17 15:32:49 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:49.2876811Z 2025/02/17 15:32:49 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:32:49.2877242Z 2025/02/17 15:32:49 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:32:49.2879308Z 2025/02/17 15:32:49 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:32:49.2879856Z 2025/02/17 15:32:49 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:32:49.2880402Z 2025/02/17 15:32:49 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:32:49.2883291Z   azure-arm.autogenerated_1: Checking for pending restart... 
2025-02-17T15:32:49.8357954Z 2025/02/17 15:32:49 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:32:49 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-pending-reboot-elevated.ps1
2025-02-17T15:33:01.7925621Z 2025/02/17 15:33:01 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-pending-reboot-elevated.ps1' exited with code: 0
2025-02-17T15:33:01.7926627Z 2025/02/17 15:33:01 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:33:01.7927093Z 2025/02/17 15:33:01 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:33:01.7927425Z 2025/02/17 15:33:01 [INFO] 28 bytes written for 'stdout'
2025-02-17T15:33:01.7927792Z 2025/02/17 15:33:01 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:33:01.7928338Z 2025/02/17 15:33:01 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:33:01.7928801Z 2025/02/17 15:33:01 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] 28 bytes written for 'stdout'
2025-02-17T15:33:01.7929332Z 2025/02/17 15:33:01 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:33:01.7929839Z 2025/02/17 15:33:01 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:33:01.7930626Z      azure-arm.autogenerated_1: pkrvmrrjaw7bfdu restarted. 
2025-02-17T15:33:01.7933155Z   azure-arm.autogenerated_1: Restart complete 
2025-02-17T15:33:01.7937940Z   azure-arm.autogenerated_1: Running Windows update... 
2025-02-17T15:33:01.9185340Z 2025/02/17 15:33:01 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:33:01 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
2025-02-17T15:33:09.9569513Z      azure-arm.autogenerated_1: Searching for Windows updates... 
2025-02-17T15:33:35.3475049Z      azure-arm.autogenerated_1: Found Windows update (2020-03-04; 4.89 MB): Update for Windows Defender Antivirus antimalware platform - KB4052623 (Version 4.18.2001.10) 
2025-02-17T15:33:35.3479419Z      azure-arm.autogenerated_1: Found Windows update (2024-10-29; 12.93 MB): Update for Microsoft Defender Antivirus antimalware platform - KB4052623 (Version 4.18.24090.11) - Current Channel (Broad) 
2025-02-17T15:33:35.3483309Z      azure-arm.autogenerated_1: Found Windows update (2025-01-28; 75.42 MB): 2025-01 Cumulative Update Preview for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 22H2 for x64 (KB5050593) 
2025-02-17T15:33:35.3486138Z      azure-arm.autogenerated_1: Downloading Windows updates (3 updates; 93.24 MB)... 
2025-02-17T15:33:35.3490769Z      azure-arm.autogenerated_1: Installing Windows updates... 
2025-02-17T15:34:06.7070416Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 1% cpu; 15% memory)... 
2025-02-17T15:34:46.7692121Z      azure-arm.autogenerated_1: Waiting for the Windows Modules Installer to exit... 
2025-02-17T15:35:07.8627206Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 4% cpu; 19% memory)... 
2025-02-17T15:36:08.9551745Z      azure-arm.autogenerated_1: Waiting for operation to complete (system performance: 1% cpu; 19% memory)... 
2025-02-17T15:36:58.5550363Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 101
2025-02-17T15:36:58.5551572Z 2025/02/17 15:36:58 [INFO] 884 bytes written for 'stdout'
2025-02-17T15:36:58.5552193Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 101
2025-02-17T15:36:58.5552767Z 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:36:58.5553243Z 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 101
2025-02-17T15:36:58.5553800Z 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 101
2025-02-17T15:36:58.5554636Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 884 bytes written for 'stdout'
2025-02-17T15:36:58.5555191Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:36:58.5557792Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 101
2025-02-17T15:36:58.5561885Z   azure-arm.autogenerated_1: Restarting the machine... 
2025-02-17T15:36:58.6439985Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] starting remote command: shutdown.exe -f -r -t 0 -c "packer restart"
2025-02-17T15:36:58.6852984Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] command 'shutdown.exe -f -r -t 0 -c "packer restart"' exited with code: 0
2025-02-17T15:36:58.6855027Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:36:58.6855461Z 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:36:58.6855831Z 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:36:58.6856255Z 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:36:58.6856613Z 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:36:58.6857869Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:36:58.6858783Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:36:58.6859495Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:36:58.6863277Z   azure-arm.autogenerated_1: Waiting for machine to become available... 
2025-02-17T15:36:58.8598134Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] starting remote command: shutdown.exe -f -r -t 60 -c "packer restart test"
2025-02-17T15:36:58.9166692Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] command 'shutdown.exe -f -r -t 60 -c "packer restart test"' exited with code: 1115
2025-02-17T15:36:58.9167297Z 2025/02/17 15:36:58 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 1115
2025-02-17T15:36:58.9169623Z 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:36:58.9171191Z 2025/02/17 15:36:58 [INFO] 40 bytes written for 'stderr'
2025-02-17T15:36:58.9171619Z 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 1115
2025-02-17T15:36:58.9172000Z 2025/02/17 15:36:58 [INFO] RPC endpoint: Communicator ended with: 1115
2025-02-17T15:36:58.9172673Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:36:58.9173368Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] 40 bytes written for 'stderr'
2025-02-17T15:36:58.9174199Z   azure-arm.autogenerated_1: A system shutdown is in progress.(1115) 
2025-02-17T15:36:58.9174894Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 [INFO] RPC client: Communicator ended with: 1115
2025-02-17T15:36:58.9175475Z 2025/02/17 15:36:58 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:36:58 Retryable error: Machine not yet available (exit status 1115)
2025-02-17T15:37:08.7387091Z 2025/02/17 15:37:08 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:08.7387567Z 2025/02/17 15:37:08 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:08.7388158Z 2025/02/17 15:37:08 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:08 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:08.7388827Z 2025/02/17 15:37:08 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:08 Retryable error: unknown error Post "https://10.2.1.50:5986/wsman": read tcp 10.2.1.62:58824->10.2.1.50:5986: read: connection reset by peer
2025-02-17T15:37:08.7389352Z 2025/02/17 15:37:08 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:08 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:27.6001585Z 2025/02/17 15:37:27 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] starting remote command: shutdown.exe -f -r -t 60 -c "packer restart test"
2025-02-17T15:37:27.8223537Z 2025/02/17 15:37:27 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] command 'shutdown.exe -f -r -t 60 -c "packer restart test"' exited with code: 0
2025-02-17T15:37:27.8224947Z 2025/02/17 15:37:27 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:27.8225685Z 2025/02/17 15:37:27 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:27.8226160Z 2025/02/17 15:37:27 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:27.8226513Z 2025/02/17 15:37:27 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:27.8226850Z 2025/02/17 15:37:27 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:27.8229304Z 2025/02/17 15:37:27 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:27.8229867Z 2025/02/17 15:37:27 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:27.8230367Z 2025/02/17 15:37:27 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:27 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:28.3825280Z 2025/02/17 15:37:28 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] starting remote command: shutdown.exe -a
2025-02-17T15:37:28.5129719Z 2025/02/17 15:37:28 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] command 'shutdown.exe -a' exited with code: 0
2025-02-17T15:37:28.5130626Z 2025/02/17 15:37:28 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:28.5131047Z 2025/02/17 15:37:28 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:28.5131365Z 2025/02/17 15:37:28 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:28.5132461Z 2025/02/17 15:37:28 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:28.5132835Z 2025/02/17 15:37:28 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:28.5136260Z 2025/02/17 15:37:28 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:37:28.5137279Z 2025/02/17 15:37:28 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:28.5137989Z 2025/02/17 15:37:28 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:28.5141718Z   azure-arm.autogenerated_1: Checking for pending restart... 
2025-02-17T15:37:28.8560408Z 2025/02/17 15:37:28 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:28 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-pending-reboot-elevated.ps1
2025-02-17T15:37:37.6749649Z 2025/02/17 15:37:37 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-pending-reboot-elevated.ps1' exited with code: 0
2025-02-17T15:37:37.6750351Z 2025/02/17 15:37:37 [INFO] 28 bytes written for 'stdout'
2025-02-17T15:37:37.6750664Z 2025/02/17 15:37:37 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:37.6751070Z 2025/02/17 15:37:37 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:37.6751593Z 2025/02/17 15:37:37 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:37.6751923Z 2025/02/17 15:37:37 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:37:37.6754069Z 2025/02/17 15:37:37 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] 28 bytes written for 'stdout'
2025-02-17T15:37:37.6754708Z 2025/02/17 15:37:37 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:37:37.6755200Z 2025/02/17 15:37:37 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:37:37.6755937Z      azure-arm.autogenerated_1: pkrvmrrjaw7bfdu restarted. 
2025-02-17T15:37:37.6759799Z   azure-arm.autogenerated_1: Restart complete 
2025-02-17T15:37:37.6764713Z   azure-arm.autogenerated_1: Running Windows update... 
2025-02-17T15:37:37.7231604Z 2025/02/17 15:37:37 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:37:37 [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
2025-02-17T15:37:46.0573822Z      azure-arm.autogenerated_1: Searching for Windows updates... 
2025-02-17T15:38:10.6708300Z 2025/02/17 15:38:10 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:38:10 [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 0
2025-02-17T15:38:10.6709103Z 2025/02/17 15:38:10 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:38:10 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:38:10.6713172Z 2025/02/17 15:38:10 [INFO] 60 bytes written for 'stdout'
2025-02-17T15:38:10.6713649Z 2025/02/17 15:38:10 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:38:10.6714519Z 2025/02/17 15:38:10 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:38:10.6714881Z 2025/02/17 15:38:10 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:38:10.6715530Z      azure-arm.autogenerated_1: No Windows updates found 
2025-02-17T15:38:10.6715989Z 2025/02/17 15:38:10 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:38:10 [INFO] 60 bytes written for 'stdout'
2025-02-17T15:38:10.6716505Z 2025/02/17 15:38:10 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:38:10 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:38:10.6716985Z 2025/02/17 15:38:10 packer-plugin-windows-update_v0.16.8_x5.0_linux_amd64 plugin: 2025/02/17 15:38:10 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:38:10.6717435Z 2025/02/17 15:38:10 [INFO] (telemetry) ending windows-update

Script-3.ps1 execution

Faulty run
2025-02-17T15:30:10.8905154Z   azure-arm.autogenerated_1: Provisioning with powershell script: ./scripts/windows/script-3.ps1 
2025-02-17T15:30:10.8906901Z 2025/02/17 15:30:10 packer-provisioner-powershell plugin: Opening ./scripts/windows/script-3.ps1 for reading
2025-02-17T15:30:10.8908475Z 2025/02/17 15:30:10 packer-provisioner-powershell plugin: Uploading env vars to c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1
2025-02-17T15:30:10.8909071Z 2025/02/17 15:30:10 packer-provisioner-powershell plugin: [INFO] 201 bytes written for 'uploadData'
2025-02-17T15:30:10.8911542Z 2025/02/17 15:30:10 [INFO] 201 bytes written for 'uploadData'
2025-02-17T15:30:10.8912269Z 2025/02/17 15:30:10 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:10 Uploading file to 'c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1'
2025-02-17T15:30:12.2400858Z 2025/02/17 15:30:12 packer-provisioner-powershell plugin: [INFO] 1259 bytes written for 'uploadData'
2025-02-17T15:30:12.2401598Z 2025/02/17 15:30:12 [INFO] 1259 bytes written for 'uploadData'
2025-02-17T15:30:12.2402125Z 2025/02/17 15:30:12 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:12 Uploading file to 'c:/Windows/Temp/script-67b355f5-7413-c956-bc06-e94b452eb847.ps1'
2025-02-17T15:30:13.6860263Z 2025/02/17 15:30:13 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:13 [INFO] starting remote command: powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1; &'c:/Windows/Temp/script-67b355f5-7413-c956-bc06-e94b452eb847.ps1'; exit $LastExitCode }"
2025-02-17T15:30:13.6870069Z 2025/02/17 15:30:13 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:13 [INFO] command 'powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1; &'c:/Windows/Temp/script-67b355f5-7413-c956-bc06-e94b452eb847.ps1'; exit $LastExitCode }"' exited with code: 0
2025-02-17T15:30:13.6871067Z 2025/02/17 15:30:13 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:13 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:30:13.6871700Z 2025/02/17 15:30:13 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:30:13.6872039Z 2025/02/17 15:30:13 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:30:13.6872432Z 2025/02/17 15:30:13 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:30:13.6872993Z 2025/02/17 15:30:13 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:30:13.6875511Z 2025/02/17 15:30:13 packer-provisioner-powershell plugin: [INFO] 0 bytes written for 'stdout'
2025-02-17T15:30:13.6875976Z 2025/02/17 15:30:13 packer-provisioner-powershell plugin: [INFO] 0 bytes written for 'stderr'
2025-02-17T15:30:13.6876413Z 2025/02/17 15:30:13 packer-provisioner-powershell plugin: [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:30:13.6877734Z 2025/02/17 15:30:13 packer-provisioner-powershell plugin: c:/Windows/Temp/script-67b355f5-7413-c956-bc06-e94b452eb847.ps1 returned with exit code 0
2025-02-17T15:30:13.6878725Z 2025/02/17 15:30:13 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:30:13.6881777Z 2025/02/17 15:30:13 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:30:13.6882337Z 2025/02/17 15:30:13 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:13 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b355f5-28c7-a527-1370-00abb559a4ba.ps1'
2025-02-17T15:30:15.1966896Z 2025/02/17 15:30:15 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:15 [INFO] starting remote command: powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1; &'c:/Windows/Temp/packer-cleanup-67b355f5-28c7-a527-1370-00abb559a4ba.ps1'; exit $LastExitCode }"
2025-02-17T15:30:15.6776789Z 2025/02/17 15:30:15 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:15 [INFO] command 'powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b355f5-9c35-15ec-39d7-baed9067b882.ps1; &'c:/Windows/Temp/packer-cleanup-67b355f5-28c7-a527-1370-00abb559a4ba.ps1'; exit $LastExitCode }"' exited with code: 0
2025-02-17T15:30:15.6777872Z 2025/02/17 15:30:15 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:30:15 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:30:15.6778325Z 2025/02/17 15:30:15 [INFO] 0 bytes written for 'stdout'
2025-02-17T15:30:15.6778637Z 2025/02/17 15:30:15 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:30:15.6778976Z 2025/02/17 15:30:15 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:30:15.6779337Z 2025/02/17 15:30:15 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:30:15.6779833Z 2025/02/17 15:30:15 packer-provisioner-powershell plugin: [INFO] 0 bytes written for 'stdout'
2025-02-17T15:30:15.6780241Z 2025/02/17 15:30:15 packer-provisioner-powershell plugin: [INFO] 0 bytes written for 'stderr'
2025-02-17T15:30:15.6780649Z 2025/02/17 15:30:15 packer-provisioner-powershell plugin: [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:30:15.6781011Z 2025/02/17 15:30:15 [INFO] (telemetry) ending powershell
Proper run
2025-02-17T15:38:53.1018780Z   azure-arm.autogenerated_1: Provisioning with powershell script: ./scripts/windows/script-3.ps1 
2025-02-17T15:38:53.1019506Z 2025/02/17 15:38:53 packer-provisioner-powershell plugin: Opening ./scripts/windows/script-3.ps1 for reading
2025-02-17T15:38:53.1021528Z 2025/02/17 15:38:53 packer-provisioner-powershell plugin: Uploading env vars to c:/Windows/Temp/packer-ps-env-vars-67b357f9-9e60-3a37-673c-6d0746cbf26c.ps1
2025-02-17T15:38:53.1022281Z 2025/02/17 15:38:53 packer-provisioner-powershell plugin: [INFO] 201 bytes written for 'uploadData'
2025-02-17T15:38:53.1025304Z 2025/02/17 15:38:53 [INFO] 201 bytes written for 'uploadData'
2025-02-17T15:38:53.1025805Z 2025/02/17 15:38:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:38:53 Uploading file to 'c:/Windows/Temp/packer-ps-env-vars-67b357f9-9e60-3a37-673c-6d0746cbf26c.ps1'
2025-02-17T15:38:56.7297709Z 2025/02/17 15:38:56 packer-provisioner-powershell plugin: [INFO] 1259 bytes written for 'uploadData'
2025-02-17T15:38:56.7298049Z 2025/02/17 15:38:56 [INFO] 1259 bytes written for 'uploadData'
2025-02-17T15:38:56.7298372Z 2025/02/17 15:38:56 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:38:56 Uploading file to 'c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1'
2025-02-17T15:39:00.4538595Z 2025/02/17 15:39:00 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:39:00 [INFO] starting remote command: powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b357f9-9e60-3a37-673c-6d0746cbf26c.ps1; &'c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1'; exit $LastExitCode }"
2025-02-17T15:39:02.7024180Z      azure-arm.autogenerated_1: Installing Chocolatey ... 
                                  <all script related logs are present, but I removed them from this log>
2025-02-17T15:41:02.9272665Z 2025/02/17 15:41:02 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:02 [INFO] command 'powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. c:/Windows/Temp/packer-ps-env-vars-67b357f9-9e60-3a37-673c-6d0746cbf26c.ps1; &'c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1'; exit $LastExitCode }"' exited with code: 0
2025-02-17T15:41:02.9273769Z 2025/02/17 15:41:02 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:02 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:41:02.9274284Z 2025/02/17 15:41:02 [INFO] 0 bytes written for 'stderr'
2025-02-17T15:41:02.9275523Z 2025/02/17 15:41:02 [INFO] 4129 bytes written for 'stdout'
2025-02-17T15:41:02.9275914Z 2025/02/17 15:41:02 [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:41:02.9276282Z 2025/02/17 15:41:02 [INFO] RPC endpoint: Communicator ended with: 0
2025-02-17T15:41:02.9277525Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: [INFO] 4129 bytes written for 'stdout'
2025-02-17T15:41:02.9277973Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: [INFO] 0 bytes written for 'stderr'
2025-02-17T15:41:02.9278364Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: [INFO] RPC client: Communicator ended with: 0
2025-02-17T15:41:02.9283810Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1 returned with exit code 0
2025-02-17T15:41:02.9287453Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:02.9289160Z 2025/02/17 15:41:02 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:02.9291295Z 2025/02/17 15:41:02 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:02 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:02.9422762Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-4b5b07e6-de9d-41d4-54e9-5550f9a3317c.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:02.9423526Z 2025/02/17 15:41:02 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-4b5b07e6-de9d-41d4-54e9-5550f9a3317c.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:41:12.9445866Z 2025/02/17 15:41:12 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:12.9447110Z 2025/02/17 15:41:12 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:12.9449331Z 2025/02/17 15:41:12 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:12 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:12.9561551Z 2025/02/17 15:41:12 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-a4bafabe-2302-412a-7059-99144f5e0307.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:12.9562443Z 2025/02/17 15:41:12 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-a4bafabe-2302-412a-7059-99144f5e0307.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:41:22.9591430Z 2025/02/17 15:41:22 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:22.9592355Z 2025/02/17 15:41:22 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:22.9595132Z 2025/02/17 15:41:22 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:22 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:22.9709108Z 2025/02/17 15:41:22 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-1a090df1-2ddb-4158-5be2-3f5ce90be92b.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:22.9709909Z 2025/02/17 15:41:22 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-1a090df1-2ddb-4158-5be2-3f5ce90be92b.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:41:32.9734586Z 2025/02/17 15:41:32 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:32.9735884Z 2025/02/17 15:41:32 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:32.9736850Z 2025/02/17 15:41:32 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:32 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:32.9858507Z 2025/02/17 15:41:32 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-79bda004-aa5f-4be6-4e16-f26c71bab526.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:32.9859362Z 2025/02/17 15:41:32 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-79bda004-aa5f-4be6-4e16-f26c71bab526.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:41:42.9888231Z 2025/02/17 15:41:42 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:42.9888791Z 2025/02/17 15:41:42 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:42.9890190Z 2025/02/17 15:41:42 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:42 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:43.0026971Z 2025/02/17 15:41:43 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-a0205872-d61b-48cc-56cf-5e5aca875a59.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:43.0027596Z 2025/02/17 15:41:43 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-a0205872-d61b-48cc-56cf-5e5aca875a59.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:41:53.0052837Z 2025/02/17 15:41:53 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:53.0055268Z 2025/02/17 15:41:53 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:41:53.0057000Z 2025/02/17 15:41:53 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:41:53 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:41:53.0170967Z 2025/02/17 15:41:53 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-015c4be0-6d87-4707-568e-9721d0e878c8.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:41:53.0171618Z 2025/02/17 15:41:53 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-015c4be0-6d87-4707-568e-9721d0e878c8.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:42:03.0182179Z 2025/02/17 15:42:03 packer-provisioner-powershell plugin: [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:42:03.0182747Z 2025/02/17 15:42:03 [INFO] 825 bytes written for 'uploadData'
2025-02-17T15:42:03.0184901Z 2025/02/17 15:42:03 packer-plugin-azure_v2.2.1_x5.0_linux_amd64 plugin: 2025/02/17 15:42:03 Uploading file to 'c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1'
2025-02-17T15:42:03.0309014Z 2025/02/17 15:42:03 packer-provisioner-powershell plugin: failed to upload the remote cleanup script: "clean up script \"c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1\" failed to upload: Error uploading file to $env:TEMP\\winrmcp-8b1a7101-0613-4622-5cb9-64490265dd6f.tmp: Couldn't create shell: http response error: 401 - invalid content type"
2025-02-17T15:42:03.0310093Z 2025/02/17 15:42:03 packer-provisioner-powershell plugin: Retryable error: clean up script "c:/Windows/Temp/packer-cleanup-67b357f9-212f-e64a-5d2e-1803a8ac4647.ps1" failed to upload: Error uploading file to $env:TEMP\winrmcp-8b1a7101-0613-4622-5cb9-64490265dd6f.tmp: Couldn't create shell: http response error: 401 - invalid content type
2025-02-17T15:42:03.0311110Z 2025/02/17 15:42:03 packer-provisioner-powershell plugin: remote cleanup script failed to upload; skipping the removal of temporary files: c:/Windows/Temp/packer-ps-env-vars-67b357f9-9e60-3a37-673c-6d0746cbf26c.ps1,c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1,c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1,c:/Windows/Temp/script-67b357f9-2c10-831f-13da-bfb5d49c7906.ps1;
2025-02-17T15:42:03.0312001Z 2025/02/17 15:42:03 [INFO] (telemetry) ending powershell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant