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

Fix Windows Support #129

Merged
merged 2 commits into from
Feb 6, 2020
Merged

Conversation

trevor-vaughan
Copy link
Contributor

  • Change calls of 'type' to 'more' to handle paths with spaces
  • Check to make sure that puppet is in the connection path and reboot
    otherwise. This fixes issues with Windows SSH servers.
  • Fix the path calls to the versions.txt file

* Change calls of 'type' to 'more' to handle paths with spaces
* Check to make sure that puppet is in the connection path and reboot
  otherwise. This fixes issues with Windows SSH servers.
* Fix the path calls to the versions.txt file
@trevor-vaughan trevor-vaughan requested a review from a team January 19, 2020 04:12
trevor-vaughan added a commit to trevor-vaughan/rubygem-simp-beaker-helpers that referenced this pull request Jan 19, 2020
* Also added a missing requirement to the Gemfile
* Requires the following PRs to function:
  * voxpupuli/beaker-vagrant#26
  * puppetlabs/beaker-puppet#129
@kevpl
Copy link
Contributor

kevpl commented Jan 21, 2020

looks like spec testing is failing for this under Ruby 2.4.4:

20:14:56 + env bundle exec rspec -fd -c spec
...
20:15:00 Finished in 2.47 seconds (files took 1.46 seconds to load)
20:15:00 404 examples, 8 failures
20:15:00 
20:15:00 Failed examples:
20:15:00 
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:81 # ClassMixedWithDSLInstallUtils#install_msi_on will specify a PUPPET_AGENT_STARTUP_MODE of Manual (disabling the service) by default
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:92 # ClassMixedWithDSLInstallUtils#install_msi_on allows configuration of PUPPET_AGENT_STARTUP_MODE
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:104 # ClassMixedWithDSLInstallUtils#install_msi_on will not generate a command to emit a log file without the :debug option set
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:111 # ClassMixedWithDSLInstallUtils#install_msi_on will generate a command to emit a log file when the install script fails
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:122 # ClassMixedWithDSLInstallUtils#install_msi_on will generate a command to emit a log file with the :debug option set
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:132 # ClassMixedWithDSLInstallUtils#install_msi_on will pass msi_path to #create_install_msi_batch_on as-is
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:143 # ClassMixedWithDSLInstallUtils#install_msi_on will search in Wow6432Node for the remembered startup setting on 64-bit hosts
20:15:00 rspec ./spec/beaker-puppet/install_utils/windows_utils_spec.rb:159 # ClassMixedWithDSLInstallUtils#install_msi_on will omit Wow6432Node in the registry search for remembered startup setting on 32-bit hosts
20:15:00 
20:15:00 Build step 'Execute shell' marked build as failure

@kevpl
Copy link
Contributor

kevpl commented Jan 24, 2020

@puppetlabs-jenkins retest this please

@kevpl
Copy link
Contributor

kevpl commented Jan 24, 2020

It looks like the jobs for this are failing due to conflicts installing against Ruby 2.3.1:

08:27:17 Using /usr/local/rvm/gems/ruby-2.3.1
...
08:27:22 Installing byebug 11.1.1 with native extensions
08:27:22 Gem::InstallError: byebug requires Ruby version >= 2.4.0.
08:27:22 An error occurred while installing byebug (11.1.1), and Bundler cannot continue.
08:27:22 Make sure that `gem install byebug -v '11.1.1' --source
08:27:22 'https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/'`
08:27:22 succeeds before bundling.
08:27:22 
08:27:22 In Gemfile:
08:27:22   beaker-puppet was resolved to 1.18.11, which depends on
08:27:22     beaker was resolved to 4.14.1, which depends on
08:27:22       pry-byebug was resolved to 3.8.0, which depends on
08:27:22         byebug
08:27:22 Build step 'Execute shell' marked build as failure

We're seeing similar failures in other PRs too (voxpupuli/beaker-google#5), so I've submitted an internal PR against our CI system that will move us off 2.3.1 testing & forward onto 2.6.5 instead. Hopefully we'll get that moving & merged early next week, & I'll re-kick testing here once it's deployed. In the meantime, let me know if you have questions or comments about this.

