puppet-sysctl icon indicating copy to clipboard operation
puppet-sysctl copied to clipboard

Strange error on Puppet 4: Could not autoload puppet/type/sysctl

Open deric opened this issue 8 years ago • 6 comments

During first run a strange error is thrown:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/type/sysctl: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/sysctl'. Originally set at file:/etc/puppetlabs/code/environments/production/vendor/sysctl/manifests/init.pp?line=17&pos=1. at /etc/puppetlabs/code/environments/production/vendor/sysctl/manifests/base.pp:24:5

Second run then works fine.

deric avatar Oct 06 '16 23:10 deric

You might consider my fork under the puppet4 branch. It is not precisely backwards compatible but I think it's more straightfoward and follows puppet4 style.

e.g.

include sysctl

sysctl::values:
  net.ipv4.ip_forward:
    value: '0'

tpdownes avatar Oct 07 '16 15:10 tpdownes

@tpdownes Interesting, thanks for the link. So far it seems to be working fine. Any chance to release your fork with updated documentation?

deric avatar Oct 11 '16 11:10 deric

@deric See the following

Puppet 4 release on forge Puppet 4 release on github

I have taken pains to ensure Matthias` authorship is clearly attributed.

tpdownes avatar Oct 28 '16 20:10 tpdownes

This is still a problem.

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: {"message":"Server Error: Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/type/sysctl: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/sysctl'. Originally set at file:/etc/puppetlabs/code/environments/production/modules/sysctl/manifests/init.pp?line=17&pos=1. at /etc/puppetlabs/code/environments/production/modules/sysctl/manifests/base.pp:24:5 on node

brentclark avatar Jan 12 '17 10:01 brentclark

We also have the same problem

mike-petersen avatar May 16 '17 08:05 mike-petersen

I had the same problem, but only on some puppet agent and not the others (even taking into account the fact it only happens at the first run of puppet master), that's quite strange. But since I'm using puppet master through passenger, I was getting these errors quite a lot in the logs.

I "fixed" it by circumventing the call to ::sysctl { 'entry': } with this kind of code:

  $sysctl_entries = {
    "kernel.sched_migration_cost_ns" => {
        ensure    => present,
        enforce   => true,
        value     => "5000000",
     }
  }
  create_resources('::sysctl', $sysctl_entries)

With that code, I get no more errors. This might be a puppet issue, or maybe some reserved wording ?

Yyuzu avatar Jan 05 '18 12:01 Yyuzu