bflad / chef-gcc

Chef Cookbook for GCC
Other
3 stars 0 forks source link

Option package_name must be a kind of String! You passed... #1

Open vmrob opened 10 years ago

vmrob commented 10 years ago

I've been trying to get this cookbook up and running on Ubuntu 12.04 LTS and ran into a problem. My Vagrantfile is pretty barebones:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise32"

  config.vm.synced_folder "../../host-data", "/host-data"

  config.vm.provision :chef_solo do |chef|
      chef.add_recipe 'gcc'
  end
end

I have both chef-gcc (0.2.0) and apt (2.4.0) in my cookbooks folder and they both seem to be detected.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'precise32'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: precise32_default_1404186551417_36140
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.2.0
    default: VirtualBox Version: 4.3
==> default: Mounting shared folders...
    default: /vagrant => /Users/vmrob/development/vm-config/configurations/precise32
    default: /host-data => /Users/vmrob/development/vm-config/host-data
    default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks => /Users/vmrob/development/vm-config/configurations/precise32/cookbooks
==> default: Running provisioner: chef_solo...
Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: stdin: is not a tty
==> default: [2014-07-01T03:49:20+00:00] INFO: *** Chef 10.14.2 ***
==> default: [2014-07-01T03:49:20+00:00] INFO: Setting the run_list to ["recipe[gcc]"] from JSON
==> default: [2014-07-01T03:49:20+00:00] INFO: Run List is [recipe[gcc]]
==> default: [2014-07-01T03:49:20+00:00] INFO: Run List expands to [gcc]
==> default: [2014-07-01T03:49:20+00:00] INFO: Starting Chef Run for precise32
==> default: [2014-07-01T03:49:20+00:00] INFO: Running start handlers
==> default: [2014-07-01T03:49:20+00:00] INFO: Start handlers complete.
==> default: [2014-07-01T03:49:24+00:00] INFO: execute[apt-get-update] ran successfully
==> default: [2014-07-01T03:49:26+00:00] INFO: package[update-notifier-common] sending run action to execute[apt-get-update] (immediate)
==> default: [2014-07-01T03:49:28+00:00] INFO: execute[apt-get-update] ran successfully
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local] created directory /var/cache/local
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local] owner changed to 0
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local] group changed to 0
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local] mode changed to 755
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local/preseeding] created directory /var/cache/local/preseeding
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local/preseeding] owner changed to 0
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local/preseeding] group changed to 0
==> default: [2014-07-01T03:49:28+00:00] INFO: directory[/var/cache/local/preseeding] mode changed to 755
==> default: [2014-07-01T03:49:29+00:00] INFO: execute[install-key BA9EF27F] ran successfully
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] owner changed to 0
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] group changed to 0
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] mode changed to 644
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] created file /etc/apt/sources.list.d/ubuntu-toolchain-r.list
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] sending delete action to file[/var/lib/apt/periodic/update-success-stamp] (immediate)
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/var/lib/apt/periodic/update-success-stamp] backed up to /var/chef/backup/var/lib/apt/periodic/update-success-stamp.chef-20140701034929
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/var/lib/apt/periodic/update-success-stamp] deleted file at /var/lib/apt/periodic/update-success-stamp
==> default: [2014-07-01T03:49:29+00:00] INFO: file[/etc/apt/sources.list.d/ubuntu-toolchain-r.list] sending run action to execute[apt-get update] (immediate)
==> default: [2014-07-01T03:49:31+00:00] INFO: execute[apt-get update] ran successfully
==> default: [2014-07-01T03:49:31+00:00] INFO: execute[apt-get update] sending run action to execute[apt-cache gencaches] (immediate)
==> default: [2014-07-01T03:49:32+00:00] INFO: execute[apt-cache gencaches] ran successfully
==> default: ================================================================================
==> default: Error executing action `install` on resource 'package[ubuntu12.04g++-4.8defaultg++12.10g++-4.713.04 13.10g++-4.8]'
==> default: ================================================================================
==> default: Chef::Exceptions::ValidationFailed
==> default: ----------------------------------
==> default: Option package_name must be a kind of String!  You passed [["ubuntu"], {"12.04"=>["g++-4.8"], "default"=>["g++"], "12.10"=>["g++-4.7"], "13.04 13.10"=>["g++-4.8"]}].
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef-3/chef-solo-1/cookbooks/gcc/recipes/cpp.rb
==> default: 
==> default:  14:   node['gcc']['cpp']['packages'].each do |p|
==> default:  15:     package p
==> default:  16:     puts p.inspect
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/gcc/recipes/cpp.rb:15:in `from_file'
==> default: 
==> default: package("ubuntu12.04g++-4.8defaultg++12.10g++-4.713.04 13.10g++-4.8") do
==> default:   retry_delay 2
==> default:   retries 0
==> default:   recipe_name "cpp"
==> default:   action :install
==> default:   cookbook_name :gcc
==> default:   package_name [["ubuntu"], {"12.04"=>["g++-4.8"], "default"=>["g++"], "12.10"=>["g++-4.7"], "13.04 13.10"=>["g++-4.8"]}]
==> default: end
==> default: [2014-07-01T03:49:32+00:00] ERROR: Running exception handlers
==> default: [2014-07-01T03:49:32+00:00] ERROR: Exception handlers complete
==> default: [2014-07-01T03:49:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2014-07-01T03:49:32+00:00] FATAL: Chef::Exceptions::ValidationFailed: package[ubuntu12.04g++-4.8defaultg++12.10g++-4.713.04 13.10g++-4.8] (gcc::cpp line 15) had an error: Chef::Exceptions::ValidationFailed: Option package_name must be a kind of String!  You passed [["ubuntu"], {"12.04"=>["g++-4.8"], "default"=>["g++"], "12.10"=>["g++-4.7"], "13.04 13.10"=>["g++-4.8"]}].
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
vmrob commented 10 years ago

I should also note that using the ubuntu/trusty64 along with the cookbooks gcc, apt, yum, and build-essential work as expected.

vladcenan commented 8 years ago

Hi Rob! Did you manage to solve this? Is this a string issue or a dependency issue?

vmrob commented 8 years ago

@vladcenan I don't believe I did nor did I look too far into it. Based on my second comment, I think I would probably try gcc, apt, yum, and build-essential. It's possible that it simply won't work with precise32? What did you try?

bflad commented 8 years ago

I have some time this week to look at things. If you can provide your specific versions of Chef, etc, I might be able to help as well. For what its worth, I tend to use the bento boxes with Vagrant.