puppetlabs/puppet · error

Unable to write the file %{file_path}. %{error}

Error message

Unable to write the file %{file_path}. %{error}

What it means

Error "Unable to write the file %{file_path}. %{error}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/util/plist.rb:152

      when :xml
        CFPropertyList::List::FORMAT_XML
      when :binary
        CFPropertyList::List::FORMAT_BINARY
      when :plain
        CFPropertyList::List::FORMAT_PLAIN
      else
        raise FormatError, "Unknown plist format #{format}"
      end
    end

    # This method will write a plist file using a specified format (or XML
    # by default)
    def write_plist_file(plist, file_path, format = :xml)
      plist_to_save       = CFPropertyList::List.new
      plist_to_save.value = CFPropertyList.guess(plist)
      plist_to_save.save(file_path, to_format(format), :formatted => true)
    rescue IOError => e
      Puppet.err(_("Unable to write the file %{file_path}. %{error}") % { file_path: file_path, error: e.inspect })
    end

    def dump_plist(plist_data, format = :xml)
      plist_to_save       = CFPropertyList::List.new
      plist_to_save.value = CFPropertyList.guess(plist_data)
      plist_to_save.to_str(to_format(format), :formatted => true)
    end
  end
end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/util/plist.rb:152 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/cb2a5df6c214c67b. Report an issue: GitHub.