Issue #5212 has been updated by Jordan Sissel.

Did some hackery with Kernel.set_trace_func and here's my data:

https://gist.github.com/1654813

The full output includes all method calls in Puppet::Application, 
Puppet::Node::Facts::Facter and Puppet::Node::Facts::ActiveRecord. Here's the 
relevant bits I think are the problem:

    % grep Puppet::Node::Facts:: masterless-facts-with-exports.trace | fex '(1'
                        => Puppet::Node::Facts::Facter#initialize
                          => Puppet::Node::Facts::Facter#load_fact_plugins
                              => Puppet::Node::Facts::Facter#load_facts_in_dir
                              <= Puppet::Node::Facts::Facter#load_facts_in_dir
                              => Puppet::Node::Facts::Facter#load_facts_in_dir
                              <= Puppet::Node::Facts::Facter#load_facts_in_dir
                          <= Puppet::Node::Facts::Facter#load_fact_plugins
                        <= Puppet::Node::Facts::Facter#initialize
      => Puppet::Node::Facts::ActiveRecord#find
    <= Puppet::Node::Facts::ActiveRecord#find
                      => Puppet::Node::Facts::ActiveRecord#find
                      <= Puppet::Node::Facts::ActiveRecord#find
                      => Puppet::Node::Facts::ActiveRecord#find
                        <= Puppet::Node::Facts::ActiveRecord#find


As above, you can see that Facter is done before ActiveRecord, which, while not 
definitive (many method calls are ignored in my tracing), is a strong indicator 
to me why local facts are overridden by exported facts.
----------------------------------------
Bug #5212: With Puppet standalone, exported facts are overriding local facts
https://projects.puppetlabs.com/issues/5212

Author: Jordan Sissel
Status: Accepted
Priority: Normal
Assignee: 
Category: exported resources
Target version: 2.7.x
Affected Puppet version: 2.6.2
Keywords: exported facts override local
Branch: 


I have custom facts that are being overriden by the values stored in the 
storeconfig database.

That is, if I run 'FACTERLIB=/path/to/puppet/facts facter' I see the correct 
fact, but when I run puppet I see the old value.

On a hunch, I did this in my storeconfigs mysql db:
<pre>
mysql> delete from fact_names;
Query OK, 126 rows affected (0.03 sec)

mysql> delete from fact_values;
Query OK, 4075 rows affected (0.12 sec)
</pre>

It is not relevant w hether the above is an unsupported operation - I am just 
hacking and debugging right now ;)

Here's the result:
% sudo puppet --modulepath /opt/puppet/modules --verbose 
--no-use_cached_catalog --storeconfigs --thin_storeconfigs --ignorecache 
/opt/puppet/manifests/site.pp
info: Loading facts in truth
info: Loading facts in rightscale
info: Loading facts in zookeeper
info: Connecting to mysql database: puppet
warning: Host is missing hostname and/or domain: solr13-1.prod.loggly.net
err: Scope(Node[default]): Unsupported operatingsystem: ''
info: Caching catalog for solr13-1.prod.loggly.net
info: Applying configuration version '1289001996'
notice: /Stage[main]//Node[default]/Exec[apt refresh]/returns: executed 
successfully
</pre>

So if the facts table is empty, the node can't find its facts. This is very 
strange. So I try this:

<pre>
mysql> delete from hosts;
Query OK, 37 rows affected (0.01 sec)
</pre>

And things start working...

Basically, it seems like facts stored in the storeconfig db override local 
facts, which seems like a bug to me given it prevents facts from changing. 

Thoughts?


-- 
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