Issue #2823 has been updated by Dan Bode.
This issue was caused by an extra '/' after $server
"puppet://$server//modules/common/empty"
which is confusing puppet, I am not sure what the expected behavior is.
Your patch does not change the error message in this case.
Here is a the simplified code example that I used for recreate.
<pre>
class test{
file{'/tmp/testdir':
source => 'puppet:////dir',
recurse => true,
}
}
</pre>
This same error message also occurs when you try to access a local path with
puppet:
#test.pp
file{'/etc/puppet/duder':
recurse => true,
# dir does not exist
source => ['/tmp/fakedir1'],
}
<pre>
[r...@collector puppet]# puppet test.pp
dnsdomainname: Unknown host
err: //File[/etc/puppet/duder]: Failed to generate additional resources using
'eval_generate': undefined method `relative_path' for nil:NilClass
err: //File[/etc/puppet/duder]: Failed to retrieve current state of resource:
Could not retrieve information from source(s) /tmp/fakedir1 at
/etc/puppet/test.pp:4
</pre>
----------------------------------------
Bug #2823: fail and unhelpful error message if a remote directory doesn't exist.
http://projects.reductivelabs.com/issues/2823
Author: Peter Meier
Status: Ready for Testing
Priority: Normal
Assigned to: Dan Bode
Category: file
Target version: 0.25.2
Affected 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://reductivelabs.com/redmine/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.