Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4442

The error message associated with a file resource that requires a non-existent directory is misleading.

    XMLWordPrintable

Details

    • Enhancement
    • Improve the error message that occurs when trying to manage a file resource whose parent directory doesn't exist.

    Description

      When managing a file, if you specify a location that requires an intermediate directory that is missing, and not managed by puppet, the error message is misleading. It implies that the issue is with the temp file created, rather than the missing directory itself. For example, when managing /etc/eyaml/config.yaml, /etc/eyaml does not exist:

      Catalog:

        file {'/etc/eyaml/config.yaml':
          ensure => file,
          content => template('eyaml/config.yaml.erb'),
        }
      

      Error:
      Error: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
      Error: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
      Wrapped exception:
      No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock
      Error: /Stage[main]/Eyaml/File[/etc/eyaml/config.yaml]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory - /etc/eyaml/config.yaml20150420-14321-me6waj.lock at 66:/etc/puppetlabs/puppet/environments/eyaml/dist/eyaml/manifests/init.pp
      

      The preference would be to generate an error that indicates that /etc/eyaml does not exist, or even a generic "Parent directories for $file do not exist"

      Attachments

        Activity

          People

            josh Josh Cooper
            rnelson0@gmail.com Rob Nelson
            Eric Thompson Eric Thompson
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support