Last modified: 2014-09-30 00:06:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55222, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53222 - Duplicate definition: Package
Duplicate definition: Package
Status: RESOLVED FIXED
Product: MediaWiki-Vagrant
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 16:48 UTC by Bryan Davis
Modified: 2014-09-30 00:06 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Failing roles.pp (12.08 KB, application/octet-stream)
2013-08-22 16:48 UTC, Bryan Davis
Details

Description Bryan Davis 2013-08-22 16:48:52 UTC
Created attachment 13151 [details]
Failing roles.pp

I'm not sure if this is my problem or something that needs some tweaking in the way that packages are handled in roles.

I'm working on adding the PdfHandler extension to the existing multimedia role. PdfHandler depends on packages [ 'ghostscript', 'imagemagick', 'xpdf-utils' ]. When declared as such in the manifest I get the following error when I try to apply:

    $ vagrant provision
    [default] Running provisioner: puppet...
    Running Puppet with site.pp...
    Duplicate definition: Package[imagemagick] is already defined in file 
    /tmp/vagrant-puppet/manifests/roles.pp at line 383; cannot redefine at 
    /tmp/vagrant-puppet/manifests/roles.pp:236 on node mediawiki-vagrant.dev

line 383 in this case is my new declaration of the package dependencies:
    package { [ 'ghostscript', 'imagemagick', 'xpdf-utils' ]: }

line 236 is inside role::uploadwizard:
    package { 'imagemagick': }


I'm not sure what the right way to resolve this is. For now I'm commenting out the imagemagick package define in my new code, but I think this only works for me because I'm also enabling the uploadwizard role.
Comment 1 Bryan Davis 2013-08-30 23:43:19 UTC
Handling for now by consolidating package definitions in role::multimedia.

I tried to make them virtual (by appending "@" before "package"), but that seemed to still have the same problem. I may not have been doing it right.
Comment 2 Daniel Zahn 2013-09-04 22:43:50 UTC
https://forge.puppetlabs.com/puppetlabs/stdlib

ensure_packages

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

    Type: statement

<-- this might help, it ensures a package is installed but shouldn't fail if it already exists.  If we decide that using stdlib is a good thing that is, but afaik it's already installed and puppetlabs recommends it too.
Comment 3 Bryan Davis 2013-09-04 23:58:36 UTC
After much debate on IRC, it seems that Ori is leaning towards the ensure_packages hack^H^H^H^Hfix for this issue as the "standard" way to treat packages in vagrant-puppet.
Comment 4 Andre Klapper 2013-09-11 22:45:39 UTC
[mass-moving from Tools>MediaWiki-Vagrant to separate product. See bug 54041. Filter bugmail on this comment.]
Comment 5 Yuvi Panda 2013-10-16 08:46:46 UTC
We've packages.pp now.
Comment 6 Sam Smith 2014-09-29 18:29:57 UTC
This appears to be happening again after the redefinition of the require_package function in https://gerrit.wikimedia.org/r/#/c/158912/.
Comment 7 Sam Smith 2014-09-29 18:32:40 UTC
$ vagrant provision
==> default: Running provisioner: lsb_check...
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: Error: Duplicate declaration: Package[imagemagick] is already declared; cannot redeclare at /tmp/vagrant-puppet-5/modules-0/role/manifests/pdfhandler.pp:12 on node mediawiki-vagrant.dev
==> default: Error: Duplicate declaration: Package[imagemagick] is already declared; cannot redeclare at /tmp/vagrant-puppet-5/modules-0/role/manifests/pdfhandler.pp:12 on node mediawiki-vagrant.dev
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

$ vagrant --version
Vagrant 1.6.5

VirtualBox 4.3.16
Comment 8 Gerrit Notification Bot 2014-09-30 00:03:51 UTC
Change 163777 had a related patch set uploaded by BryanDavis:
Revert "Make require_package() variadic; stop creating stub classes"

https://gerrit.wikimedia.org/r/163777
Comment 9 Gerrit Notification Bot 2014-09-30 00:04:40 UTC
Change 163777 merged by jenkins-bot:
Revert "Make require_package() variadic; stop creating stub classes"

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links