Wrong number of arguments (given 2, expected 1)

When updating our vms from chef infra client 16.x to 17.x I keep getting the wrong number of arguments error when trying to deploy our Octopus deploy project to the vms. The Octopus deploy projects include a process which deploys the chef config and converges the chef recipe on the vms which now have chef infra client 17.x. The Octopus deploy is successful every time we switch back to 16.x but fails when we upgrade to 17.x and also 18.x. Any ideas on what causes this error and how to fix?

Error output on Octopus Deploy:

 					wrong number of arguments (given 2, expected 1)
11:30:04   Info     |         Cookbook Trace: (most recent call first)
11:30:04   Info     |         ----------------------------------------
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:98:in `option_collector_attribute'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:83:in `attribute'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/template_content.rb:143:in `attribute'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:67:in `<class:Resource>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:39:in `<module:PoiseArchive>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:28:in `<module:Resources>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:25:in `<module:PoiseArchive>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources/poise_archive.rb:24:in `<top (required)>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/resources.rb:17:in `<top (required)>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/files/halite_gem/poise_archive/cheftie.rb:17:in `<top (required)>'
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise-archive/libraries/default.rb:19:in `<top (required)>'
11:30:04   Info     |         Relevant File Content:
11:30:04   Info     |         ----------------------
11:30:04   Info     |         c:/apps/devlab/test.configuration.azeastus.idapi.chef/0.1.0-ci.183_1/.chef/local-mode-cache/cache/cookbooks/poise/files/halite_gem/poise/helpers/option_collector.rb:
11:30:04   Info     |         91:          # @param name [String, Symbol] Name of the attribute to define.
11:30:04   Info     |         92:          # @param default [Hash] Default value for the options.
11:30:04   Info     |         93:          # @param parser [Proc, Symbol] Optional parser method. If a symbol it is
11:30:04   Info     |         94:          #   called as a method on self. Takes a non-hash value and returns a
11:30:04   Info     |         95:          #   hash of its parsed representation.
11:30:04   Info     |         96:          # @param forced_keys [Array<Symbol>, Set<Symbol>] Method names that will be forced
11:30:04   Info     |         97:          #   to be options rather than calls to the parent resource.
11:30:04   Info     |         98>>         def option_collector_attribute(name, default: {}, parser: nil, forced_keys: Set.new)
11:30:04   Info     |         99:            raise Poise::Error.new("Parser must be a Proc or Symbol: #{parser.inspect}") if parser && !(parser.is_a?(Proc) || parser.is_a?(Symbol))
11:30:04   Info     |         100:            # Cast to a set at definition time.
11:30:04   Info     |         101:            forced_keys = Set.new(forced_keys) unless forced_keys.is_a?(Set)
11:30:04   Info     |         102:            # Never allow name to be called accidentally since it does really wonky things.
11:30:04   Info     |         103:            forced_keys.add(:name)
11:30:04   Info     |         104:            # Unlike LWRPBase.attribute, I don't care about Ruby 1.8. Worlds tiniest violin.
11:30:04   Info     |         105:            define_method(name.to_sym) do |arg=nil, &block|
11:30:04   Info     |         106:              iv_sym = :"@#{name}"
11:30:04   Info     |         107:

poise cookbooks have been deprecated and it's highly recommended to not use them. They haven't been maintained for a long time and had libraries that altered some of the underlying behaviour in chef-client. Much has changed with chef-client that compatibility with poise has been broken. Some of what poise was doing has been integrated in to chef-core already. Recommend using builtin archive_file resource.

1 Like