Issue #5429 has been updated by Mark Frost.

Update to my situation, in case someone else finds themselves in the same boat: 

I think I've figured out what was causing this, at least in my situation. I 
don't know if this applies to the original reporter or not.

In my case, the issue was that I had the node inheriting the class using the 
class { } syntax, but one of my other modules actually had a "include 
icinga::configs" line. The presence of both the include there, and class syntax 
in the node definition, is what caused the duplication issue. 

This makes sense, when I think about it. Obviously Puppet can't apply the same 
class to the same node twice, especially when one has changes. By removing the 
"include" on the other class, I've solved the problem.
----------------------------------------
Bug #5429: Inconsistent "Duplicate definition" error
https://projects.puppetlabs.com/issues/5429

Author: Juerg Walz
Status: Accepted
Priority: Normal
Assignee: 
Category: stages
Target version: 
Affected Puppet version: 2.6.3
Keywords: duplicate definition stages
Branch: 


The following error occurs when I run the Puppet agent a second time after 
restarting the Puppet Master (running it for the first time after the restart 
works successfully):

    # puppet agent --test
    err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: Class[Yum::Os] is already defined; cannot redefine at 
/etc/puppet/modules/csdev/yum/manifests/os.pp:100 on node puppet.example.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run
    # service puppetmaster restart
    Stopping puppetmaster:                                     [  OK  ]
    Starting puppetmaster:                                     [  OK  ]
    # puppet agent --test
    info: Caching catalog for puppet.example.com
    info: Applying configuration version '1291183870'
    notice: Finished catalog run in 11.80 seconds
    # puppet agent --test
    err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: Class[Yum::Os] is already defined; cannot redefine at 
/etc/puppet/modules/csdev/yum/manifests/os.pp:100 on node puppet.example.com
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run

The agent and master are running on the same system.
No changes to the configuration were made during this process. 

The problem appears to be with the Run Stages configuration. Here are the 
important bits from yum/manifests/os.pp (line 100 is the closing bracket of the 
"second" class block):

    class yum::os {
    [actual class definition removed]
    }
    include stages
    class { 'yum::os' :
    stage => 'package-manager-setup',
    }

And the Run Stages definition:

    class stages {
    stage { 'package-manager-setup' : before => Stage['main'], }
    }




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