3

I regularly but randomly get the following error message when I run the puppet client on machines (non-daemonized):

err: Could not create : Parameter path failed: File paths must be fully qualified
warning: Not using cache on failed catalog
warning: Configuration could not be instantiated: Parameter path failed: File paths must be fully qualified

It seems moderately clear what it means -- that I don't have a fully-qualified path in a parameter. However, it doesn't tell me where I can find this to fix it, or even which parameter is wrong :(

(If I use the debug option it consistently works, so it seems like a problem with the caching of the manifests... It would be nice to get rid of this for production use, still)

Note : I cannot make this happen consistently :/

kenorb
  • 5,943
  • 1
  • 44
  • 53
David Gardner
  • 1,499
  • 2
  • 13
  • 25
  • putting $variable_dir = "/etc/puppet/bar" in the site.pp worked for me but putting it in the params.pp and adding require myclass::params in the init.pp did not work. –  Feb 24 '14 at 14:56

4 Answers4

2

[Answering own question after getting around to prodding at the config for a while]

I've managed to track this down to one of the modules which I have written (of course), but it was due to a use of a variable which didn't work out how I expected.

What happened was:

$variable_dir = "/etc/puppet/bar"

class foo {
  file { $variable_dir:
    ensure => directory
  }
}

define some-define() {
   # Trimmed for brevity
   exec { "some-$name":
     # command, creates, timeout etc here
     require => File[$variable_dir],
   }
}

..which basically caused some confusion with the File[] using a variable. I've replaced these with the explicit value of the variable for now and it all works fine, but it was something of a surprise! I'm assuming that my understanding of scope and when variables can be defined/used is somewhat out of whack with Puppet, so I'm going to learn that a lot better...

It seems to have caused the same behaviour as using non-fully-qualified paths on file strings, by failing to find the variable or not obtaining the value? Quite odd, anyway.

Edit : It's quite possible that the variable wasn't found in scope, and so was empty and definitely not a fully-qualified path. Doesn't explain why this was not consistent, however...

David Gardner
  • 1,499
  • 2
  • 13
  • 25
1

When you test your puppet configuration, you can do it by running

puppetd --test

which will give you much more verbose output, and it should show you where it fails. If you are really desperate, you can tack on --debug to get even more output.

If you want to go looking in your .pp files you should search for a

file { "path/to/file":
    ...
}

which has a missing / (i.e. it should read /path/to/file instead)

Martin
  • 809
  • 4
  • 6
  • Unfortunately I've not ever had it do this when using the --debug switch to see if I can get any more hints out of it... I think I'll have to search through the .pp files and functions for any uses without full paths (although some are built up from chunks so that will be awkward too :) – David Gardner Jul 19 '09 at 09:55
0

You can put the actual path to path property, then it works. This works for me:

$variable_dir = "/etc/puppet/bar"

class foo {
  file { 'variable_dir':
    path => ${variable_dir},
    ensure => directory
  }
}

define some-define() {
   # Trimmed for brevity
   exec { "some-$name":
     # command, creates, timeout etc here
     require => File['variable_dir'],
   }
}
Michel Samia
  • 181
  • 1
  • 3
0

Full path should be placed in the key name, unless you're using path parameter.

For example:

file { '/full/path':
  ensure => directory,
  recurse => true,
}

or:

file { 'my name':
  path => "/full/path",
  ensure => directory,
  recurse => true,
}

If you're using variable, make sure it's defined. If it's in different class, use standard $class::variable syntax. For any further information, run puppet with -vd (verbose+debug) parameter.

kenorb
  • 5,943
  • 1
  • 44
  • 53