puppetlabs/puppet · error · RuntimeError
Diff is not supported on this platform
Error message
Diff is not supported on this platform
What it means
Dipper#diff raises RuntimeError when the `diff` Puppet setting is an empty string, which means no diff binary is configured for this platform. Since diffing is the entire purpose of the call, `puppet filebucket diff` and any Ruby caller abort instead of producing an empty comparison.
Source
Thrown at lib/puppet/file_bucket/dipper.rb:65
file_bucket_path = "#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}/#{files_original_path}"
# Make a HEAD request for the file so that we don't waste time
# uploading it if it already exists in the bucket.
unless Puppet::FileBucket::File.indirection.head(file_bucket_path, :bucket_path => file_bucket_file.bucket_path)
Puppet::FileBucket::File.indirection.save(file_bucket_file, dest_path)
end
file_bucket_file.checksum_data
rescue => detail
message = _("Could not back up %{file}: %{detail}") % { file: file, detail: detail }
Puppet.log_exception(detail, message)
raise Puppet::Error, message, detail.backtrace
end
end
# Diffs two filebucket files identified by their sums
def diff(checksum_a, checksum_b, file_a, file_b)
raise RuntimeError, _("Diff is not supported on this platform") if Puppet[:diff] == ""
if checksum_a
source_path = "#{@rest_path}#{@checksum_type}/#{checksum_a}"
if checksum_b
file_diff = Puppet::FileBucket::File.indirection.find(
source_path,
:bucket_path => @local_path,
:diff_with => checksum_b
)
elsif file_b
tmp_file = ::Tempfile.new('diff')
begin
restore(tmp_file.path, checksum_a)
file_diff = Puppet::Util::Diff.diff(tmp_file.path, file_b)
ensure
tmp_file.close
tmp_file.unlink
endView on GitHub (pinned to e227c27540)
Solutions
- Set a real diff binary in the [main] section of puppet.conf: `diff = /usr/bin/diff`
- On Windows, install a diff tool (Git for Windows ships one) and point the setting at diff.exe
- If diff is intentionally disabled, fetch both checksums with `puppet filebucket get` and compare them externally
Example fix
# before [main] diff = "" # after [main] diff = /usr/bin/diff
Defensive patterns
Strategy: validation
Validate before calling
if Puppet[:diff].to_s.strip.empty? Puppet.info 'diff disabled (Puppet[:diff] is empty); skipping bucket diff' return end dipper.diff(a, b)
Try / catch
begin dipper.diff(sum_a, sum_b) rescue RuntimeError => e raise unless e.message == 'Diff is not supported on this platform' Puppet.info 'diff binary not configured; falling back to checksum comparison' end
Prevention
- Set `diff = /usr/bin/diff` (or a Windows diff.exe path) in [main] on nodes where you need diffs
- Check Puppet[:diff] before calling Dipper#diff in portable code
When it happens
Trigger: Puppet[:diff] == '' — set explicitly in puppet.conf (`diff = ""`), defaulted empty on platforms where Puppet cannot locate a diff tool (typically Windows), then invoking `puppet filebucket diff ...` or Dipper#diff.
Common situations: Windows nodes without a diff utility installed; hardened configurations that blank the diff setting to suppress content in logs; later needing diff output on the same node.
Related errors
- Cannot determine basic system flavour
- Please provide a file or checksum to diff with
- Failed to diff files
- RegisterEventSourceW failed to open Windows eventlog
- ReportEventW failed to report event to Windows eventlog
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/3e9c1db79451a255.
Report an issue: GitHub.