[Pkg-puppet-devel] Bug#662905: Bug#662905: Bug#662905: undefined method `has_openstack_mac?' for Facter::Util::EC2:Module

Sven Mueller sven at incase.de
Sat Mar 10 21:51:52 UTC 2012


On Fri, March 9, 2012 2:29 pm, Florian Ernst wrote:
> On Thu, Mar 08, 2012 at 08:36:39AM +0100, martin f krafft wrote:
>> also sprach micah anderson <micah at riseup.net> [2012.03.07.2229 +0100]:
>> > odd... I'm not seeing this message here. do you have any customized
>> > facts in factpath (grep factpath /etc/puppet/puppet.conf for the
>> > location, typically in /var/lib/puppet/facts or
>> > /var/lib/puppet/lib/facter)?
>>
>> There is one, named sslcert_fpr.rb:
>> [...]
>
> I, too, saw this message now that the package has migrated to testing.
> I, too, have custom facts (lots of them).
>
>> Indeed, if I move this out of the way, the next run completes
>> without error.
>>
>> However, even after the file is restore by puppet, the error does
>> not appear anymore.
>
> In my case removing the custom facts and letting puppet put them there
> again didn't help at all.
>
> What helped was restarting the puppet agent.
>
> Here some log excerpts:
>
> Mar  9 14:14:53 fernst puppet-agent[28386]: Could not run Puppet
> configuration client: Could not retrieve local facts: undefined method
> `has_openstack_mac?' for Facter::Util::EC2:Module
> Mar  9 14:15:48 fernst puppet-agent[28386]: Caught TERM; calling stop
> Mar  9 14:15:52 fernst puppet-agent[18033]: Reopening log files
> Mar  9 14:15:53 fernst puppet-agent[18033]: Starting Puppet client version
> 2.7.11
> Mar  9 14:16:55 fernst puppet-master[10026]: Compiled catalog for
> fernst.no-ip.org in environment production in 0.05 seconds
> Mar  9 14:16:58 fernst puppet-agent[18033]: Finished catalog run in 0.32
> seconds
>
> It feels strange that running facter manually produces no error, whereas
> facter when run from puppet can't find one of the methods defined in
> /usr/lib/ruby/vendor_ruby/facter/util/ec2.rb as called from
> /usr/lib/ruby/vendor_ruby/facter/ec2.rb, but has no problem finding the
> other methods.
>
> Hrm, puppet restart required after facter upgrade reminds me a bit of
> #515726 ...

As far as I recall, puppet loads several facter libraries on start, and
reloads only those ruby files updated during fact synchronization. I does
not resolve possible implicit dependencies at this time. So it can happen
that only parts of facter are reloaded, which can result in problems
resolving methods which are used by the reloaded files, but provided by
files not reloaded.

My suggestion would be to put in a hook script into the puppet packages to
restart puppet (master/agent) when facter is updated.

Note: I might be wrong with the observation, and the are from experience
with the RedHat/EPEL packages, so even if my observation was right for
them, it could be wrong with the more recent version in Debian/testing.

Regards,
Sven






More information about the Pkg-puppet-devel mailing list