Issue #2823 has been updated by Alexander Komarov.

UPDATE: I found one workaround (use a failover directory):

    source => ['/tmp/nonexist1', '/some/failover/directory/that/exists']

Now eval_generate() will not fail, but I still don't understand why puppet 
wants to traverse the whole source tree at compilation time, especially if the 
file resource isn't even tagged with the active tag(s).
----------------------------------------
Bug #2823: fail and unhelpful error message if a remote directory doesn't exist.
https://projects.puppetlabs.com/issues/2823#change-83656

Author: Peter Meier
Status: Rejected
Priority: Normal
Assignee: Dan Bode
Category: file
Target version: 0.25.2
Affected Puppet version: 0.25.1
Keywords: 
Branch: 


Given the following define

<pre>
define modules_dir (
    $mode = 0644, $owner = root, $group = 0
  )
{
  $dir = "/var/lib/puppet/modules/${name}"
  if defined(File[$dir]) {
    debug("${dir} already defined")
  } else {
    file {
      "/var/lib/puppet/modules/${name}":
        source => [ "puppet://$server/modules/${name}/modules_dir", 
"puppet://$server//modules/common/empty"],
        checksum => mtime,
        # ignore the placeholder
        ignore => '\.ignore',
        recurse => true, purge => true, force => true,
        mode => $mode, owner => $owner, group => $group;
    }
  }
}
</pre>

and the following call:

<pre>
modules_dir { ["munin", "munin/nodes", "munin/plugins" ]: }
</pre>

As @$modules/munin/files/nodes/modules_dir@ doesn't exist, it should take the 
second fallback and more generic one @$modules/common/files/empty@ which exists.

However the resource fails completely with the following 2 rather cryptic error 
messages:

<pre>
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:588:in `recurse_remote'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:587:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:587:in `recurse_remote'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:483:in `recurse'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:385:in `eval_generate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:347:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:347:in 
`generate_additional_resources'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:191:in `eval_generate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:238:in 
`eval_children_and_apply_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:293:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:142:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:153:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:176:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:130:in `with_client'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:51:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/sbin/puppetd:159
err: //Modules_dir[virtual]/File[/var/lib/puppet/modules/virtual]: Failed to 
generate additional resources using 'eval_generate'
: undefined method `relative_path' for nil:NilClass
/usr/lib/ruby/site_ruby/1.8/puppet/parameter.rb:401:in `fail'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:160:in `init_metadata'
/usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:106:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:106:in `cached_value'
/usr/lib/ruby/site_ruby/1.8/puppet/util/cacher.rb:46:in `metadata'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file/source.rb:115:in 
`copy_source_values'
/usr/lib/ruby/site_ruby/1.8/puppet/type/file.rb:638:in `retrieve'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:726:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:60:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:249:in 
`eval_children_and_apply_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:248:in 
`eval_children_and_apply_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:293:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:142:in `apply'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:153:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:177:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:176:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:130:in `with_client'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:51:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/sbin/puppetd:159
err: //Modules_dir[virtual]/File[/var/lib/puppet/modules/virtual]: Failed to 
retrieve current state of resource: Could not retrieve information from 
source(s) puppet:///modules/virtual/modules_dir, 
puppet:////modules/common/empty at 
/srv/puppet/development/modules/public/common/manifests/defines/modules_dir.pp:25
</pre>

a) it shouldn't fail completely
b) the error message isn't that helpfull (eval_generate on Nil:Class), but this 
might be not an issue anymore if the failing is fixed.

tested using latest 0.25.x head.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to