Windows Puppet Agent Hangs on Run

809 views
Skip to first unread message

phundisk

unread,
Dec 21, 2012, 10:42:28 AM12/21/12
to puppet...@googlegroups.com
This seems to be happening in my development network but not in production which I guess is good.  This happens when running both interactively and via the automatic service run.  This is happening on multiple servers.  Have already tried to uninstall and reinstall.

Windows Puppet Agent: 2.7.20

When I run it interactively I can see the problem.  I issue the command 'puppet agent --test --noop' but it also happens with running the regular puppet command.
Puppet will hang after it loads facts.  It will stay this was until I press enter.  (see screenshot 1st.png)  It will stay this way forever until I press enter.

Upon pressing enter, I receive a message Resolution.exec with a shell built-in is deprecated.  (See screenshot 2nd.png)

Anyone have any ideas on how to resolve this?

_____________________________________________________
This email and any files transmitted with it are confidential and intended solely for the addressee.  If you received this email in error, please do not disclose the contents to anyone; kindly notify the sender by return email and delete this email and any attachments from your system.

© 2011 Currensee Inc. is a member of the National Futures Association (NFA) Member ID 0403251 | Over the counter retail foreign currency (Forex) trading may involve significant risk of loss. It is not suitable for all investors and you should make sure you understand the risks involved before trading and seek independent advice if necessary. Performance, strategies and charts shown are not necessarily predictive of any particular result and past performance is no indication of future results. Investor returns may vary from Trade Leader returns based on slippage, fees, broker spreads, volatility or other market conditions.

Currensee Inc | 54 Canal St 4th Floor | Boston, MA 02114 | +1.617.624.3824
1st.PNG
2nd.PNG

Josh Cooper

unread,
Dec 21, 2012, 2:06:22 PM12/21/12
to puppet...@googlegroups.com
Facter is executing some command that is trying to read from stdin,
and is hanging. Do you happen to have cygwin or msys installed in
development?

To figure out which fact is causing the problem, I'd add the following
to C:\Program Files (x86)\Puppet
Labs\Puppet\facter\util\resolution.rb, around line 133:

