duplicate declaration error w/o multiple declaritions [closed]

asked 2018-03-11 05:29:40 -0600

Hi,

I'm getting this strange error (Puppetserver standalone Docker container and PP5 agent):

root@login01:~# /opt/puppetlabs/bin/puppet agent -tv
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Systemd] is already declared; cannot redeclare at /etc/puppetlabs/code/environments/production/modules/systemdisease/manifests/init.pp:7 at /etc/puppetlabs/code/environments/production/modules/systemdisease/manifests/init.pp:7:2 on node login01.uni-math.gwdg.de
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

I have no idea where the first declaration comes from [include systemdisease appears three times in _separate_ node groups]:

$  grep -ERi '(include|class).*[^:]systemd[^_:]' ./*
./manifests/site.pp:    include systemdisease
./manifests/site.pp:    include systemdisease
./manifests/site.pp:    include systemdisease
./modules/systemd/readme.md:without having to use my `Class['systemd']`.
./modules/systemd/readme.md:  [`IOSchedulingClass=` in `systemd.exec(5)`](https://freedesktop.org/software/systemd/man/systemd.exec.html#IOSchedulingClass=)
./modules/systemd/manifests/init.pp:class systemd (
./modules/systemdisease/manifests/init.pp:class systemdisease {
./modules/systemdisease/manifests/init.pp:      class { 'systemd':

Everything looks fine

$ head -7 modules/systemdisease/manifests/init.pp; tail -3 modules/systemdisease/manifests/init.pp
# name: system disease
# desc: manages system disease
# auth: Kai Burghardt <kburgha at gwdg.de>
#  vim: set tw=140 ts=4 noet bs=eol,start,indent fdm=marker:

class systemdisease {
        class { 'systemd':
        }
}
# EOF

Now I have to divide and conquer trying to isolate the module, the file, the first declaration allegedly is in. Why does this all of the sudden happen? I'm not that stupid and write class { 'systemd': a second time.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Kai Burghardt
close date 2018-03-20 10:05:18.248089

Comments

I've pinned down the problem: At one occasion I `require systemd`, whereas my `class { 'systemd': }` is my main declaration.

Kai Burghardt gravatar imageKai Burghardt ( 2018-03-16 08:30:22 -0600 )edit