oscar-stack / vagrant-pe_build

Download and install Puppet Enterprise on Vagrant guests
Other
24 stars 31 forks source link

PE Package management not working for windows agent #132

Closed TraGicCode closed 7 years ago

TraGicCode commented 7 years ago

I'm currently having an issue in which i enable windows agent packagemanagement on my master. And when i apply the pe_agent provisioner to my agent vagrant vm he downloads the MSI but ALWAYS fails to install the agent with an MSI exit code of 1619

Below is my vagrantfile section of my agent

  config.vm.define 'testagent' do |node|
    node.vm.hostname = 'testagent'
    node.vm.network :private_network, :ip => '10.20.1.3'
    node.vm.box = 'mwrock/Windows2012R2'
    node.vm.provision :hosts, :sync_hosts => true
    node.vm.provision :pe_agent do |p|
      p.master_vm = 'testmaster'
    end
end

And here is the vagrant console error when the agent installation fails

==> testagent: Downloading PE installer from:
==> testagent:   https://testmaster:8140/packages/current/windows-x86_64/puppet-agent-x64.msi
==> testagent: Running: $params = @(
==> testagent:   "/qn",
==> testagent:   "/i `"puppet-agent-x64.msi`"",
==> testagent:   "/l*v puppet-enterprise-installer.log",
==> testagent:   "PUPPET_MASTER_SERVER=testmaster PUPPET_AGENT_CERTNAME=testagent"
==> testagent: )
==> testagent:
==> testagent: (Start-Process -FilePath "msiexec.exe" -ArgumentList $params -Wait -Passthru).ExitCode
==> testagent: 1619
==> testmaster: No pending signing request for  on testmaster. Skipping autosign.

Also shouldn't the provisioner be downloading the install.ps1 from the master intstead of the MSI directly and executing a custom powershell script?

Sharpie commented 7 years ago

There should be a puppet-enterprise-installer.log in the home directory of the Administrator user -- could you paste in the contents of that file if there are any? Also, which version of PE is being installed?

Also shouldn't the provisioner be downloading the install.ps1 from the master intstead of the MSI directly and executing a custom powershell script?

It should. However, the install.ps1 script was added recently and I haven't gotten around to wiring it into the provisioner yet.

TraGicCode commented 7 years ago

Hey sharpie,

I saw the issue you created for adding install.ps1 👍 for you :)

Also The error is really strange, It's showing Start-Process from msiexec returning an error code of 1619 ( as can be seen above ). I don't have the log file with me but I can get the content and paste it here. I remember looking at the log and nothing stood out although the content was very vague.

Also, performing the download of the install.ps1 and installing using the shell provisioner in vagrant it works fine. Implementing this feature might be the best solution.

Sharpie commented 7 years ago

Looks like the 1619 exit code indicates the package could not be opened for some reason, perhaps due to security policy. The log snippet could shed more light on that.

Also, which version of PE was installed on the master? I can try re-producing this locally if I know the version number.

TraGicCode commented 7 years ago

The Version is the latest which is '2017.1.1'

Below is this log contents of the msi installer

=== Verbose logging started: 4/2/2017 20:39:56 Build type: SHIP UNICODE 5.00.9600.00 Calling process: C:\Windows\system32\msiexec.exe === MSI (c) (14:9C) [20:39:56:432]: Resetting cached policy values MSI (c) (14:9C) [20:39:56:432]: Machine policy value 'Debug' is 0 MSI (c) (14:9C) [20:39:56:432]: RunEngine: Product: puppet-agent-x64.msi Action: CommandLine: ** MSI (c) (14:9C) [20:39:56:432]: Client-side and UI is none or basic: Running entire install on the server. MSI (c) (14:9C) [20:39:56:432]: Grabbed execution mutex. MSI (c) (14:9C) [20:39:59:701]: Cloaking enabled. MSI (c) (14:9C) [20:39:59:701]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (14:9C) [20:39:59:718]: Incrementing counter to disable shutdown. Counter after increment: 0 MSI (s) (94:D0) [20:39:59:718]: Running installation inside multi-package transaction C:\Users\vagrant\Documents\puppet-agent-x64.msi MSI (s) (94:D0) [20:39:59:718]: Grabbed execution mutex. MSI (s) (94:28) [20:39:59:734]: Resetting cached policy values MSI (s) (94:28) [20:39:59:734]: Machine policy value 'Debug' is 0 MSI (s) (94:28) [20:39:59:734]: RunEngine: Product: C:\Users\vagrant\Documents\puppet-agent-x64.msi Action: CommandLine: ** MSI (s) (94:28) [20:39:59:734]: Note: 1: 2203 2: C:\Users\vagrant\Documents\puppet-agent-x64.msi 3: -2147287038 MSI (s) (94:28) [20:39:59:734]: MainEngineThread is returning 2 MSI (s) (94:D0) [20:39:59:734]: User policy value 'DisableRollback' is 0 MSI (s) (94:D0) [20:39:59:734]: Machine policy value 'DisableRollback' is 0 MSI (s) (94:D0) [20:39:59:734]: Incrementing counter to disable shutdown. Counter after increment: 0 MSI (s) (94:D0) [20:39:59:734]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 MSI (s) (94:D0) [20:39:59:734]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 MSI (s) (94:D0) [20:39:59:734]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1 MSI (c) (14:9C) [20:39:59:752]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1 MSI (c) (14:9C) [20:39:59:752]: MainEngineThread is returning 2 === Verbose logging stopped: 4/2/2017 20:39:59 ===

TraGicCode commented 7 years ago

I downloaded vagrant and it seemed to work using the pe-agent provisioner. Must be some change in a newer version of vagrant or bug that is causing this to fail. It doesn't work on vagrant 1.9.3

Sharpie commented 7 years ago

Ah. That could definitely be it. I'm still on 1.8.7 currently --- due to the bugs that were present in 1.9.0 and 1.9.1.

TraGicCode commented 7 years ago

Closing this and assuming its not a bug here but keeping the enhancement request open!