'Puppet Duplicate declaration: Class[main] is already declared

I am trying to setup my puppet modules and apply. And I get the below error:

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[main] is already declared; cannot redeclare (file: /mnt/wso2puppet/dev/manifests/site.pp, line: 24) (file: /mnt/wso2puppet/dev/manifests/site.pp, line: 24, column: 3) on node test-mi-integrator

And here's my /mnt/wso2puppet/dev/manifests/site.pp

...

# Run stages
stage { 'custom': }

# Order stages
Stage['main'] -> Stage['custom'] 

node default {
  class { "::${::profile}": }
  class { "::${::profile}::custom":
    stage => 'custom'
  } 
}

Can someone help me what is wrong here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source