Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Duplicate class declaration error #43

Open

Description

@ReplicaObscura

I'm not positive where this problem comes from, it may not be related to this module, but I figured I'd post here to get your opinion.

I'm using the latest version of this module. I use Foreman as my ENC. At some point recently, I started getting duplicate class declaration errors for Class[php]. The only place the class is declared parameterized that I can find is via Foreman.

Normally newer versions of puppet would provide the file in which the duplicate declaration occurred, but apparently since I'm using an ENC it is not specific.

I tried commenting out all 'include php' declarations from all classes in this module, but the error didn't go away. Only removing the php class from this server in Foreman makes the error go away.

Do you have any ideas where any other declarations of the 'php' class might be coming from or what else could cause this error with Puppet 3.4.2?

Again, I'm not sure this is even an issue with this module, but I just can't find anything else that would cause this error so I figured I'd check.

Activity

  1. ReplicaObscura commented on Jan 14, 2014

    @ReplicaObscura
    Author

    I found out the issue--apparently it was that I was also including the php::pear class, which inherits php. This must have been seen as the duplicate class declaration, as the error went away when I stopped calling php::pear. Now to figure out how to properly include both php and php::pear from Foreman...

  2. alvagante commented on Jan 14, 2014

    @alvagante
    Member

    The "inherits php" is not needed there.
    An include php should be placed in php::pear , instead, so such a change would be accepted, but it would not probably solve your issue if you declare the php class somewhere else.
    You might just include php , where you need it, without using the class { 'php': } declaration style (or without providing direct parameters via the enc).
    I prefer not to remove both the inherits and the alternative include from php::pear because that would break setups where people use directly the php::pear:: defines without explicitly including the main php class.

  3. ReplicaObscura commented on Jan 14, 2014

    @ReplicaObscura
    Author

    Thanks for the info!

    Personally, I think an 'include php' would be preferable. Even though the puppet docs say not to mix include-style and declaration-style classes because the behavior is undefined, including the class in my ENC seems to work fine even with all the 'include php' lines already in the module, and only breaks when I call the php::pear class which currently inherits php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions