Open kalapakim opened 8 years ago
Adding context from the Discourse thread - install.ps1 that was generated - https://gist.github.com/kalapakim/9c1fe6ed587f769d6a50c105d10c1419 - has a bunch of mangled/overwritten function definitions.
@kalapakim what OS and version are you using for your workstation and what OS and version are you using chef provisioning against?
my workstation is windows 7, the server is windows 2012...weird thing is, I was testing this in test kitchen and I had no issues...and I just got done running a provisioning run and built out 11 servers, no issue...but soon as I attempted this recipe, it started getting the error
I checked another server's install.ps1 file, which was done just a few minutes before I attempted to run the new recipe on these and it doesn't have the same syntax errors..
Function Install-Chef($msi) {
Log "Installing Chef Omnibus package $msi"
$p = Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /i $msi" -Passthru -Wait
$p.WaitForExit()
if ($p.ExitCode -ne 0) { throw "msiexec was not successful. Received exit code $($p.ExitCode)" }
Remove-Item $msi -Force
Log "Installation complete"
}
@kalapakim what provisioning driver are you using? Where the 11 successful servers built from the same base image as the failing 12th?
update, the next day, I no longer got that error...seems to be fine now
I created an issue in teh Chef Forum, but I"m not sure if it's something that is being caused by this cookbook or by a change that was made on Chef's side..
Here is the link to the issue in the forum.. https://discourse.chef.io/t/provisioning-install-ps1-file-has-syntax-errors/8884
When I run a chef-run, I see the error as:
I Check the script locally on the node and the syntax is in fact bad, I deleted it and ran it again, and the same script is downloaded. This script is generated via the Chef-Provisioning cookbook:
https://github.com/chef/chef-provisioning/blob/73858aff021dd1830b38ff33b693c5f7f5c3825b/lib/chef/provisioning/convergence_strategy/install_msi.rb
but I'm not sure this is because of that cookbook or the generator for the scrpt that is run on line 39
install_command = Mixlib::Install::ScriptGenerator.new(chef_version, true, opts).install_command