{"record":{"id":"3e9c1db79451a255","repo":"puppetlabs/puppet","slug":"diff-is-not-supported-on-this-platform","errorCode":null,"errorMessage":"Diff is not supported on this platform","messagePattern":"Diff is not supported on this platform","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/puppet/file_bucket/dipper.rb","lineNumber":65,"sourceCode":"      file_bucket_path = \"#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}/#{files_original_path}\"\n\n      # Make a HEAD request for the file so that we don't waste time\n      # uploading it if it already exists in the bucket.\n      unless Puppet::FileBucket::File.indirection.head(file_bucket_path, :bucket_path => file_bucket_file.bucket_path)\n        Puppet::FileBucket::File.indirection.save(file_bucket_file, dest_path)\n      end\n\n      file_bucket_file.checksum_data\n    rescue => detail\n      message = _(\"Could not back up %{file}: %{detail}\") % { file: file, detail: detail }\n      Puppet.log_exception(detail, message)\n      raise Puppet::Error, message, detail.backtrace\n    end\n  end\n\n  # Diffs two filebucket files identified by their sums\n  def diff(checksum_a, checksum_b, file_a, file_b)\n    raise RuntimeError, _(\"Diff is not supported on this platform\") if Puppet[:diff] == \"\"\n\n    if checksum_a\n      source_path = \"#{@rest_path}#{@checksum_type}/#{checksum_a}\"\n      if checksum_b\n        file_diff = Puppet::FileBucket::File.indirection.find(\n          source_path,\n          :bucket_path => @local_path,\n          :diff_with => checksum_b\n        )\n      elsif file_b\n        tmp_file = ::Tempfile.new('diff')\n        begin\n          restore(tmp_file.path, checksum_a)\n          file_diff = Puppet::Util::Diff.diff(tmp_file.path, file_b)\n        ensure\n          tmp_file.close\n          tmp_file.unlink\n        end","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_bucket/dipper.rb#L47-L83","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n[main]\ndiff = \"\"\n# after\n[main]\ndiff = /usr/bin/diff","handlingStrategy":"validation","validationCode":"if Puppet[:diff].to_s.strip.empty?\n  Puppet.info 'diff disabled (Puppet[:diff] is empty); skipping bucket diff'\n  return\nend\ndipper.diff(a, b)","typeGuard":null,"tryCatchPattern":"begin\n  dipper.diff(sum_a, sum_b)\nrescue RuntimeError => e\n  raise unless e.message == 'Diff is not supported on this platform'\n  Puppet.info 'diff binary not configured; falling back to checksum comparison'\nend","preventionTips":["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"],"tags":["puppet","filebucket","diff","platform","windows","config"],"backgroundTag":"diff-tool-missing","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}