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 is not running provisioner script and jumping to next script without completion #12654

Open
paritoshdubey opened this issue Oct 11, 2023 · 1 comment

Comments

@paritoshdubey
Copy link

paritoshdubey commented Oct 11, 2023

Overview of the Issue

Provisoner script is not running all commands in scripts completly and jumping to another script before it gets completed

Reproduction Steps

Steps to reproduce this issue

Packer version

From version 1.9

Simplified Packer Template

[
"builders": [
"type": "googlecompute",
"image_name": "{{user instance_name"}}",
"image_family": "test",
"project_id": "",
"source_image_project_id": "",
"source_image_family": "test-windows-2019",
"instance_name": "{{user 'instance_name"}}",
"disk_size":"100",
"disk_type": "pd-ssd",
"machine_type": "n2-standard-8",
"communicator": "winrm",
"winrm_username": "packer_user",
winrm insecure": true,
"winrm_use_ssl": true,
"metadata":{
},
windows-startup-script-cmd": "reg delete HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\Windows\\WinRM\\Service\\WinRS\\
"sysprep-specialize-script-ps1": "test"
"zone":"us-east1-b",
"subnetwork": "projects//regions/us-east1/subnetworks/",
"Scopes": ["https://www.googleapis.com/auth/cloud-platform"],
"omit_external_ip": true,
"use_internal_ip": true,
"service_account_email": "test",
"state_timeout": "10m"
"provisioners":[
{
"type": "powershell",
"environment_vars": [
1,
"package_version={{user package_version"}}"
"scripts": [
"/resources/test/Invoke-Install Features.ps1"
]
},
{
"type":"powershell",
"inline":["GCESysprep - NoShutdown"]
}
]
}

Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.

Set the env var PACKER_LOG=1 for maximum log detail.

@codefox42
Copy link

Today we also spotted a packer run that seems to have skipped one of several scripts passed to the powershell provisioner (packer-1.11.2). :-(

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

No branches or pull requests

3 participants