Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9745

resource api 'Attempt to redefine entity' generation issue

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Froyo
    • Needs Assessment
    • Needs Assessment

    Description

      When developing new profile for . splunk server on se_control_repo https://github.com/puppetlabs-seteam/control-repo

      [root@puppet ~]# puppet apply -e 'include profile::puppet::splunk_hec, profile::infrastructure::splunk::splunk_server, puppet_enterprise::profile::master' --noop
      /etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
      /opt/puppetlabs/puppet/cache/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
      Warning: Undefined variable '::location'; 
         (file & line not available)
      Warning: Undefined variable '::role'; 
         (file & line not available)
      Warning: Undefined variable '::tier'; 
         (file & line not available)
      Notice: Compiled catalog for puppet.classroom.puppet.com in environment production in 1.43 seconds
      Error: Could not autoload puppet/type/splunk_config: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/splunk_config'. Set at unknown location
      Error: Could not autoload puppet/type/splunk_config: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/splunk_config'. Set at unknown location 

      This was traced to a resource generation issue in a bug on the project https://github.com/hercules-team/augeasproviders_shellvar/issues/28

      when deploying to the master in use if I deploy code and immediatley run the splunk_server class with necessary data I get the error.
      removal of teh environments `.resource_types` folder allows successful run

      [root@puppet ~]# rm -rf /etc/puppetlabs/code/environments/production/.resource_types/*
      [root@puppet ~]# puppet apply -e 'include profile::puppet::splunk_hec, profile::infrastructure::splunk::splunk_server, puppet_enterprise::profile::master' --noop
      /etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
      /opt/puppetlabs/puppet/cache/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
      Warning: Undefined variable '::location'; 
         (file & line not available)
      Warning: Undefined variable '::role'; 
         (file & line not available)
      Warning: Undefined variable '::tier'; 
         (file & line not available)
      Notice: Compiled catalog for puppet.classroom.puppet.com in environment production in 1.79 seconds 

      The next code deplkoy reproduces the issue

      [root@puppet ~]# puppet code depoy production -w
      Invalid arguments.
       
       
      Usage:
        puppet-code [options] (--version | --help)
        puppet-code [options] deploy [<environment> | --all] [--wait --dry-run]
        puppet-code [options] status
        puppet-code [options] print-config
      [root@puppet ~]# puppet code deploy production -w
      Found 1 environments.
      [
        {
          "deploy-signature": "e0774be877bd8d8a414e9d9dbd870212f4034dc3",
          "environment": "production",
          "file-sync": {
            "code-commit": "43adc532fe7c35a8cd3c925ea7369955b6b674a5",
            "environment-commit": "636bf533c84825d975bed868ebe5f4b8d3a9fb19"
          },
          "id": 39,
          "status": "complete"
        }
      ]
      [root@puppet ~]# puppet apply -e 'include profile::puppet::splunk_hec, profile::infrastructure::splunk::splunk_server, puppet_enterprise::profile::master' --noop
      /etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
      /opt/puppetlabs/puppet/cache/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
      Warning: Undefined variable '::location'; 
         (file & line not available)
      Warning: Undefined variable '::role'; 
         (file & line not available)
      Warning: Undefined variable '::tier'; 
         (file & line not available)
      Notice: Compiled catalog for puppet.classroom.puppet.com in environment production in 1.48 seconds
      Error: Could not autoload puppet/type/splunk_config: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/splunk_config'. Set at unknown location
      Error: Could not autoload puppet/type/splunk_config: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/splunk_config'. Set at unknown location
      [root@puppet ~]# 
       

      for information `puppet generate types` shows the following `Errors`

       [root@puppet ~]# puppet generate  types
      Notice: Generating Puppet resource types.
      Error: /etc/puppetlabs/code/environments/production/modules/chocolatey/lib/puppet/type/chocolateyfeature.rb: Config file not found for Chocolatey. Please make sure you have Chocolatey installed.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_aaa_authentication_login.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_aaa_authorization_login_cfg_svc.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_aaa_authorization_login_exec_svc.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_aaa_group_tacacs.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ace.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_acl.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bgp.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bgp_af.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bgp_af_aa.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bgp_neighbor.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bgp_neighbor_af.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bridge_domain.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_bridge_domain_vni.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_command_config.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_evpn_multicast.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_fabricpath_global.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_fabricpath_topology.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_channel_group.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_evpn_multisite.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_hsrp_group.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_ospf.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_portchannel.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_interface_service_vni.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ip_multicast.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_itd_device_group.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_itd_device_group_node.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_itd_service.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_object_group.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_object_group_entry.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ospf.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ospf_area.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ospf_area_vlink.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_ospf_vrf.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_pim.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_pim_grouplist.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_pim_rp_address.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_route_map.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_snmp_community.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_snmp_group.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_snmp_server.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_snmp_user.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_tacacs_server.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_tacacs_server_host.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_upgrade.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vdc.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vlan.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vpc_domain.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vrf.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vrf_af.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vxlan_vtep.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/ciscopuppet/lib/puppet/type/cisco_vxlan_vtep_vni.rb: title patterns that use procs are not supported.
      Error: Failed to load custom type 'eos_switchconfig' from '/etc/puppetlabs/code/environments/production/modules/eos/lib/puppet/type/eos_switchconfig.rb': cannot load such file -- rbeapi/switchconfig
      Error: /etc/puppetlabs/code/environments/production/modules/registry/lib/puppet/type/registry_key.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/registry/lib/puppet/type/registry_value.rb: title patterns that use procs are not supported.
      Error: /etc/puppetlabs/code/environments/production/modules/windows_env/lib/puppet/type/windows_env.rb: title patterns that use procs are not supported.

      and does not resolve the issue, as does `puppet generate type --force` which is more verbose does regenerate but does not resolve the issue..

      I also tested removing the `.resource_types` folder and regenerating the types this does not succeed. The workaround is to remove the folder and then run puppet agent with no types present in the folder.

      The code can be run from an external node with no issue, it appears to be an issue when running puppet against the host server of the resources in this situation

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adam.buxton Adam Buxton
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support