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

    • Template:
      PUP Bug Template
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support