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 created this task.Apr 2 2015, 9:58 PM
Krinkle claimed this task.
Krinkle raised the priority of this task from to Normal.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Krinkle, Aklapper.
Dzahn added a subscriber: Dzahn.Apr 2 2015, 10:04 PM

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

hashar added a subscriber: hashar.EditedApr 3 2015, 11:50 AM

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

Dzahn added a comment.Apr 3 2015, 8:45 PM

merged. should be fixed now. wanna confirm?

hashar closed this task as Resolved.Apr 4 2015, 11:47 AM

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!