chef-boneyard / chef-push

Chef Push Jobs Issues, Bugs and Open Source Charter
Apache License 2.0
8 stars 2 forks source link

Push Jobs installation fails (CentOS7): NoMethodError: undefined method `url' for []:Array #16

Closed zerhacker closed 8 years ago

zerhacker commented 8 years ago

Installation in a fresh, minimal CentOS7-VM (VirtualBox) failed. Here is the complete console output:


[root@chef-server ~]# chef-server-ctl install opscode-push-jobs-server
Starting Chef Client, version 12.10.26
resolving cookbooks for run list: ["private-chef::add_ons_wrapper"]
Synchronizing Cookbooks:
  - enterprise (0.10.0)
  - apt (2.9.2)
  - yum (3.10.0)
  - openssl (4.4.0)
  - runit (1.6.0)
  - chef-sugar (3.3.0)
  - packagecloud (0.0.18)
  - private-chef (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...

================================================================================
Recipe Compile Error in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb
================================================================================

NoMethodError
-------------
undefined method `url' for []:Array

Cookbook Trace:
---------------
  /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:58:in `block in from_file'
  /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in `each'
  /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in `from_file'

Relevant File Content:
----------------------
/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:

 51:    node['private_chef']['addons']['packages'].each do |pkg|
 52:      artifact_info = Mixlib::Install.new(
 53:        channel: :stable,
 54:        product_name: pkg.split(/(chef-|opscode-)(.*)/).last,
 55:        product_version: :latest,
 56:      ).detect_platform.artifact_info
 57:  
 58>>     pkg_file = File.join(addon_path, File.basename(artifact_info.url))
 59:  
 60:      remote_file pkg_file do
 61:        source artifact_info.url
 62:        checksum artifact_info.sha256
 63:      end
 64:    end
 65:  else
 66:    addon_path = node['private_chef']['addons']['path']
 67:  end

Platform:
---------
x86_64-linux

Running handlers:
  - #<Class:0x000000064a6608>::AddonInstallHandler
Running handlers complete
Chef Client failed. 0 resources updated in 04 seconds
[2016-06-16T12:52:14+02:00] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2016-06-16T12:52:14+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-06-16T12:52:15+02:00] FATAL: NoMethodError: undefined method `url' for []:Array
[root@chef-server ~]# 

System information:

[root@chef-server ~]# hostnamectl
   Static hostname: chef-server
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 260c215f50124b1dad1d86130501acdb
           Boot ID: 2ec9ccae297741fd9dc75ec36899ff6a
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-327.18.2.el7.x86_64
      Architecture: x86-64
[root@chef-server ~]# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core) 
[root@chef-server ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@chef-server ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 

Do you need any further information?

sreeks commented 8 years ago

Facing the same issue on RHEL 7.2 (Red Hat Enterprise Linux Server release 7.2 (Maipo))

Starting Chef Client, version 12.12.3 resolving cookbooks for run list: ["private-chef::add_ons_wrapper"] Synchronizing Cookbooks:

  • private-chef (0.1.0)
  • yum (3.10.0)
  • openssl (4.4.0)
  • apt (2.9.2)
  • runit (1.6.0)
  • chef-sugar (3.3.0)
  • enterprise (0.10.1)
  • packagecloud (0.0.18) Installing Cookbook Gems: Compiling Cookbooks...

Recipe Compile Error in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb

NoMethodError

undefined method `url' for []:Array

Cookbook Trace:

/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:58:in block in from_file' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:ineach' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in `from_file'

Relevant File Content:

/var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:

51: node['private_chef']['addons']['packages'].each do |pkg| 52: artifact_info = Mixlib::Install.new( 53: channel: :stable, 54: product_name: pkg.split(/(chef-|opscode-)(.*)/).last, 55: product_version: :latest, 56: ).detect_platform.artifact_info 57: 58>> pkg_file = File.join(addon_path, File.basename(artifact_info.url)) 59: 60: remote_file pkg_file do 61: source artifact_info.url 62: checksum artifact_info.sha256 63: end 64: end 65: else 66: addon_path = node['private_chef']['addons']['path'] 67: end

Platform:

x86_64-linux

Running handlers:

Generated at 2016-07-05 14:27:33 -0700 NoMethodError: undefined method url' for []:Array /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:58:inblock in from_file' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:in each' /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/add_ons_wrapper.rb:51:infrom_file' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:in instance_eval' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/mixin/from_file.rb:30:infrom_file' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/cookbook_version.rb:233:in load_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:354:inload_recipe' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:140:in block in compile_recipes' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:138:ineach' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:138:in compile_recipes' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context/cookbook_compiler.rb:75:incompile' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/run_context.rb:176:in load' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/policy_builder/expand_node_object.rb:97:insetup_run_context' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/client.rb:510:in setup_run_context' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/client.rb:280:inrun' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:268:in run_with_graceful_exit_option' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:244:inblock in run_chef_client' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/local_mode.rb:44:in with_server_connectivity' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:227:inrun_chef_client' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application/client.rb:419:in run_application' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/lib/chef/application.rb:59:inrun' /opt/opscode/embedded/lib/ruby/gems/2.1.0/gems/chef-12.12.3/bin/chef-client:26:in <top (required)>' /opt/opscode/embedded/bin/chef-client:23:inload' /opt/opscode/embedded/bin/chef-client:23:in `

'

dougmorato commented 8 years ago

Facing the same exact error as zerhacker

vinyar commented 8 years ago

Hi,

I would recommend installing the package directly on the Chef Server system, like this. You can get the package file from https://downloads.chef.io/push-jobs-server/redhat/

sudo rpm -Uvh opscode-push-jobs-server-1.1.6-1.x86_64.rpm After the installation, you will still need to reconfigure with

chef-server-ctl reconfigure opscode-push-jobs-server-ctl reconfigure chef-server-ctl reconfigure

jerryaldrichiii commented 8 years ago

Also, you can install it via the command below which should take perform the necessary reconfigures:

sudo chef-server-ctl install opscode-push-jobs-server --path /path/to/opscode-push-jobs-server-1.1.6-1.x86_64.rpm
vinyar commented 8 years ago

Word just in - I verified that as of Today a new version of Push 2.0 is available and will install with the ctl command. To install the 1.x you'll still do it manually.

Im closing this issue.