Issue #21578 has been reported by Adrian C..
----------------------------------------
Bug #21578: Duplicate definition of class in inheritance tree at random
intervals
https://projects.puppetlabs.com/issues/21578
* Author: Adrian C.
* Status: Unreviewed
* Priority: Normal
* Assignee:
* Category: agent
* Target version:
* Affected Puppet version: 2.6.2
* Keywords: class, duplicate, inheritance, agent
* Branch:
----------------------------------------
Hello, I am using the following version of puppet and puppetmaster on
Debian: 2.6.2-5+squeeze8
I am trying to trace down an error condition that shows up at random
(or what appears to be random) intervals.
I do not think this is bug #5046 which was said to be "not fixable"
and "solution" is to use Hiera in version 3.1. With that said, I do
not know if this is a problem or race condition other than #5046, one
that was potentially already fixed in puppetmaster 2.7, bug tracker
search didn't help me find the answer.
This is a relevant puppet.conf directive:
- modulepath = $confdir/modules:$confdir/services
This is a simplified representation of my classes and manifests in
/etc/puppet:
- ./modules/redis/manifests/init.pp
- ./services/streamer/manifests/init.pp
- ./services/streamer/manifests/dstor.pp
- ./services/streamer/manifests/webserver.pp
- ./manifests/site.pp
<pre>
# services/streamer/manifests/init.pp
class streamer { include ::sudo }
# services/streamer/manifests/dstor.pp
class dstore inherits streamer {
class { '::redis': package => 'redis26' }
}
# services/streamer/manifests/webserver.pp
class webserver inherits streamer {
class { '::redis': package => 'redis26' }
}
# manifests/site.pp
node 'server1' { include streamer::webserver }
</pre>
Every few agent runs on 'server1' will fail with following error:
<pre>
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Duplicate definition: Class[Redis] is already defined in
file /etc/puppet/services/streamer/manifests/webserver.pp at line 2;
cannot redefine at
/etc/puppet/services/streamer/manifests/dstor.pp:2 on node
server1.domain.com
</pre>
Node 'server1' does not have dstor.pp anywhere in its include, or
inherit tree. Class 'redis' from module 'redis' is called in two of
these classes but in same way as parameterized class, there is no
mixing of 'include' and parameterized calls like in #5046.
Every few runs it will apply the catalogs, then it fails with above
error. Like there is a race condition, sometimes for what ever reason
dstor.pp is parsed first, then webserver.pp is parsed second and tries
to re-declare class 'redis'?
I don't know why would class dstor.pp be loaded first if it is not anywhere
in the include or inherit path for node 'server1'. Also if that is the case,
when webserver.pp is loaded first and dstor.pp is loaded second why isn't there
any conflict condition raised in that case.
This is critical functionality for me because many servers have
multiple roles. Webserver with Redis cache in this 'webserver.pp' case
has nothing to do with big Redis database stor in 'dstor.pp'. Both need
Redis daemon installed and running.
Thank you very much.
--
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.