Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef::Exceptions::InvalidResourceSpecification: Please provide a version for each package. Use nil for default version. #293

Open
ianmiell opened this issue Jan 10, 2019 · 2 comments
Assignees
Labels

Comments

@ianmiell
Copy link
Collaborator

Keep hitting this error:

    ================================================================================
    Error executing action `install` on resource 'cookbook_openshift3_openshift_master_pkg[Install OpenShift Master Packages for Certificate Server]'
    ================================================================================
    
    Chef::Exceptions::InvalidResourceSpecification
    ----------------------------------------------
    yum_package[origin-master, origin-clients, origin, origin-node, origin-sdn-ovs] (/root/chef-solo-example/cache/cookbooks/cookbook-openshift3/resources/openshift_master_pkg.rb line 61) had an error: Chef::Exceptions::InvalidResourceSpecification: Please provide a version for each package. Use `nil` for default version.

looking at the trace, I see that there are 5 packages and six versions in the array:

      yum_package("origin-master, origin-clients, origin, origin-node, origin-sdn-ovs") do
        package_name ["origin-master", "origin-clients", "origin", "origin-node", "origin-sdn-ovs"]
        action [:install]
        default_guard_interpreter :default
        declared_type :yum_package
        cookbook_name "cookbook-openshift3"
        version ["3.9.0-1.el7.git.0.ba7faec", "3.9.0-1.el7.git.0.ba7faec", "3.9.0-1.el7.git.0.ba7faec", "3.9.0-1.el7.git.0.ba7faec", "3.9.0-1.el7.git.0.ba7faec", "3.9.0-1.el7.git.0.ba7faec"]
        retries 3
        options []
        not_if { #code block }
      end

investigating further.

@ianmiell
Copy link
Collaborator Author

This fixes it:

    yum_package pkg_master_to_install.reject { |x| x == "tuned-profiles-#{node['cookbook-openshift3']['openshift_service_type']}-node" && (node['cookbook-openshift3']['ose_major_version'].split('.')[1].to_i >= 9 || node['cookbook-openshift3']['control_upgrade_version'].to_i >= 39) } do
      action :install
      version Array.new(pkg_master_to_install.reject { |x| x == "tuned-profiles-#{node['cookbook-openshift3']['openshift_service_type']}-node" && (node['cookbook-openshift3']['ose_major_version'].split('.')[1].to_i >= 9 || node['cookbook-openshift3']['control_upgrade_version'].to_i >= 39) }.size, version) unless version.nil?
      options new_resource.options.nil? ? node['cookbook-openshift3']['openshift_yum_options'] : new_resource.options
      notifies :run, 'execute[daemon-reload]', :immediately
      not_if { node['cookbook-openshift3']['deploy_containerized'] || (is_certificate_server && node['fqdn'] != first_master['fqdn']) }
      retries 3
    end

@IshentRas
Copy link
Owner

👍

ianmiell added a commit that referenced this issue Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants