Issue #14242 has been updated by Moses Mendoza.

Status changed from Merged - Pending Release to Closed

Released in 2.7.15rc1.
----------------------------------------
Bug #14242: Puppet errors with `--debug` flag and trying to colorize output 
after windows agent has checked in
https://projects.puppetlabs.com/issues/14242#change-68218

Author: Justin Stoller
Status: Closed
Priority: Normal
Assignee: Jeff McCune
Category: windows
Target version: 2.7.15
Affected Puppet version: development
Keywords: windows, debug
Branch: 


Doing an action without `--debug` works normally:

<pre>

[root@rhel6-32-1 ~]# puppet resource exec test command='/bin/touch 
/tmp/mytmpfile'
notice: /Exec[test]/returns: executed successfully
exec { 'test':
  returns => 'notrun',
}

[root@rhel6-32-1 ~]# ls /tmp/ | grep my
mytmpfile

</pre>

But when ran with the `--debug` flag:

<pre>

[root@rhel6-32-1 ~]# puppet resource --debug exec test command='/bin/rm -rf 
/tmp/mytmpfile'
Could not run: Could not autoload ansicolor: Could not autoload ansicolor: 
Could not autoload ansicolor:
...snip....
Could not autoload ansicolor: Could not autoload ansicolor: stack level too deep
</pre>

This error goes away when disabling color:

<pre>

[root@rhel6-32-1 ~]# puppet resource --debug exec test command='/bin/rm -rf 
/tmp/mytmpfile' --color=false
debug: Loaded state in 0.00 seconds
debug: Failed to load library 'rubygems' for feature 'rubygems'
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Exec[test](provider=posix): Executing '/bin/rm -rf /tmp/mytmpfile'
debug: Executing '/bin/rm -rf /tmp/mytmpfile'
notice: /Exec[test]/returns: executed successfully
debug: Finishing transaction -611250288
debug: Storing state
debug: Stored state in 0.01 seconds
exec { 'test':
  returns => 'notrun',
}

</pre>

This isn't only limited to the exec resource:

<pre>

[root@rhel6-32-1 ~]# puppet resource package tcpdump ensure=absent --debug
Could not run: Could not autoload package: Could not autoload 
/usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yum.rb: 
Could not autoload rpm: Could not autoload ansicolor: Could not autoload 
ansicolor: Could not autoload ansicolor: 
...snip...
Could not autoload ansicolor: Could not autoload ansicolor: 
Thread(#<Thread:0xb77ee1b0 run>) not locked.

</pre>

Note because of ssldir cleanup in the FOSS tests the master currently doesn't 
have the cert for the windows agent...

<pre>

[root@rhel6-32-1 ~]# puppet cert --list --all
+ rhel6-32-1.puppetlabs.lan (EE:18:4E:A2:B3:97:7C:A4:71:53:F8:98:D4:67:39:73) 
(alt names: DNS:puppet, DNS:rhel6-32-1, DNS:rhel6-32-1.puppetlabs.lan)

</pre>

This behavior (at least the Thread error) occurs elsewhere when running with 
`--debug`:

<pre>

[root@rhel6-32-1 ~]# puppet agent -t
info: Caching catalog for rhel6-32-1.puppetlabs.lan
info: Applying configuration version '1335765525'
notice: Finished catalog run in 0.02 seconds

[root@rhel6-32-1 ~]# puppet agent -t --debug
/usr/lib/ruby/1.8/sync.rb:58:in `Fail': Thread(#<Thread:0xb772b1b0 run>) not 
locked. (Sync_m::Err::UnknownLocker)
        from /usr/lib/ruby/1.8/sync.rb:64:in `Fail'
        from /usr/lib/ruby/1.8/sync.rb:161:in `sync_unlock'
        from /usr/lib/ruby/1.8/sync.rb:232:in `synchronize'
        from /usr/lib/ruby/site_ruby/1.8/puppet/util/settings.rb:606:in `use'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:457:in 
`setup'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:307:in `run'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in `hook'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:307:in `run'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in 
`exit_on_fail'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:307:in `run'
        from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in 
`execute'
        from /usr/bin/puppet:4

</pre>

Note: this was all observed on the master, but we haven't seen this behavior on 
masters that didn't have a Windows agent check into it.

I've ensured the win32console gem was installed on the Windows agent and has no 
effect on the behavior.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to