puppetlabs/puppet · error
Unable to write the file
Error message
Unable to write the file %{file_path}. %{error} What it means
Raised by Puppet::Util::Plist#write_plist_file when the CFPropertyList save call fails, so the serialized plist could not be written to file_path. The rescue in write_plist_file turns the underlying exception into this error with the path and reason included — typically a permissions, path, or disk problem.
Solutions
- Check that file_path's directory exists and the Puppet user has write permission
- Verify there is adequate disk space and the path is not a directory
- Inspect the embedded error message for the specific I/O failure
Defensive patterns
Strategy: try-catch
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.
Appendix: 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)