{"record":{"id":"cb2a5df6c214c67b","repo":"puppetlabs/puppet","slug":"unable-to-write-the-file-file-path-error","errorCode":null,"errorMessage":"Unable to write the file %{file_path}. %{error}","messagePattern":"Unable to write the file %(.+?)\\. %(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/puppet/util/plist.rb","lineNumber":152,"sourceCode":"      when :xml\n        CFPropertyList::List::FORMAT_XML\n      when :binary\n        CFPropertyList::List::FORMAT_BINARY\n      when :plain\n        CFPropertyList::List::FORMAT_PLAIN\n      else\n        raise FormatError, \"Unknown plist format #{format}\"\n      end\n    end\n\n    # This method will write a plist file using a specified format (or XML\n    # by default)\n    def write_plist_file(plist, file_path, format = :xml)\n      plist_to_save       = CFPropertyList::List.new\n      plist_to_save.value = CFPropertyList.guess(plist)\n      plist_to_save.save(file_path, to_format(format), :formatted => true)\n    rescue IOError => e\n      Puppet.err(_(\"Unable to write the file %{file_path}. %{error}\") % { file_path: file_path, error: e.inspect })\n    end\n\n    def dump_plist(plist_data, format = :xml)\n      plist_to_save       = CFPropertyList::List.new\n      plist_to_save.value = CFPropertyList.guess(plist_data)\n      plist_to_save.to_str(to_format(format), :formatted => true)\n    end\n  end\nend\n","sourceCodeStart":134,"sourceCodeEnd":162,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/util/plist.rb#L134-L162","documentation":"Error \"Unable to write the file %{file_path}. %{error}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/util/plist.rb:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}