Page MenuHomePhabricator

Puppet: "Package[gdb] is already declared in file modules/java/manifests/tools.pp"
Closed, ResolvedPublic

Description

Apr  2 21:53:27 integration-slave-precise-1011 puppet-agent[5611]:
 Could not retrieve catalog from remote server:
 Error 400 on SERVER:
 Duplicate declaration: Package[gdb] is already declared in file /etc/puppet/modules/java/manifests/tools.pp:10; cannot redeclare at /etc/puppet/modules/base/manifests/standard-packages.pp:38 on node i-00000a44.eqiad.wmflabs

Event Timeline

Krinkle claimed this task.
Krinkle raised the priority of this task from to Medium.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Krinkle, Aklapper.

you would think the "if ! defined" already protects against this, but apparently not.

if ! defined ( Package['gdb'] ) { 
    package { 'gdb':
        ensure => present
    }   
}

One way to solve it should be to use "ensure_packages" from stdblib.

ensure_packages: Takes a list of packages and only installs them if they don't already exist.

Change 201598 had a related patch set uploaded (by Krinkle):
Fix duplicate Package[gdb] declaration

https://gerrit.wikimedia.org/r/201598

Out of the four precise instances Timo created, only one has the problem: integration-slave-precise-1011 which has the puppet class role::ci::slave::labs

Precise instances having an older image of Precise does not have the issue though.

Change 201598 merged by Dzahn:
Fix duplicate Package[gdb] declaration

https://gerrit.wikimedia.org/r/201598

merged. should be fixed now. wanna confirm?

merged. should be fixed now. wanna confirm?

I had it cherry picked on the integration puppet master and that definitely solved the issue. Thanks for the merge!