begin
Facter.debug("executing #{code}") # Add this line
out = %x{#{code}}.chomp

Then run: facter --debug --trace

Josh
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/TacX5LerBLUJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.



--
Josh Cooper
Developer, Puppet Labs

phundisk

unread,
Dec 21, 2012, 4:45:30 PM12/21/12
to puppet...@googlegroups.com
Hi Josh!

Making the changes and running the command I got the following... (I made the change in C:\Program Files (x86)\Puppet Labs\Puppet\facter\lib\facter\util\ as that was the only resolution.rb I could find)  We do not use cygwin or msys on this system.

[0;32mFound no suitable resolves of 1 for xendomains [0m
[0;32mvalue for xendomains is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_mode [0m
[0;32mvalue for selinux_mode is still nil [0m
[0;32mvalue for netmask_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mFound no suitable resolves of 1 for vlans [0m
[0;32mvalue for vlans is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_config_policy [0m
[0;32mvalue for selinux_config_policy is still nil [0m
[0;32mFound no suitable resolves of 1 for lsbdistcodename [0m
[0;32mvalue for lsbdistcodename is still nil [0m
[0;32mFound no suitable resolves of 1 for arp_loopback_pseudo_interface_1 [0m
[0;32mvalue for arp_loopback_pseudo_interface_1 is still nil [0m
[0;32mvalue for sshrsakey is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_config_mode [0m
[0;32mvalue for selinux_config_mode is still nil [0m
[0;32mFound no suitable resolves of 2 for processor [0m
[0;32mvalue for processor is still nil [0m
[0;32mexecuting C:\Windows/system32/netsh.exe interface ipv6 show address level=verbose [0m
[0;32mFound no suitable resolves of 1 for lsbrelease [0m
[0;32mvalue for lsbrelease is still nil [0m
[0;32mvalue for macaddress_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mvalue for macaddress_local_area_connection is still nil [0m
[0;32mvalue for macaddress_loopback_pseudo_interface_1 is still nil [0m
[0;32mvalue for sshecdsakey is still nil [0m
architecture => x64
dir => C:\Program Files (x86)\Puppet Labs\Puppet\facter
env_windows_installdir => C:\Program Files (x86)\Puppet Labs\Puppet
facterversion => 1.6.14
hardwaremodel => x64
hostname => mt4-mgr-qaprod
id => mt4-mgr-qaprod\administrator
interfaces => Loopback_Pseudo_Interface_1,Local_Area_Connection,Teredo_Tunneling_Pseudo_Interface
ipaddress => 192.168.5.75
ipaddress6 => 2001:0:9d38:6ab8:3d:37bb:3f57:fab4
ipaddress6_teredo_tunneling_pseudo_interface => 2001:0:9d38:6ab8:3d:37bb:3f57:fab4
ipaddress_local_area_connection => 192.168.5.75
ipaddress_loopback_pseudo_interface_1 => 127.0.0.1
kernel => windows
kernelmajversion => 6.1
kernelrelease => 6.1.7600
kernelversion => 6.1.7600
macaddress => B8:AC:6F:B6:22:F9
manufacturer => Dell Inc.
memoryfree => 1.98 GB
memorysize => 3.97 GB
memorytotal => 3.97 GB
netmask_local_area_connection => 255.255.255.0
netmask_loopback_pseudo_interface_1 => 255.0.0.0
network_local_area_connection => 192.168.5.0
network_loopback_pseudo_interface_1 => 127.0.0.0
operatingsystem => windows
operatingsystemrelease => 6.1.7600
osfamily => windows
path => C:\Program Files (x86)\Puppet Labs\Puppet\puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\facter\bin;C:\Program Files (x86)\Puppet Labs\Puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\sys\ruby\bin;C:\Program Files (x86)\Puppet Labs\Puppet\sys\tools\bin;C:\Program Files (x86)\Puppet Labs\Puppet\puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\facter\bin;C:\Program Files (x86)\Puppet Labs\Puppet\bin;C:\Program Files (x86)\Puppet Labs\Puppet\sys\ruby\bin;C:\Program Files (x86)\Puppet Labs\Puppet\sys\tools\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\TortoiseSVN\bin;c:\Program Files\SlikSvn\bin
physicalprocessorcount => 1
processor0 => Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
processor1 => Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
processor2 => Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
processor3 => Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
processorcount => 4
productname => Vostro 230                   
ps => tasklist.exe
puppetversion => 2.7.20
rubysitedir => C:/Program Files (x86)/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
serialnumber => 9CH3KM1
timezone => Morocco Standard Time
uptime => 3 days
uptime_days => 3
uptime_hours => 77
uptime_seconds => 279298
[0;32mexecuting C:\Windows\system32\arp.EXE -a [0m
[0;32mNot an EC2 host [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_current_mode [0m
[0;32mvalue for selinux_current_mode is still nil [0m
[0;32mexecuting C:\Windows\system32\whoami.EXE [0m
[0;32mexecuting uname -p [0m
[0;32mvalue for hardwareisa is still nil [0m
[0;32mFound no suitable resolves of 1 for lsbmajdistrelease [0m
[0;32mvalue for lsbmajdistrelease is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 3 for swapfree [0m
[0;32mvalue for swapfree is still nil [0m
[0;32mvalue for network_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mFound no suitable resolves of 1 for lsbdistid [0m
[0;32mvalue for lsbdistid is still nil [0m
[0;32mvalue for ipaddress6_local_area_connection is still nil [0m
[0;32mruby-augeas not available [0m
[0;32mvalue for augeasversion is still nil [0m
[0;32mFound no suitable resolves of 1 for arp [0m
[0;32mvalue for arp is still nil [0m
[0;32mvalue for ipaddress6_loopback_pseudo_interface_1 is still nil [0m
[0;32mvalue for sshdsakey is still nil [0m
[0;32mvalue for cfkey is still nil [0m
[0;32mFound no suitable resolves of 1 for swapencrypted [0m
[0;32mvalue for swapencrypted is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_policyversion [0m
[0;32mvalue for selinux_policyversion is still nil [0m
[0;32mvalue for ipaddress_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mexecuting C:\Windows\system32\hostname.EXE [0m
[0;32mFound no suitable resolves of 1 for lsbdistrelease [0m
[0;32mvalue for lsbdistrelease is still nil [0m
[0;32mFound no suitable resolves of 1 for arp_teredo_tunneling_pseudo_interface [0m
[0;32mvalue for arp_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mexecuting virt-what [0m
[0;32mvalue for virtual is still nil [0m
[0;32mFound no suitable resolves of 1 for uniqueid [0m
[0;32mvalue for uniqueid is still nil [0m
[0;32mFound no suitable resolves of 3 for swapsize [0m
[0;32mvalue for swapsize is still nil [0m
[0;32mvalue for mtu_teredo_tunneling_pseudo_interface is still nil [0m
[0;32mFound no suitable resolves of 1 for netmask [0m
[0;32mvalue for netmask is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux [0m
[0;32mvalue for selinux is still nil [0m
[0;32mFound no suitable resolves of 1 for selinux_enforced [0m
[0;32mvalue for selinux_enforced is still nil [0m
[0;32mvalue for mtu_local_area_connection is still nil [0m
[0;32mFound no suitable resolves of 1 for lsbdistdescription [0m
[0;32mvalue for lsbdistdescription is still nil [0m
[0;32mFound no suitable resolves of 1 for is_virtual [0m
[0;32mvalue for is_virtual is still nil [0m
[0;32mvalue for mtu_loopback_pseudo_interface_1 is still nil [0m
[0;32mFound no suitable resolves of 1 for arp_local_area_connection [0m
[0;32mvalue for arp_local_area_connection is still nil [0m
[0;32mFound no suitable resolves of 2 for iphostnumber [0m
[0;32mvalue for iphostnumber is still nil [0m

phundisk

unread,
Jan 4, 2013, 2:01:00 PM1/4/13
to puppet...@googlegroups.com
Can anyone make sense of the output below?  I am still experiencing this error.  Does this require any configuration change on the puppet server?

Josh Cooper

unread,
Jan 4, 2013, 6:57:58 PM1/4/13
to puppet...@googlegroups.com
Can you try removing 'c:\Program Files\TortoiseSVN\bin;c:\Program Files\SlikSvn\bin' from your PATH

Josh

phundisk

unread,
Jan 7, 2013, 10:56:29 AM1/7/13
to puppet...@googlegroups.com
I removed these from my path and restarted.  When running puppet it still seems to hang.  I tried to comment out the section in root_home.rb that facter seems to be hanging on but the file was overwritten when attempting to run puppet again.  Is there an update to this file or facter itself?  Currently the package installed is https://downloads.puppetlabs.com/windows/puppet-2.7.20.msi  

Josh Cooper

unread,
Jan 7, 2013, 12:51:25 PM1/7/13
to puppet...@googlegroups.com
Hi Alex,

On Mon, Jan 7, 2013 at 7:56 AM, phundisk <alex.f...@currensee.com> wrote:
> I removed these from my path and restarted. When running puppet it still
> seems to hang. I tried to comment out the section in root_home.rb that
> facter seems to be hanging on but the file was overwritten when attempting
> to run puppet again.

Ah, the root_home fact is part of the puppetlabs stdlib module. When
you run facter, only facts that are part of facter itself are
evaluated.

But, when you run puppet, it runs facter, but tells it load facts from
additional directories, e.g. from modules' facter directories.

The stdlib module is updated each time the agent does a pluginsync,
which is why your edits are getting overwritten.

> Is there an update to this file or facter itself?

The root_home fact calls `getent passwd root`, can you try executing
that from the command line?

Also, on the master, you might try editing the fact root_home.rb in
the stdlib module, e.g.
/etc/puppet/modules/stdlib/lib/facter/root_home.rb. Either to skip the
exec on windows:

require 'facter/util/config'
unless Facter::Util::Config.is_windows?
root_ent = Facter::Util::Resolution.exec("getent passwd root")
...
end

Or add another fact for root_home confined to windows:

Facter.add("root_home") do
confine :kernel => :windows
setcode do
"#{ENV['SYSTEMDRIVE']}/Users/Administrator"
end
end
> https://groups.google.com/d/msg/puppet-users/-/piHpC7JLxLgJ.

phundisk

unread,
Jan 8, 2013, 10:43:44 AM1/8/13
to puppet...@googlegroups.com
I tried the following config changes in stdlib (version v3.1.1) but it is still handing until I press enter during the puppet run.  I was thinking about trying any of the following...

Upgrading Ruby on the Windows machine
Point the windows machine to another puppet server
Run puppet via scheduled task command and or command line (if that produces no problems)
Change version of STDLIB?


"modules/stdlib/spec/unit/facter/root_home_spec.rb"
context "windows" do
    #before :each do
    #  Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(nil)
    #end
    #it "should be nil on windows" do
    #  Facter::Util::RootHome.get_root_home.should be_nil
    #end
  end


modules/stdlib/lib/facter/root_home.rb

module Facter::Util::RootHome
  class << self
  def get_root_home
    # root_ent = Facter::Util::Resolution.exec("getent passwd root")
    # The home directory is the sixth element in the passwd entry
    # If the platform doesn't have getent, root_ent will be nil and we should
    # return it straight away.
    # root_ent && root_ent.split(":")[5]
  end
  end
end

#Facter.add(:root_home) do
#  setcode { Facter::Util::RootHome.get_root_home }
# end

Josh Cooper

unread,
Jan 12, 2013, 4:01:49 PM1/12/13
to puppet...@googlegroups.com, puppet...@googlegroups.com
That module contains a last_run fact that executes 'date', which on windows will prompt for a new date to be entered and hang, instead of displaying the current date.

Josh

On Jan 12, 2013, at 2:33 AM, Matt Purvis <ma...@purvis.co.nz> wrote:

Hi Alex,

I'm having the same problem as you with Puppet Enterprise 2.7.19 on Windows SBS 2008.

I've tracked down the cause of the problem to the example42/puppi module.  Try running the following on your puppetmaster and then do a Puppet run on your Windows box and see if the problem persists:

puppet module uninstall --force example42/puppi

Removing puppi worked for me.  If you're using any of the example42 module then you might be able to fix this behaviour in puppi by editing "modules/puppi/lib/facter/puppi_projects.rb" on your puppetmaster.

I haven't submitted a bug report on puppi yet so feel free to do so.

Cheers,

Matt
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GSMomEglm4sJ.

phundisk

unread,
Jan 14, 2013, 9:47:38 AM1/14/13
to puppet...@googlegroups.com
Thank you for the information!  That resolved the issue.  I have posted a bug report on puppi's github

Alessandro Franceschi

unread,
Jan 14, 2013, 12:18:39 PM1/14/13
to puppet...@googlegroups.com
Issue should have been fixed now.
Thanks for the github bug report.
Reply all
Reply to author
Forward
0 new messages