@kevpl
Copy link
Contributor

kevpl commented Jan 28, 2020

@puppetlabs-jenkins retest this please

@kevpl
Copy link
Contributor

kevpl commented Jan 28, 2020

this appears to have been an infrastructure issue in CI that I believe should be gone by now.

@puppetlabs-jenkins retest this please

jeannegreulich pushed a commit to simp/rubygem-simp-beaker-helpers that referenced this pull request Jan 29, 2020
* Also added a missing requirement to the Gemfile
* Requires the following PRs to function:
  * voxpupuli/beaker-vagrant#26
  * puppetlabs/beaker-puppet#129
@kevpl
Copy link
Contributor

kevpl commented Jan 31, 2020

The build failures here are much more curious now and seem like they might be relevant to the change, as only the windows cells are failing, all with this same message (beaker-puppet integration build#174):

14:48:40 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) 22:48:40$ cmd.exe /c "C:\Windows\TEMP\install-puppet-msi-2020-01-28_22.48.39.bat"
14:48:40   
14:48:40   C:\cygwin64\home\Administrator>start /w msiexec.exe /i "http://builds.delivery.puppetlabs.net/puppet-agent/5.5.13/artifacts/./windows/puppet-agent-5.5.13-x64.msi" /qn /L*V C:\Windows\TEMP\install-puppet-2020-01-28_22.48.39.log PUPPET_AGENT_STARTUP_MODE=Manual 
14:48:40   
14:49:04   C:\cygwin64\home\Administrator>exit /B 0 
14:49:04 
14:49:04 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) executed in 24.65 seconds
14:49:04 
14:49:04 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) 22:49:04$ cmd.exe /c sc qc puppet || sc qc pe-puppet
14:49:04   [SC] QueryServiceConfig SUCCESS
14:49:05   
14:49:05   SERVICE_NAME: puppet
14:49:05           TYPE               : 10  WIN32_OWN_PROCESS 
14:49:05           START_TYPE         : 3   DEMAND_START
14:49:05           ERROR_CONTROL      : 1   NORMAL
14:49:05           BINARY_PATH_NAME   : "C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin\ruby.exe" -rubygems "C:\Program Files\Puppet Labs\Puppet\service\daemon.rb"
14:49:05           LOAD_ORDER_GROUP   : 
14:49:05           TAG                : 0
14:49:05           DISPLAY_NAME       : Puppet Agent
14:49:05           DEPENDENCIES       : 
14:49:05           SERVICE_START_NAME : LocalSystem
14:49:05 
14:49:05 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) executed in 0.31 seconds
14:49:05 
14:49:05 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) 22:49:05$ cmd.exe /c reg query "HKLM\SOFTWARE\Wow6432Node\Puppet Labs\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual
14:49:05       RememberedPuppetAgentStartupMode    REG_SZ    Manual
14:49:05 
14:49:05 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) executed in 0.34 seconds
14:49:05 
14:49:05 shadowy-baseman.delivery.puppetlabs.net (windows2008r2-64-1) 22:49:05$ cmd.exe /c if exist "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt" more "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt"
14:49:05 Build timed out (after 20 minutes). Marking the build as aborted.
15:09:05 Build was aborted
15:09:05 Archiving artifacts
15:09:05 SignalException: SIGTERM

I'm not familiar with puppet-agent installer failure-modes, windows or not, so I'd like to see if @puppetlabs/night-s-watch has some expertise that will help us know if this is a smaller transient issue (just a timeout we should re-kick, for instance?) or something we should be worried about in this change.

@trevor-vaughan
Copy link
Contributor Author

@kevpl You might need the other windows fixes published and/or pulled in for this to function.

@trevor-vaughan
Copy link
Contributor Author

Or it could be something in the internal network. They all worked together on the Internet.

@trevor-vaughan
Copy link
Contributor Author

@genebean This should now pass with the updated gems for beaker-puppet and beaker.

@genebean
Copy link
Contributor

genebean commented Feb 6, 2020

@puppetlabs-jenkins retest this please

