{"record":{"id":"0728bc48590d16b1","repo":"puppetlabs/puppet","slug":"filebucket-paths-must-be-absolute","errorCode":null,"errorMessage":"Filebucket paths must be absolute","messagePattern":"Filebucket paths must be absolute","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type/filebucket.rb","lineNumber":79,"sourceCode":"        If this attribute is not specified, the first entry in the `server_list`\n        configuration setting is used, followed by the value of the `serverport`\n        setting if `server_list` is not set.\"\n    end\n\n    newparam(:path) do\n      desc \"The path to the _local_ filebucket; defaults to the value of the\n        `clientbucketdir` setting.  To use a remote filebucket, you _must_ set\n        this attribute to `false`.\"\n\n      defaultto { Puppet[:clientbucketdir] }\n\n      validate do |value|\n        if value.is_a? Array\n          raise ArgumentError, _(\"You can only have one filebucket path\")\n        end\n\n        if value.is_a? String and !Puppet::Util.absolute_path?(value)\n          raise ArgumentError, _(\"Filebucket paths must be absolute\")\n        end\n\n        true\n      end\n    end\n\n    # Create a default filebucket.\n    def self.mkdefaultbucket\n      new(:name => \"puppet\", :path => Puppet[:clientbucketdir])\n    end\n\n    def bucket\n      mkbucket unless defined?(@bucket)\n      @bucket\n    end\n\n    private\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type/filebucket.rb#L61-L97","documentation":"The filebucket path validate also requires String values to satisfy Puppet::Util.absolute_path? — the bucket directory must be unambiguously located, so relative paths raise 'Filebucket paths must be absolute'.","triggerScenarios":"`path => 'bucket'`, `path => './bucket'`, `path => '~/bucket'`; Windows forms missing a drive letter; values built from relative variables that were never expanded.","commonSituations":"Reusing relative paths from application configs; tilde shortcuts that absolute_path? rejects; drive-relative Windows paths; typos dropping the leading slash.","solutions":["Use a fully qualified path: '/var/lib/puppet/clientbucket' or 'C:/ProgramData/PuppetLabs/bucket'.","Build from a known base: \"${vardir}/clientbucket\" so the result is absolute.","For remote-only buckets set path => false instead of a filesystem path.","Expand tildes/variables before assignment when sourcing from user input."],"exampleFix":"// before\nfilebucket { 'main': path => 'bucket' }\n\n// after\nfilebucket { 'main': path => '/var/lib/puppet/clientbucket' }","handlingStrategy":"validation","validationCode":"# Ruby\nfail('filebucket path must be absolute (or false)') unless path == false || (path.is_a?(String) && Puppet::Util.absolute_path?(path))","typeGuard":"def absolute_bucket_path?(v)\n  v == false || (v.is_a?(String) && Puppet::Util.absolute_path?(v))\nend","tryCatchPattern":null,"preventionTips":["Prefix POSIX paths with / and Windows paths with a drive letter.","Expand tildes/variables before passing the value.","Use path => false for remote buckets."],"tags":["puppet","filebucket","absolute-path","parameter-validation"],"backgroundTag":"relative-path-rejected","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}