berkshelf / vagrant-berkshelf

A Vagrant plugin to add Berkshelf integration to the Chef provisioners
Other
378 stars 100 forks source link

vagrant up - Uninitialized constant #53

Closed organicveggie closed 10 years ago

organicveggie commented 11 years ago

Just started seeing this:

$ bundle exec vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'Berkshelf-CentOS-6.3-x86_64-minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed

This is with a clean install under RVM with Ruby 1.9.3-p194:

$ rvm gemset create berks

$ rvm gemset use berks

$ gem install chef berkshelf --no-ri --no-rdoc
Fetching: mixlib-config-1.1.2.gem (100%)
Successfully installed mixlib-config-1.1.2
Fetching: mixlib-cli-1.3.0.gem (100%)
Successfully installed mixlib-cli-1.3.0
Fetching: mixlib-log-1.6.0.gem (100%)
Successfully installed mixlib-log-1.6.0
Fetching: mixlib-authentication-1.3.0.gem (100%)
Successfully installed mixlib-authentication-1.3.0
Fetching: mixlib-shellout-1.1.0.gem (100%)
Successfully installed mixlib-shellout-1.1.0
Fetching: ohai-6.16.0.gem (100%)
Successfully installed ohai-6.16.0
Fetching: mime-types-1.23.gem (100%)
Successfully installed mime-types-1.23
Fetching: rest-client-1.6.7.gem (100%)
Successfully installed rest-client-1.6.7
Fetching: json-1.7.7.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.7.7
Fetching: net-ssh-2.6.7.gem (100%)
Successfully installed net-ssh-2.6.7
Fetching: net-ssh-gateway-1.2.0.gem (100%)
Successfully installed net-ssh-gateway-1.2.0
Fetching: net-ssh-multi-1.1.gem (100%)
Successfully installed net-ssh-multi-1.1
Fetching: highline-1.6.19.gem (100%)
Successfully installed highline-1.6.19
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: chef-11.4.4.gem (100%)
Successfully installed chef-11.4.4
Fetching: timers-1.1.0.gem (100%)
Successfully installed timers-1.1.0
Fetching: celluloid-0.14.1.gem (100%)
Successfully installed celluloid-0.14.1
Fetching: i18n-0.6.1.gem (100%)
Successfully installed i18n-0.6.1
Fetching: multi_json-1.7.6.gem (100%)
Successfully installed multi_json-1.7.6
Fetching: activesupport-3.2.13.gem (100%)
Successfully installed activesupport-3.2.13
Fetching: multipart-post-1.2.0.gem (100%)
Successfully installed multipart-post-1.2.0
Fetching: faraday-0.8.7.gem (100%)
Successfully installed faraday-0.8.7
Fetching: addressable-2.3.4.gem (100%)
Successfully installed addressable-2.3.4
Fetching: hashie-2.0.5.gem (100%)
Successfully installed hashie-2.0.5
Fetching: chozo-0.6.1.gem (100%)
Successfully installed chozo-0.6.1
Fetching: net-http-persistent-2.8.gem (100%)
Successfully installed net-http-persistent-2.8
Fetching: retryable-1.3.3.gem (100%)
Successfully installed retryable-1.3.3
Fetching: solve-0.4.4.gem (100%)
Successfully installed solve-0.4.4
Fetching: ffi-1.8.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.8.1
Fetching: gssapi-1.0.3.gem (100%)
Successfully installed gssapi-1.0.3
Fetching: nokogiri-1.5.9.gem (100%)
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.9
Fetching: httpclient-2.2.0.2.gem (100%)
Successfully installed httpclient-2.2.0.2
Fetching: rubyntlm-0.1.1.gem (100%)
Successfully installed rubyntlm-0.1.1
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: nori-1.1.5.gem (100%)
Successfully installed nori-1.1.5
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: httpi-0.9.7.gem (100%)
Successfully installed httpi-0.9.7
Fetching: wasabi-1.0.0.gem (100%)
Successfully installed wasabi-1.0.0
Fetching: gyoku-1.0.0.gem (100%)
Successfully installed gyoku-1.0.0
Fetching: akami-1.2.0.gem (100%)
Successfully installed akami-1.2.0
Fetching: savon-0.9.5.gem (100%)
Successfully installed savon-0.9.5
Fetching: little-plugger-1.1.3.gem (100%)
Successfully installed little-plugger-1.1.3
Fetching: logging-1.6.2.gem (100%)
Successfully installed logging-1.6.2
Fetching: winrm-1.1.2.gem (100%)
Successfully installed winrm-1.1.2
Fetching: ridley-0.12.4.gem (100%)
Successfully installed ridley-0.12.4
Fetching: minitar-0.5.4.gem (100%)
Successfully installed minitar-0.5.4
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
Fetching: berkshelf-1.4.5.gem (100%)
Successfully installed berkshelf-1.4.5
48 gems installed