@kevpl kevpl merged commit 99eb9dc into puppetlabs:master Feb 6, 2020
@mihaibuzgau
Copy link
Contributor

mihaibuzgau commented Feb 7, 2020

This is causing the agent pipeline to get stuck on all the windows platforms.
Seems like:

 ssh [email protected] 'cmd.exe /c if exist "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt" more "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt"'

is not exiting.
While the previous command worked:

ssh [email protected] 'cmd.exe /c "if exist \"%ProgramFiles%\Puppet Labs\puppet\misc\versions.txt\" type \"%ProgramFiles%\Puppet Labs\puppet\misc\versions.txt\""'

If we don't find a resolution, we'll yank the latest beaker-puppet gem.

gimmyxd pushed a commit to gimmyxd/beaker-puppet that referenced this pull request Feb 7, 2020
…_paths"

This reverts commit 99eb9dc, reversing
changes made to acda051.

Adding more does note resolves the spaces in path and it
causes all agent pipelines to fail on widnows.
mihaibuzgau added a commit that referenced this pull request Feb 7, 2020
Revert "Merge pull request #129 from trevor-vaughan/windows_paths"
@mihaibuzgau
Copy link
Contributor

We're not going to yank beaker-puppet, but we have released a new version with a revert to this PR.

@genebean
Copy link
Contributor

genebean commented Feb 7, 2020

@mihaibuzgau do you have a suggestion for how we could improve testing of PR’s on this repository so that things like this issue would be found pre-merge?

Sent with GitHawk

@trevor-vaughan
Copy link
Contributor Author

@mihaibuzgau Please test this with different versions of Windows before you revert. As far as I can tell, you've probably re-broken everyone that's not on your hidden network.

The reason that I changed it over to more from type is that type does not work on newer versions of the OS in all cases.

The following Beaker test suite was used to evaluate the changes against multiple VM flavors: https://github.com/simp/rubygem-simp-beaker-helpers/tree/master/spec/acceptance/suites/windows

I haven't been able to replicate your failure case but I can definitely make the old version fail on anything newer than Windows 2012.

If file_contents_on is fixed to be OS agnostic (scp_from maybe) then we could pull the file and process it locally instead of relying on broken OS commands.

@gimmyxd
Copy link
Contributor

gimmyxd commented Feb 7, 2020

@genebean the failure was caught in beaker-puppet acceptance CI, as you can see, the windows box was not responding:

22:32:01 
22:32:01 ephemeral-tip.delivery.puppetlabs.net (windows2008r2-64-1) 20:32:01$ cmd.exe /c reg query "HKLM\SOFTWARE\Wow6432Node\Puppet Labs\PuppetInstaller" /v "RememberedPuppetAgentStartupMode" | findstr Manual
22:32:01       RememberedPuppetAgentStartupMode    REG_SZ    Manual
22:32:01 
22:32:01 ephemeral-tip.delivery.puppetlabs.net (windows2008r2-64-1) executed in 0.31 seconds
22:32:01 
22:32:01 ephemeral-tip.delivery.puppetlabs.net (windows2008r2-64-1) 20:32:01$ cmd.exe /c if exist "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt" more "%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt"
22:32:01 Build timed out (after 20 minutes). Marking the build as aborted.
22:52:01 Build was aborted
22:52:01 Archiving artifacts
22:52:02 Recording test results
22:52:02 ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
22:52:02 [BFA] Scanning build for known causes...
22:52:02 SignalException: SIGTERM
22:52:02 /tmp/jenkins/workspace/qe_beaker-puppet_integration-system_master/LAYOUT/windows2008r2-64af-redhat7-64default.mdcal/LDAP_TYPE/default/SAUCE/default/UNEEDED/UNEEDED/label/beaker/vendor/bundler/ruby/2.4.0/gems/net-ssh-5.2.0/lib/net/ssh/connection/event_loop.rb:110

@trevor-vaughan
Copy link
Contributor Author

@gimmyxd What base box is it using?

@genebean
Copy link
Contributor

genebean commented Feb 7, 2020

I would like to request we move this conversation to https://tickets.puppetlabs.com/browse/BKR-1631 please

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

Successfully merging this pull request may close these issues.

6 participants