{"record":{"id":"d6f24a9c553f82e3","repo":"puppetlabs/puppet","slug":"listing-remote-file-buckets-is-not-allowed","errorCode":null,"errorMessage":"Listing remote file buckets is not allowed","messagePattern":"Listing remote file buckets is not allowed","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/file_bucket/dipper.rb","lineNumber":163,"sourceCode":"          of.binmode\n          newcontents.stream do |source_stream|\n            FileUtils.copy_stream(source_stream, of)\n          end\n        }\n        ::File.chmod(changed, file) if changed\n      else\n        Puppet.err _(\"Could not find file with checksum %{sum}\") % { sum: sum }\n        return nil\n      end\n      newsum\n    else\n      nil\n    end\n  end\n\n  # List Filebucket content.\n  def list(fromdate, todate)\n    raise Puppet::Error, _(\"Listing remote file buckets is not allowed\") unless local?\n\n    source_path = \"#{@rest_path}#{@checksum_type}/\"\n    file_bucket_list = Puppet::FileBucket::File.indirection.find(\n      source_path,\n      :bucket_path => @local_path,\n      :list_all => true,\n      :fromdate => fromdate,\n      :todate => todate\n    )\n    raise Puppet::Error, _(\"File not found\") unless file_bucket_list\n\n    file_bucket_list.to_s\n  end\n\n  private\n\n  def absolutize_path(path)\n    Pathname.new(path).realpath","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_bucket/dipper.rb#L145-L181","documentation":"Dipper#list enumerates filebucket contents, but only for a locally-backed Dipper (constructed with a :Path bucket directory, i.e. local? is true). When the Dipper targets a remote server (:Server given, so @rest_path is set and @local_path nil), listing raises Puppet::Error immediately: the REST filebucket API exposes no directory-listing endpoint, so Puppet forbids the attempt.","triggerScenarios":"`puppet filebucket list` while the filebucket is routed to a server (puppet.conf [filebucket] `server` set, no local bucket); constructing Puppet::FileBucket::Dipper.new(:Server => 'puppet.example.com', :Port => 8140) and calling #list.","commonSituations":"Sites that centralize backups on Puppet Server and later try to audit bucket contents from an agent node.","solutions":["Run the listing on the server host against its local bucketdir (use `puppet filebucket --local list` there)","Or list the server's bucket directory directly over SSH/filesystem","If client-side listing is a hard requirement, keep a local bucket (no server setting for filebucket)"],"exampleFix":"# before (on agent, remote bucket configured)\npuppet filebucket list\n# after (on the filebucket server)\npuppet filebucket --local list --bucketdir /opt/puppetlabs/server/data/puppetserver/bucket","handlingStrategy":"validation","validationCode":"raise Puppet::Error, 'listing requires a local bucket' unless dipper.local?\ndipper.list(from, to)","typeGuard":"def local_dipper?(d)\n  d.respond_to?(:local?) && d.local?\nend","tryCatchPattern":null,"preventionTips":["Construct Dipper with :Path (local bucketdir) whenever your workflow needs listing","Do not point filebucket tooling at a server URL for audit scripts — listing is local-only by design"],"tags":["puppet","filebucket","remote","unsupported-operation"],"backgroundTag":"remote-operation-not-supported","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}