$ gem install bundler
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
Installing ri documentation for bundler-1.3.5
1 gem installed

$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Using i18n (0.6.1) 
Installing multi_json (1.7.2) 
Using activesupport (3.2.13) 
Installing addressable (2.3.3) 
Using timers (1.1.0) 
Installing celluloid (0.13.0) 
Installing hashie (2.0.3) 
Using chozo (0.6.1) 
Using multipart-post (1.2.0) 
Using faraday (0.8.7) 
Using json (1.7.7) 
Using minitar (0.5.4) 
Using mixlib-config (1.1.2) 
Using mixlib-shellout (1.1.0) 
Installing retryable (1.3.2) 
Using erubis (2.7.0) 
Installing mixlib-log (1.4.1) 
Using mixlib-authentication (1.3.0) 
Using net-http-persistent (2.8) 
Installing net-ssh (2.6.6) 
Installing solve (0.4.2) 
Installing ridley (0.9.0) 
Installing thor (0.16.0) 
Using yajl-ruby (1.1.0) 
Installing berkshelf (1.3.1) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
reset commented 11 years ago

@organicveggie thanks, I'm going to take a look into this

organicveggie commented 11 years ago

@reset I realized I wasn't running the latest and greatest of everything. I upgraded to Vagrant 1.2.2, installed the 1.2.0 release of the vagrant-berkshelf plugin and upgraded to Berkshelf 1.4.5. That resolved the issue above, but gave me a new error:

/Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/ui.rb:59:in `initialize': wrong number of arguments (1 for 0) (ArgumentError)

A little more digging and I discovered that I think I just had made a mess of things across the board. Not sure how. Not sure when. But I had two vagrant plugins: vagrant-berkshelf (1.2.0) and berkshelf-vagrant (1.0.6). Cleaning up my Vagrant setup brought me back to the Chozo exception:

Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed

So, to be clear on everything... here's my gem list:

activesupport (3.2.13, 3.2.12)
addressable (2.3.3)
akami (1.2.0)
aws-sdk (1.9.5)
berkshelf (1.4.5, 1.3.1, 1.2.1)
builder (3.2.2)
bundler (1.3.4, 1.1.4)
celluloid (0.14.1, 0.13.0, 0.12.4)
chef (11.4.0)
chozo (0.6.1)
coderay (1.0.9)
daemons (1.1.9)
ec2launcher (1.7.1)
erubis (2.7.0)
extlib (0.9.16)
facter (1.6.18)
faraday (0.8.7, 0.8.6)
fauxhai (0.1.1)
ffi (1.8.1)
foodcritic (2.0.0, 1.7.0)
gherkin (2.11.6)
gist (3.1.1)
gssapi (1.0.3)
gyoku (1.0.0)
hashie (2.0.3, 2.0.2)
highline (1.6.16)
httparty (0.10.2)
httpclient (2.2.0.2)
httpi (0.9.7)
i18n (0.6.4, 0.6.1)
ipaddress (0.8.0)
json (1.7.7)
little-plugger (1.1.3)
log4r (1.1.10)
logging (1.6.2)
method_source (0.7.1)
mime-types (1.21)
minitar (0.5.4)
minitest (4.7.4, 4.1.0)
mixlib-authentication (1.3.0)
mixlib-cli (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.4.1)
mixlib-shellout (1.1.0)
moneta (0.6.0)
multi_json (1.7.2, 1.6.1)
multi_xml (0.5.3)
multipart-post (1.2.0)
net-http-persistent (2.8)
net-ssh (2.6.6)
net-ssh-gateway (1.2.0, 1.1.0)
net-ssh-multi (1.1)
nokogiri (1.5.9, 1.5.6)
nori (1.1.5)
ohai (6.16.0)
polyglot (0.3.3)
pry (0.9.8.4)
rack (1.5.2)
rak (1.4)
rake (10.0.4, 0.9.2.2)
rest-client (1.6.7)
retryable (1.3.2)
ridley (0.12.4, 0.9.0, 0.8.4)
rubygems-bundler (1.1.1, 1.0.3)
rubyntlm (0.1.1)
rvm (1.11.3.5)
savon (0.9.5)
slop (2.4.4)
solve (0.4.4, 0.4.2)
strainer (1.0.0)
systemu (2.5.2)
thor (0.18.1, 0.16.0)
thor-foodcritic (0.2.0)
timers (1.1.0)
treetop (1.4.12)
uuidtools (2.1.4, 2.1.3)
wasabi (1.0.0)
winrm (1.1.2)
yajl-ruby (1.1.0)

Here's the Vagrant information;

vagrant --version
Vagrant version 1.2.2

And here's the Vagrant plugin information:

$ vagrant plugin list
vagrant-berkshelf (1.2.0)

And here's what the Vagrantfile looks like: https://gist.github.com/organicveggie/4a328439c1855b1face5

sethvargo commented 11 years ago

@organicveggie can you uninstall berkshelf-vagrant and try again?

organicveggie commented 11 years ago

@sethvargo If you look at my last comment (right before yours), you'll see that I'm not running the berkshelf-vagrant plugin anymore - I already uninstalled it.

Here's the Vagrant plugin information:

$ vagrant plugin list
vagrant-berkshelf (1.2.0)
organicveggie commented 11 years ago

Just to be safe, I uninstalled vagrant-berkshelf and reinstalled it:

$ vagrant plugin uninstall vagrant-berkshelf
Uninstalling the 'vagrant-berkshelf' plugin...
$ vagrant plugin install vagrant-berkshelf
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
Installed the plugin 'vagrant-berkshelf (1.2.0)'!

No luck. Still seeing the Chozo exception:

$ bundle exec vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed

I think it's something with my Berksfile itself, because I tried it out on a clean cookbook that had never been hooked up to Berkshelf and that worked:

$ rvm gemset use chef11
Using ruby-1.9.3-p194 with gemset chef11
Seans-MacBook-Air:java sean$ berks init
      create  Berksfile
      create  chefignore
    conflict  .gitignore
Overwrite /Users/sean/src/chef-cookbooks-github/java/.gitignore? (enter "h" for help) [Ynaqdh] n
        skip  .gitignore
    conflict  Gemfile
Overwrite /Users/sean/src/chef-cookbooks-github/java/Gemfile? (enter "h" for help) [Ynaqdh] n
        skip  Gemfile
      create  Vagrantfile
Using java (1.10.0) at path: '/Users/sean/src/chef-cookbooks-github/java'
Using windows (1.8.4)
Using chef_handler (1.1.4)
Successfully initialized
Seans-MacBook-Air:java sean$ bundle exec vagrant up
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'Berkshelf-CentOS-6.3-x86_64-minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this version of Vagrant.
[Berkshelf] You should check for a newer version of vagrant-berkshelf.
[Berkshelf] If you encounter any errors with this version, please report them at https://github.com/RiotGames/vagrant-berkshelf/issues
[Berkshelf] You can also join the discussion in #berkshelf on Freenode.
[Berkshelf] Updating Vagrant's berkshelf: '/Users/sean/.berkshelf/vagrant/berkshelf-20130606-83661-rjo86s'
[Berkshelf] Using java (1.10.0) at path: '/Users/sean/src/chef-cookbooks-github/java'
[Berkshelf] Using windows (1.8.4)
[Berkshelf] Using chef_handler (1.1.4)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Setting hostname...
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
...

Here's the link to my Vagrantfile: https://gist.github.com/organicveggie/4a328439c1855b1face5. And here's the link to my Berksfile: https://gist.github.com/organicveggie/db5ffb34bfce6baaf7dd.

Anything obvious in either of those two files jump out at you guys?

sethvargo commented 11 years ago

Can you post your Gemfile too?

organicveggie commented 11 years ago

Sure. Gemfile is pretty simple:

source 'https://rubygems.org'

gem 'berkshelf'
organicveggie commented 11 years ago

Another interesting datapoint. I created a new cookbook using berks cookbook and updated the Berksfile to reference a single cookbook in another local directory. Recipes are all empty. bundle exec vagrant up throws the same Chozo exception.

Berksfile:

site :opscode

metadata
cookbook "studyblue-backend", "~> 0.2.0", path: "../studyblue-backend"

Gemfile:

source 'https://rubygems.org'

gem 'berkshelf'
sethvargo commented 11 years ago

Can you uninstall the older 1.3 versions of Berkshelf, I think it might be picking up an old version.

organicveggie commented 11 years ago

No luck. :(

$ gem list --local |grep berkshelf
berkshelf (1.4.5)

$ bundle exec vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
ivey commented 11 years ago

Why are you using bundler to bring up Vagrant?

organicveggie commented 11 years ago

I'm using bundler to bring up Vagrant because I'd read to do that somewhere. Can't find it now. That said, using Vagrant directly has exactly the same problem:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed

Since I'm using RVM, I tried once more to create a new, clean Gemset:

$ rvm gemset create berkshelf
'berks' gemset created (/Users/sean/.rvm/gems/ruby-1.9.3-p194@berkshelf).
$ rvm gemset use berkshelf
Using ruby-1.9.3-p194 with gemset berkshelf
$ gem install bundler
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
Installing ri documentation for bundler-1.3.5
1 gem installed
$ gem install berkshelf --no-ri --no-rdoc
Fetching: timers-1.1.0.gem (100%)
Successfully installed timers-1.1.0
Fetching: celluloid-0.14.1.gem (100%)
Successfully installed celluloid-0.14.1
Fetching: i18n-0.6.1.gem (100%)
Successfully installed i18n-0.6.1
Fetching: multi_json-1.7.6.gem (100%)
Successfully installed multi_json-1.7.6
Fetching: activesupport-3.2.13.gem (100%)
Successfully installed activesupport-3.2.13
Fetching: mixlib-shellout-1.1.0.gem (100%)
Successfully installed mixlib-shellout-1.1.0
Fetching: mixlib-config-1.1.2.gem (100%)
Successfully installed mixlib-config-1.1.2
Fetching: multipart-post-1.2.0.gem (100%)
Successfully installed multipart-post-1.2.0
Fetching: faraday-0.8.7.gem (100%)
Successfully installed faraday-0.8.7
Fetching: addressable-2.3.4.gem (100%)
Successfully installed addressable-2.3.4
Fetching: hashie-2.0.5.gem (100%)
Successfully installed hashie-2.0.5
Fetching: chozo-0.6.1.gem (100%)
Successfully installed chozo-0.6.1
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: mixlib-log-1.6.0.gem (100%)
Successfully installed mixlib-log-1.6.0
Fetching: mixlib-authentication-1.3.0.gem (100%)
Successfully installed mixlib-authentication-1.3.0
Fetching: net-http-persistent-2.8.gem (100%)
Successfully installed net-http-persistent-2.8
Fetching: net-ssh-2.6.7.gem (100%)
Successfully installed net-ssh-2.6.7
Fetching: retryable-1.3.3.gem (100%)
Successfully installed retryable-1.3.3
Fetching: json-1.8.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.0
Fetching: solve-0.4.4.gem (100%)
Successfully installed solve-0.4.4
Fetching: ffi-1.8.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.8.1
Fetching: gssapi-1.0.3.gem (100%)
Successfully installed gssapi-1.0.3
Fetching: nokogiri-1.5.9.gem (100%)
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.5.9
Fetching: httpclient-2.2.0.2.gem (100%)
Successfully installed httpclient-2.2.0.2
Fetching: rubyntlm-0.1.1.gem (100%)
Successfully installed rubyntlm-0.1.1
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: nori-1.1.5.gem (100%)
Successfully installed nori-1.1.5
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: httpi-0.9.7.gem (100%)
Successfully installed httpi-0.9.7
Fetching: wasabi-1.0.0.gem (100%)
Successfully installed wasabi-1.0.0
Fetching: gyoku-1.0.0.gem (100%)
Successfully installed gyoku-1.0.0
Fetching: akami-1.2.0.gem (100%)
Successfully installed akami-1.2.0
Fetching: savon-0.9.5.gem (100%)
Successfully installed savon-0.9.5
Fetching: little-plugger-1.1.3.gem (100%)
Successfully installed little-plugger-1.1.3
Fetching: logging-1.6.2.gem (100%)
Successfully installed logging-1.6.2
Fetching: winrm-1.1.2.gem (100%)
Successfully installed winrm-1.1.2
Fetching: ridley-0.12.4.gem (100%)
Successfully installed ridley-0.12.4
Fetching: minitar-0.5.4.gem (100%)
Successfully installed minitar-0.5.4
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
Fetching: berkshelf-1.4.5.gem (100%)
Successfully installed berkshelf-1.4.5
40 gems installed
$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using i18n (0.6.1) 
Using multi_json (1.7.6) 
Using activesupport (3.2.13) 
Using addressable (2.3.4) 
Using builder (3.2.2) 
Using gyoku (1.0.0) 
Using nokogiri (1.5.9) 
Using akami (1.2.0) 
Using timers (1.1.0) 
Using celluloid (0.14.1) 
Using hashie (2.0.5) 
Using chozo (0.6.1) 
Using multipart-post (1.2.0) 
Using faraday (0.8.7) 
Using json (1.8.0) 
Using minitar (0.5.4) 
Using mixlib-config (1.1.2) 
Using mixlib-shellout (1.1.0) 
Using retryable (1.3.3) 
Using erubis (2.7.0) 
Using mixlib-log (1.6.0) 
Using mixlib-authentication (1.3.0) 
Using net-http-persistent (2.8) 
Using net-ssh (2.6.7) 
Using solve (0.4.4) 
Using ffi (1.8.1) 
Using gssapi (1.0.3) 
Using httpclient (2.2.0.2) 
Using little-plugger (1.1.3) 
Using logging (1.6.2) 
Using rubyntlm (0.1.1) 
Using rack (1.5.2) 
Using httpi (0.9.7) 
Using nori (1.1.5) 
Using wasabi (1.0.0) 
Using savon (0.9.5) 
Installing uuidtools (2.1.4) 
Using winrm (1.1.2) 
Using ridley (0.12.4) 
Using thor (0.18.1) 
Using yajl-ruby (1.1.0) 
Using berkshelf (1.4.5) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

After that, here's what the gem list looks like:

$ gem list --local

*** LOCAL GEMS ***

activesupport (3.2.13)
addressable (2.3.4)
akami (1.2.0)
berkshelf (1.4.5)
builder (3.2.2)
bundler (1.3.5, 1.1.4)
celluloid (0.14.1)
chozo (0.6.1)
erubis (2.7.0)
extlib (0.9.16)
faraday (0.8.7)
ffi (1.8.1)
gssapi (1.0.3)
gyoku (1.0.0)
hashie (2.0.5)
httpclient (2.2.0.2)
httpi (0.9.7)
i18n (0.6.1)
ipaddress (0.8.0)
json (1.8.0)
little-plugger (1.1.3)
logging (1.6.2)
minitar (0.5.4)
mixlib-authentication (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.6.0)
mixlib-shellout (1.1.0)
multi_json (1.7.6)
multipart-post (1.2.0)
net-http-persistent (2.8)
net-ssh (2.6.7)
nokogiri (1.5.9)
nori (1.1.5)
rack (1.5.2)
rake (0.9.2.2)
retryable (1.3.3)
ridley (0.12.4)
rubygems-bundler (1.0.3)
rubyntlm (0.1.1)
rvm (1.11.3.5)
savon (0.9.5)
solve (0.4.4)
systemu (2.5.2)
thor (0.18.1)
timers (1.1.0)
uuidtools (2.1.4, 2.1.3)
wasabi (1.0.0)
winrm (1.1.2)
yajl-ruby (1.1.0)

And still no luck.

$ bundle exec vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
sethvargo commented 11 years ago

I believe you're using vagrant as a gem, which isn't supported. Can you make sure vagrant isn't installated as a gem and only use the package installer.

organicveggie commented 11 years ago

@sethvargo I'm pretty confident I'm not using Vagrant as a gem. I know I installed 1.2.2 from the package installer. And gem list --local does not show a Vagrant gem in any of the local RVM gemsets.

sethvargo commented 11 years ago

@organicveggie if you're able to successfully run bundle exec vagrant, then it's installed as a gem.

organicveggie commented 11 years ago

Oh. That's a very very good point. :)

Well then. What the heck? I wonder why gem list --local doesn't show it?

I'll do some digging. Maybe I can figure out how this get so screwed up on my end.

sethvargo commented 11 years ago

I hate to suggest it, but:

$ rvm implode

Uninstall vagrant and virtual box and just start over :frowning:. I'd wait and see if someone else has a more intelligent answer first though.

organicveggie commented 11 years ago

Heh. I'm desperate enough to try that. :)

organicveggie commented 11 years ago

Grrr. I would have thought that would do the trick. But no luck. :(

  1. Removed RVM completely
  2. Uninstalled Vagrant
  3. Uninstalled VirtualBox
  4. Installed RVM
  5. Installed Ruby 1.9.3-p429
  6. Created new gemset and installed bundler and berkshelf
  7. Installed VirtualBox 4.2.12 from dmg
  8. Installed Vagrant 1.2.2 from dmg
  9. Installed vagrant-berkshelf plugin
  10. Ran vagrant up:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'Berkshelf-CentOS-6.3-x86_64-minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
sethvargo commented 11 years ago

I'm out of ideas... @ivey @reset ?

reset commented 11 years ago

@sethvargo it's probably a bug in the require order after recent changes in Ridley/Berkshelf

organicveggie commented 11 years ago

@reset Anything I can do to help track it down further? I'm bummed that it's not working for me - especially now that I'm addicted to Berkshelf+Vagrant as a workflow.

organicveggie commented 11 years ago

I even tried running on a clean VM in VirtualBox:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'Berkshelf-CentOS-6.3-x86_64-minimal' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading or copying the box...
Extracting box...te: 924k/s, Estimated time remaining: 0:00:02))
Successfully added box 'Berkshelf-CentOS-6.3-x86_64-minimal' with provider 'virtualbox'!
[default] Importing base box 'Berkshelf-CentOS-6.3-x86_64-minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Berkshelf::BerksfileReadError: An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
organicveggie commented 11 years ago

And it's not just Vagrant, it's everything with Berkshelf.

[sean@localhost studyblue-backend]$ berks upload ./
An error occurred while reading the Berksfile:

  uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
organicveggie commented 11 years ago

I also tried cleaning out all of my gems and installing Berkshelf v1.3.1. Same problem:

$ berks upload
An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed
$ gem list --local

*** LOCAL GEMS ***

activesupport (3.2.13)
addressable (2.3.4)
akami (1.2.0)
berkshelf (1.3.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.1.0)
builder (3.2.2)
bundler (1.3.5)
bundler-unload (1.0.1)
celluloid (0.14.1)
celluloid-io (0.14.1)
chozo (0.6.1)
erubis (2.7.0)
faraday (0.8.7)
ffi (1.9.0)
gssapi (1.0.3)
gyoku (1.0.0)
hashie (2.0.5)
httpclient (2.2.0.2)
httpi (0.9.7)
i18n (0.6.1)
json (1.8.0)
little-plugger (1.1.3)
logging (1.6.2)
minitar (0.5.4)
mixlib-authentication (1.3.0)
mixlib-config (1.1.2)
mixlib-log (1.6.0)
mixlib-shellout (1.1.0)
multi_json (1.7.6)
multipart-post (1.2.0)
net-http-persistent (2.8)
net-ssh (2.6.7)
nio4r (0.4.6)
nokogiri (1.5.10)
nori (1.1.5)
rack (1.5.2)
rake (10.0.4)
retryable (1.3.3)
ridley (1.1.0)
rubygems-bundler (1.2.0)
rubyntlm (0.1.1)
rvm (1.11.3.8)
savon (0.9.5)
solve (0.5.0)
thor (0.16.0)
timers (1.1.0)
uuidtools (2.1.4)
wasabi (1.0.0)
winrm (1.1.2)
yajl-ruby (1.1.0)
organicveggie commented 11 years ago

Okay. I'm now positive it's something specific to these cookbooks. I cleaned out all my gems (again) and installed berkshelf v1.4.1 and chef 11.4.4. With some of my cookbooks, I can get berks upload cookbookname to run just fine.

But other cookbooks I get the dreaded Chozo error:

An error occurred while reading the Berksfile: uninitialized constant Chozo::Mixin::ParamsValidate::ValidationFailed

Here's a simple Berksfile that works:

site :opscode

metadata

And here's the metadata.rb for that cookbook:

name             "kafka"
maintainer       "Sean Laurent"
maintainer_email "sean@studyblue.com"
license          "Apache 2.0"
description      "Installs/Configures kafka"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "0.1.0"

depends "logrotate"

In contrast, here's a Berksfile that doesn't work:

site :opscode

metadata
cookbook "elasticsearch", "~> 0.2.0", path: "../elasticsearch"
cookbook "memcached", "~> 1.4.0", git: "https://github.com/StudyBlue/memcached.git", branch: "lwrp"
cookbook "mongodb", "~> 0.1.0", path: "../mongodb"
cookbook "postgresql", "~> 2.4.0", git: "https://github.com/opscode-cookbooks/postgresql.git", branch: "2.4.0"
cookbook "rvm_wrapper", "~> 0.1.0", path: "../rvm_wrapper"
cookbook "studyblue-tools", "~> 0.2.0", path: "../studyblue-tools"
cookbook "zookeeper", "~> 1.1.0", git: "https://github.com/SimpleFinance/chef-zookeeper.git"

And here's the matching metadata.rb for that cookbook:

name             "studyblue-backend"
maintainer       "StudyBlue, Inc."
maintainer_email "sean@studyblue.com"
license          "All rights reserved"
description      "Installs/Configures various StudyBlue back-end applications."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "0.2.0"

supports 'centos', '>= 6.3'

depends "elasticsearch"
depends "java"
depends "postgresql"
depends "memcached"
depends "mongodb"
depends "studyblue-tools"
depends "zookeeper"

recipe "studyblue-backend::elasticsearch", "Installs ElasticSearch. See https://github.com/elasticsearch/cookbook-elasticsearch for details on how to override the default attributes."
recipe "studyblue-backend::kafka", "Installs Kafka."
recipe "studyblue-backend::memcached", "Installs memcached. Defaults to 75% of RAM."
recipe "studyblue-backend::mongoc", "Installs a mongo config server."
recipe "studyblue-backend::mongod", "Installs a stand-alone mongod instance."
recipe "studyblue-backend::mongod_rs1", "Installs a mongod configured as a data node in the rs1 replica set."
recipe "studyblue-backend::mongod_rs2", "Installs a mongod configured as a data node in the rs2 replica set."
recipe "studyblue-backend::mongod_rs3", "Installs a mongod configured as a data node in the rs3 replica set."
recipe "studyblue-backend::mongod_rs4", "Installs a mongod configured as a data node in the rs4 replica set."
recipe "studyblue-backend::mongo_arbiter_rs1", "Installs a mongod configured as an arbiter in the rs1 replica set."
recipe "studyblue-backend::mongo_arbiter_rs2", "Installs a mongod configured as an arbiter in the rs2 replica set."
recipe "studyblue-backend::mongo_arbiter_rs3", "Installs a mongod configured as an arbiter in the rs3 replica set."
recipe "studyblue-backend::mongo_arbiter_rs4", "Installs a mongod configured as an arbiter in the rs4 replica set."
recipe "studyblue-backend::postgres_master", "Sets up a new PostgreSQL server as a master node. See https://github.com/opscode-cookbooks/postgresql for configuration details."
recipe "studyblue-backend::zookeeper", "Sets up a new ZooKeeper node."

# == POSTGRES SETTINGS
#
attribute 'postgresql/password/postgres',
  :display_name => 'Main postgres password',
  :description => 'Main password for the postgres user.',
  :type => 'string',
  :required => 'required'

# == MEMCACHED SETTINGS
#
attribute "memcached/autoMemory",
  :display_name => "Automatically set memcached memory",
  :description => "Automatically set memcached memory to 75% of RAM.",
  :default => true

attribute "memcached/memory",
  :display_name => "Memcached Memory",
  :description => "Memory allocated for memcached instance",
  :default => "64"

attribute "memcached/port",
  :display_name => "Memcached Port",
  :description => "Port to use for memcached instance",
  :default => "11211"

attribute "memcached/user",
  :display_name => "Memcached User",
  :description => "User to run memcached instance as",
  :default => "nobody"

attribute "memcached/listen",
  :display_name => "Memcached IP Address",
  :description => "IP address to use for memcached instance",
  :default => "0.0.0.0"

Does that help at all?

sethvargo commented 11 years ago

Well, that explains it… attribute is being evaluated by Chozo, not the metadata /cc @reset

organicveggie commented 11 years ago

Removing the attribute settings from the metadata.rb file fixes the problem.

organicveggie commented 11 years ago

I'll try switching back to the latest Berkshelf and see if that still works (without the attribute settings).

sethvargo commented 11 years ago

@ivey ^, in case you're curious

organicveggie commented 11 years ago

Yup. Berkshelf 2.0.3 works fine if and only if I comment out or remove all of the attribute values from metadata.rb. And Vagrant + Berkshelf works as well.

ivey commented 11 years ago

People use the attribute commands in metadata? TIL...

organicveggie commented 11 years ago

@ivey :)

Well, I do... but that's mostly to emphasize which attributes in a cookbook are intended to be tweaked by the end consumer. It's not required, I suppose, but it has always seemed handy. Is that not a normal route? Am I just weird that way? :)

reset commented 11 years ago

@organicveggie thank you very much for being persistent with this bug. I think we can both agree that it was a weird one to track down ;)

We'll try and get this one squashed so you can put the attribute's in the metadata gain.

ivey commented 11 years ago

@organicveggie I wish more people did it, and that it meant something code-wise. The fact that it's rare shouldn't be seen as me discouraging it. :-)

organicveggie commented 11 years ago

If someone can point me in the right direction, I can submit a patch that basically tells Berkshelf to ignore the attribute commands in metadata.rb....

sethvargo commented 11 years ago

@organicveggie it's not Berkshelf, it's Chozo

reset commented 11 years ago

I'm pretty sure it's easily solved by adding a require for the chozo mixins at the top of this file https://github.com/RiotGames/ridley/blob/master/lib/ridley/chef/cookbook/metadata.rb

organicveggie commented 11 years ago

I tried hacking that in my local gem (/Users/sean/.rvm/gems/ruby-1.9.3-p429@chef11/gems/ridley-1.0.2/ib/ridley/chef/cookbook/metadata.rb), but that didn't work. Basically, I added:

require 'chozo/mixin'

To the top of that metadata.rb and then added:

include Chozo::Mixin

To both class Cookbook and class Metatadata. Neither seemed to have any impact. Should that even work? Or do I need to something different to test it?

sethvargo commented 11 years ago

@reset @organicveggie I think it's the opposite. We don't want Chozo's attribute method, we want metadata's. I think we need to move the metadata evaluation into a CleanRoom to ensure it grabs the right #attribute method.

reset commented 11 years ago

@sethvargo it's been a long time coming, but Chozo's VariaModel needs to be broken out and enhanced a bit. Attribute is a reserved word and it shouldn't be. This is something that is going to happen pretty soon since we are trying to break up Chozo into smaller bits and dropping active support.

sethvargo commented 11 years ago

:+1: for buffs :)

organicveggie commented 11 years ago

@sethvargo @reset Since this clearly isn't a bug in vagrant-berkshelf itself, should we just close this bug and move it somewhere else? I would like to keep track of progress, since I'd like to uncomment my attribute methods once it works again. :)

sethvargo commented 11 years ago

Theoretically, it's a Chozo bug, but like @reset said, we are phasing out Chozo. I would vote to open this under Ridley and link back to this ticket. But @ivey or @reset may want to do something else with it.

This message was sent from my mobile device.

I apologize in advance for any typographical errors or autocorrections.

On Jun 16, 2013, at 1:20 PM, Sean Laurent notifications@github.com wrote:

@sethvargo @reset Since this clearly isn't a bug in vagrant-berkshelf itself, should we just close this bug and move it somewhere else? I would like to keep track of progress, since I'd like to uncomment my attribute methods once it works again. :)

— Reply to this email directly or view it on GitHub.

sethvargo commented 11 years ago

@reset did we fix this with 2.0.5? Or did that not include the move to buff config?

reset commented 11 years ago

@sethvargo it is still an issue because the only change was breaking chozo up into smaller parts. VariaModel still is used to evaluate the metadata where attribute is a keyword.

douglaswth commented 11 years ago

I seem to be running into a similar issue while using attribute in my metadata.rb:

An error occurred while reading the Berksfile:

  uninitialized constant Ridley::Mixin::ParamsValidate::ValidationFailed
douglaswth commented 11 years ago

Apparently my problem was caused by having an integer instead of a string in the :default for one of my attributes.

kwilczynski commented 10 years ago

This actually is an annoying problem, indeed. We've had to remove attribute from most of our cookbooks when moving forward with Berkshelf :(

sagacity commented 10 years ago

Is there a recommended workaround for this (apart from removing all attributes from metadata.rb ofcourse)?

Edit: Unfortunately it also doesn't work with bleeding edge Berkshelf, as described here. It turns out I can get it to work if I don't specify my attributes to be of type "integer" (leaving out the type).