Issue #15187 has been updated by Josh Cooper.

A related issue is that Puppet will silently drop any debug or info message 
that occurs before `Puppet::Util::Log.level` is changed to `:debug` or `:info` 
respectively, which happens in `Application#setup_logs`. The problem is that 
the default loglevel is `notice`, but due to 
<https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/log.rb#L82> 
the log message is silently dropped, instead of queued for later, when a log 
destination has finally been determined. For some reason, we recheck the the 
level again 
<https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/log.rb#L150>

<pre>
$ bundle exec puppet apply -e "notice 'foo'" --debug
Warning: Could not retrieve fact fqdn
Notice: Scope(Class[main]): foo
</pre>

The warning is printed because `:warning` > `:notice`

However, there are some debug statements generated by the instrumentation code 
that are never displayed. But if you set `Puppet::Util::Log.level = :debug` in 
`Puppet::Util::CommandLine#execute`, you'll see:

<pre>
Debug: new listener called log
Debug: registering instrumentation listener log
Debug: new listener called performance
Debug: registering instrumentation listener performance
</pre>

The logging system needs to queue all messages until it determines the log 
destination(s) and <b>log level</b>. When we do flush the queue, then we can 
filter out logging messages whose level is below the current log level.

----------------------------------------
Bug #15187: Some errors do not show unless in debug mode
https://projects.puppetlabs.com/issues/15187#change-93070

* Author: Luke Kanies
* Status: Re-opened
* Priority: Normal
* Assignee: eric sorenson
* Category: logging
* Target version: 3.3.0
* Affected Puppet version: 3.0.0
* Keywords: 
* Branch: 
----------------------------------------
I am not running the actual server, so the error should be 'cannot connect' or 
something.

Here is the output with no debug:

    luke@shiruken $ puppet agent  -- sever localhost
    ^Cluke@shiruken $

Note that it produces no output and never returns (look for another ticket on 
that).

Here is the (abridged) output with debug:


    Error: Could not send report: Connection refused - connect(2)
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:67
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:101
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:553
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:542
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1035
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:857
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:103
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:103
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:85
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:177
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:188
    /Users/luke/git/puppet/lib/puppet/indirector/request.rb:216
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:188
    /Users/luke/git/puppet/lib/puppet/indirector/rest.rb:176
    /Users/luke/git/puppet/lib/puppet/indirector/indirection.rb:271
    /Users/luke/git/puppet/lib/puppet/configurer.rb:195
    /Users/luke/git/puppet/lib/puppet/configurer.rb:189
    /Users/luke/git/puppet/lib/puppet/agent.rb:44
    /Users/luke/git/puppet/lib/puppet/agent/locker.rb:22
    /Users/luke/git/puppet/lib/puppet/agent.rb:44
    
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/sync.rb:230
    /Users/luke/git/puppet/lib/puppet/agent.rb:44
    /Users/luke/git/puppet/lib/puppet/agent.rb:118
    /Users/luke/git/puppet/lib/puppet/agent.rb:42
    /Users/luke/git/puppet/lib/puppet/agent.rb:83
    /Users/luke/git/puppet/lib/puppet/agent.rb:41
    /Users/luke/git/puppet/lib/puppet/application.rb:175
    /Users/luke/git/puppet/lib/puppet/application.rb:175
    /Users/luke/git/puppet/lib/puppet/agent.rb:39
    /Users/luke/git/puppet/lib/puppet/daemon.rb:205
    /Users/luke/git/puppet/lib/puppet/daemon.rb:167
    /Users/luke/git/puppet/lib/puppet/daemon.rb:167
    /Users/luke/git/puppet/lib/puppet/daemon.rb:145
    /Users/luke/git/puppet/lib/puppet/application/agent.rb:354
    /Users/luke/git/puppet/lib/puppet/application/agent.rb:309
    /Users/luke/git/puppet/lib/puppet/application.rb:342
    /Users/luke/git/puppet/lib/puppet/application.rb:436
    /Users/luke/git/puppet/lib/puppet/application.rb:342
    /Users/luke/git/puppet/lib/puppet/util.rb:529
    /Users/luke/git/puppet/lib/puppet/application.rb:342
    /Users/luke/git/puppet/lib/puppet/util/command_line.rb:74
    /Users/luke/git/puppet/bin/puppet:10
    
Still not a fatal error, but at least you get the output.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to