voxpupuli / puppet-augeasproviders_sysctl

Augeas-based sysctl type and provider for Puppet
Apache License 2.0
10 stars 36 forks source link

sysctl prefetch fails with "no implicit conversion of Array into String" #60

Closed madelaney closed 3 years ago

madelaney commented 3 years ago

On a FreeBSD 12.2-RELEASE-p10 system, when my puppet catalog tried to apply, I get the error message:

Debug: Prefetching augeas resources for sysctl
Error: Could not prefetch sysctl provider 'augeas': no implicit conversion of Array into String
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:96:in `block in instances'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:95:in `each'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:95:in `each_slice'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:95:in `instances'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:143:in `prefetch'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:378:in `prefetch'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:260:in `prefetch_if_necessary'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:115:in `block in evaluate'
/usr/local/lib/ruby/site_ruby/2.7/puppet/graph/relationship_graph.rb:120:in `traverse'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:178:in `evaluate'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:240:in `block (2 levels) in apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:546:in `block in thinmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:545:in `thinmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:239:in `block in apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/log.rb:161:in `with_destination'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction/report.rb:148:in `as_logging_destination'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:238:in `apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:193:in `block (2 levels) in apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:546:in `block in thinmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:545:in `thinmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:192:in `block in apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:233:in `block in benchmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:232:in `benchmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:191:in `apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:433:in `run_internal'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:248:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/context.rb:62:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet.rb:314:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:218:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:60:in `block (5 levels) in run'
/usr/local/lib/ruby/2.7/timeout.rb:95:in `block in timeout'
/usr/local/lib/ruby/2.7/timeout.rb:105:in `timeout'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:59:in `block (4 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent/locker.rb:21:in `lock'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:53:in `block (3 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:136:in `with_client'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:50:in `block (2 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:101:in `run_in_fork'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:49:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:179:in `controlled_run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:47:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:433:in `onetime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:393:in `block in run_command'
/usr/local/lib/ruby/site_ruby/2.7/puppet/context.rb:62:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet.rb:314:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:389:in `run_command'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:382:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:735:in `exit_on_fail'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:382:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/command_line.rb:143:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/command_line.rb:77:in `execute'
/usr/local/bin/puppet:5:in `<main>'

Puppet Code

I do try to set a few sysctl values:

  sysctl {
    'security.bsd.see_other_uids':
      ensure => present,
      value  => '0';

    'security.bsd.see_other_gids':
      ensure => present,
      value  => '0';
  }

Versions

OS: FreeBSD 12.2-RELEASE-p10 Puppet version : 6.23.0 Module version: 2.6.1

trevor-vaughan commented 3 years ago

@madelaney Can you try with the latest PR?

madelaney commented 3 years ago

@trevor-vaughan Sure, let me see what I can do. I'll try with !59

madelaney commented 3 years ago

@trevor-vaughan It doesn't appear to have helped.

Here is my Puppetfile.lock stanza for herculesteam-augeasproviders_sysctl:

GIT
  remote: https://github.com/trevor-vaughan/augeasproviders_sysctl.git
  ref: fix-target-idempotency
  sha: 6b79ea73208af6871f53694ffd03b1c80db8371a
  specs:
    herculesteam-augeasproviders_sysctl (2.6.1)
      herculesteam-augeasproviders_core (< 3.0.0, >= 2.4.0)

And the run still produces:

Debug: Prefetching augeas resources for sysctl
Error: Could not prefetch sysctl provider 'augeas': no implicit conversion of Array into String
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:104:in `block in instances'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:103:in `each'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:103:in `each_slice'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:103:in `instances'
/var/puppet/lib/puppet/provider/sysctl/augeas.rb:167:in `prefetch'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:378:in `prefetch'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:260:in `prefetch_if_necessary'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:115:in `block in evaluate'
/usr/local/lib/ruby/site_ruby/2.7/puppet/graph/relationship_graph.rb:120:in `traverse'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction.rb:178:in `evaluate'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:240:in `block (2 levels) in apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:546:in `block in thinmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:545:in `thinmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:239:in `block in apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/log.rb:161:in `with_destination'
/usr/local/lib/ruby/site_ruby/2.7/puppet/transaction/report.rb:148:in `as_logging_destination'
/usr/local/lib/ruby/site_ruby/2.7/puppet/resource/catalog.rb:238:in `apply'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:193:in `block (2 levels) in apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:546:in `block in thinmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:545:in `thinmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:192:in `block in apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:233:in `block in benchmark'
/usr/local/lib/ruby/2.7/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:232:in `benchmark'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:191:in `apply_catalog'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:433:in `run_internal'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:248:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/context.rb:62:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet.rb:314:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet/configurer.rb:218:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:60:in `block (5 levels) in run'
/usr/local/lib/ruby/2.7/timeout.rb:95:in `block in timeout'
/usr/local/lib/ruby/2.7/timeout.rb:105:in `timeout'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:59:in `block (4 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent/locker.rb:21:in `lock'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:53:in `block (3 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:136:in `with_client'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:50:in `block (2 levels) in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:101:in `run_in_fork'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:49:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:179:in `controlled_run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/agent.rb:47:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:433:in `onetime'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:393:in `block in run_command'
/usr/local/lib/ruby/site_ruby/2.7/puppet/context.rb:62:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet.rb:314:in `override'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application/agent.rb:389:in `run_command'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:382:in `block in run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util.rb:735:in `exit_on_fail'
/usr/local/lib/ruby/site_ruby/2.7/puppet/application.rb:382:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/command_line.rb:143:in `run'
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/command_line.rb:77:in `execute'
/usr/local/bin/puppet:5:in `<main>'
trevor-vaughan commented 3 years ago

@madelaney If you could try it again, I think I fixed the issue.

madelaney commented 3 years ago

@trevor-vaughan , yeah, no problem. Give me about an hour or so.

madelaney commented 3 years ago

@trevor-vaughan Success! 🥇 using sha1 edb0b2a976423d422f66ffa66e0fdeeffb152305 seems to have resolved it.

madelaney commented 3 years ago

Closing as the pull-request !59 will resolve this.