{"record":{"id":"cd8a114fb35b53f8","repo":"puppetlabs/puppet","slug":"you-can-only-have-one-filebucket-path","errorCode":null,"errorMessage":"You can only have one filebucket path","messagePattern":"You can only have one filebucket path","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type/filebucket.rb","lineNumber":75,"sourceCode":"      desc \"The port on which the remote server is listening.\n\n        This setting is _only_ consulted if the `path` attribute is set to `false`.\n\n        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","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type/filebucket.rb#L57-L93","documentation":"The filebucket type's path parameter validate rejects Arrays with 'You can only have one filebucket path' — a filebucket designates exactly one local bucket directory (or false to use a remote bucket), so multiple paths are not representable.","triggerScenarios":"`filebucket { 'main': path => ['/var/b1', '/var/b2'] }`; a Hiera automatic parameter lookup returning an array (list-typed data or an array merge strategy); ENC data passing multiple values into the path parameter.","commonSituations":"Hiera lookup merging (deep/array) turning a scalar into a list; YAML authors storing path as a list; attempting to configure local and remote buckets simultaneously instead of using path => false with server.","solutions":["Set exactly one path string: `filebucket { 'main': path => '/var/lib/puppet/clientbucket' }`.","Fix the Hiera key to a scalar; if merge strategies produce arrays, set lookup_options merge => first.","For remote buckets use `path => false` plus `server => 'puppet'` — not a second path.","Diagnose with `puppet lookup <key> --explain` to see which layer yields the array."],"exampleFix":"// before\nfilebucket { 'main': path => ['/var/b1', '/var/b2'] }\n\n// after\nfilebucket { 'main': path => '/var/b1' }","handlingStrategy":"type-guard","validationCode":"// Puppet: keep the value scalar\n$path = assert_type(String, $path)","typeGuard":"def filebucket_path_ok?(v)\n  v == false || v.is_a?(String)\nend","tryCatchPattern":null,"preventionTips":["Keep filebucket path a single scalar in Hiera.","Review lookup_options merge strategies that can produce arrays.","Use path => false + server for remote buckets, never a list of paths."],"tags":["puppet","filebucket","hiera","parameter-validation"],"backgroundTag":"invalid-parameter-value","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}