Fail to connect to chef server when using vagrant


#1

I can successfully run any knife command I wish (i.e. authenticates with the
chef server, returns information).

Knife reads my knife_override.rb properly, which is necessary because my
username on my box is different from my key name (see below)

knife.rb:

node_name ( ENV[‘USER’] || ENV[‘USERNAME’] ).downcase
client_key “#{home_dir}/.chef/#{node_name}.pem”

My username on my box is ‘knox’, which means that WITHOUT the knife_override my
client key would be ‘knox.pem’, which it is not. My knife override (see below)
has the correct key in it ‘klively.pem’

knife_override.rb:

node_name 'klively’
client_key ‘/Users/Knox/.chef/klively.pem’

Like I said, when I run knife commands it works just as it should. It reads my
knife_overide.rb correctly, returns data from the chef server. However, when
using Vagrant (i.e. issuing the ‘vagrant up’ command) it runs through the
recipe fine until Ridley tries to establish a connection with my chef server.
It then fails to authenticate. It seems as if it is not reading my
knife_override.rb because it is trying to use ‘knox.pem’ [which doesn’t exist]
instead of ‘klively.pem’. Which is odd…it was my believe it is the same API
being used for this connection. Hence why I came here.

Output from issuing ‘vagrant up’:

Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Clearing any previously set forwarded ports…
[Berkshelf] Uploading cookbooks to ‘https://archive1.namimedia.com
[Berkshelf] Using nami-users (0.4.8) at ‘…/nami-users’
[Berkshelf] Using base (0.8.3) from metadata
[Berkshelf] Using users (1.5.2)
[Berkshelf] Using cpan (0.0.29)
[Berkshelf] Using mysql (5.1.0)
[Berkshelf] Using couchbase (1.1.0)
[Berkshelf] Using apt (2.3.8)
[Berkshelf] Using openssl (1.1.0)
[Berkshelf] Using windows (1.30.2)
[Berkshelf] Using chef_handler (1.1.5)
[Berkshelf] Using yum (3.0.6)
[Berkshelf] Using build-essential (1.4.4)
[Berkshelf] Using apache2 (1.8.14)
Ridley::Client crashed!
Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not
found at: ‘/Users/Knox/.chef/knox.pem’

/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:in
`initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`public_send’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in
`block in handle_message’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
`block in initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in
block in create' Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not found at: '/Users/Knox/.chef/knox.pem' /Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:ininitialize’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
public_send' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:indispatch’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
dispatch' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:inblock in handle_message’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
block in initialize' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:inblock in create’
(celluloid):0:in remote procedure call' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:invalue’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in
method_missing' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:inmethod_missing’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in
_send_' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid.rb:129:innew’
/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley.rb:27:in new' /Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:706:inridley_connection’
/Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:526:in
upload' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:35:inblock in upload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:in
each' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:inupload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:22:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/install.rb:33:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-omnibus-1.3.1/lib/vagrant-omnibus/action/install_chef.rb:38:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/provision.rb:54:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/set_name.rb:19:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inblock in run’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in
busy' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inrun’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/configure_chef.rb:23:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/load_shelf.rb:28:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/set_ui.rb:12:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/env_set.rb:19:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/machine.rb:147:inaction’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/batch_action.rb:63:in
block (2 levels) in run' /Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall’
/Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
`block in create_with_logging_context’
Berkshelf::ChefConnectionError: There was an error connecting to the Chef
Server


#2

Berkshelf does not read the client.rb for its settings. Check your
$HOME/.berkshelf/config.json to see what key it is trying to use.

  • Julian

On Wed, Apr 9, 2014 at 1:53 PM, klively@namimedia.com wrote:

I can successfully run any knife command I wish (i.e. authenticates with the
chef server, returns information).

Knife reads my knife_override.rb properly, which is necessary because my
username on my box is different from my key name (see below)

knife.rb:

node_name ( ENV[‘USER’] || ENV[‘USERNAME’] ).downcase
client_key “#{home_dir}/.chef/#{node_name}.pem”

My username on my box is ‘knox’, which means that WITHOUT the knife_override my
client key would be ‘knox.pem’, which it is not. My knife override (see below)
has the correct key in it ‘klively.pem’

knife_override.rb:

node_name 'klively’
client_key ‘/Users/Knox/.chef/klively.pem’

Like I said, when I run knife commands it works just as it should. It reads my
knife_overide.rb correctly, returns data from the chef server. However, when
using Vagrant (i.e. issuing the ‘vagrant up’ command) it runs through the
recipe fine until Ridley tries to establish a connection with my chef server.
It then fails to authenticate. It seems as if it is not reading my
knife_override.rb because it is trying to use ‘knox.pem’ [which doesn’t exist]
instead of ‘klively.pem’. Which is odd…it was my believe it is the same API
being used for this connection. Hence why I came here.

Output from issuing ‘vagrant up’:

Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Clearing any previously set forwarded ports…
[Berkshelf] Uploading cookbooks to ‘https://archive1.namimedia.com
[Berkshelf] Using nami-users (0.4.8) at ‘…/nami-users’
[Berkshelf] Using base (0.8.3) from metadata
[Berkshelf] Using users (1.5.2)
[Berkshelf] Using cpan (0.0.29)
[Berkshelf] Using mysql (5.1.0)
[Berkshelf] Using couchbase (1.1.0)
[Berkshelf] Using apt (2.3.8)
[Berkshelf] Using openssl (1.1.0)
[Berkshelf] Using windows (1.30.2)
[Berkshelf] Using chef_handler (1.1.5)
[Berkshelf] Using yum (3.0.6)
[Berkshelf] Using build-essential (1.4.4)
[Berkshelf] Using apache2 (1.8.14)
Ridley::Client crashed!
Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not
found at: ‘/Users/Knox/.chef/knox.pem’

/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:in
`initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`public_send’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in
`block in handle_message’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
`block in initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in
block in create' Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not found at: '/Users/Knox/.chef/knox.pem' /Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:ininitialize’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
public_send' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:indispatch’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
dispatch' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:inblock in handle_message’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
block in initialize' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:inblock in create’
(celluloid):0:in remote procedure call' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:invalue’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in
method_missing' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:inmethod_missing’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in
_send_' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid.rb:129:innew’
/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley.rb:27:in new' /Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:706:inridley_connection’
/Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:526:in
upload' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:35:inblock in upload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:in
each' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:inupload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:22:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/install.rb:33:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-omnibus-1.3.1/lib/vagrant-omnibus/action/install_chef.rb:38:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/provision.rb:54:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/set_name.rb:19:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inblock in run’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in
busy' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inrun’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/configure_chef.rb:23:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/load_shelf.rb:28:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/set_ui.rb:12:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/env_set.rb:19:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/machine.rb:147:inaction’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/batch_action.rb:63:in
block (2 levels) in run' /Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall’
/Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
`block in create_with_logging_context’
Berkshelf::ChefConnectionError: There was an error connecting to the Chef
Server


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#3

Thanks so much, I believe this is the issue. Installed RVM the other day and got off of system ruby, hadn’t installed the berksfile gem, nor done any configuration of it. I’ll poke around with it.’

Thanks again
Knox

On Apr 9, 2014, at 18:42, Julian C. Dunn jdunn@aquezada.com wrote:

Berkshelf does not read the client.rb for its settings. Check your
$HOME/.berkshelf/config.json to see what key it is trying to use.

  • Julian

On Wed, Apr 9, 2014 at 1:53 PM, klively@namimedia.com wrote:

I can successfully run any knife command I wish (i.e. authenticates with the
chef server, returns information).

Knife reads my knife_override.rb properly, which is necessary because my
username on my box is different from my key name (see below)

knife.rb:

node_name ( ENV[‘USER’] || ENV[‘USERNAME’] ).downcase
client_key “#{home_dir}/.chef/#{node_name}.pem”

My username on my box is ‘knox’, which means that WITHOUT the knife_override my
client key would be ‘knox.pem’, which it is not. My knife override (see below)
has the correct key in it ‘klively.pem’

knife_override.rb:

node_name 'klively’
client_key ‘/Users/Knox/.chef/klively.pem’

Like I said, when I run knife commands it works just as it should. It reads my
knife_overide.rb correctly, returns data from the chef server. However, when
using Vagrant (i.e. issuing the ‘vagrant up’ command) it runs through the
recipe fine until Ridley tries to establish a connection with my chef server.
It then fails to authenticate. It seems as if it is not reading my
knife_override.rb because it is trying to use ‘knox.pem’ [which doesn’t exist]
instead of ‘klively.pem’. Which is odd…it was my believe it is the same API
being used for this connection. Hence why I came here.

Output from issuing ‘vagrant up’:

Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Clearing any previously set forwarded ports…
[Berkshelf] Uploading cookbooks to ‘https://archive1.namimedia.com
[Berkshelf] Using nami-users (0.4.8) at ‘…/nami-users’
[Berkshelf] Using base (0.8.3) from metadata
[Berkshelf] Using users (1.5.2)
[Berkshelf] Using cpan (0.0.29)
[Berkshelf] Using mysql (5.1.0)
[Berkshelf] Using couchbase (1.1.0)
[Berkshelf] Using apt (2.3.8)
[Berkshelf] Using openssl (1.1.0)
[Berkshelf] Using windows (1.30.2)
[Berkshelf] Using chef_handler (1.1.5)
[Berkshelf] Using yum (3.0.6)
[Berkshelf] Using build-essential (1.4.4)
[Berkshelf] Using apache2 (1.8.14)
Ridley::Client crashed!
Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not
found at: ‘/Users/Knox/.chef/knox.pem’

/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:in
`initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`public_send’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in
`block in handle_message’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
`block in initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in
block in create' Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not found at: '/Users/Knox/.chef/knox.pem' /Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:ininitialize’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
public_send' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:indispatch’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
dispatch' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:inblock in handle_message’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
block in initialize' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:inblock in create’
(celluloid):0:in remote procedure call' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:invalue’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in
method_missing' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:inmethod_missing’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in
_send_' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid.rb:129:innew’
/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley.rb:27:in new' /Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:706:inridley_connection’
/Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:526:in
upload' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:35:inblock in upload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:in
each' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:inupload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:22:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/install.rb:33:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-omnibus-1.3.1/lib/vagrant-omnibus/action/install_chef.rb:38:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/provision.rb:54:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/set_name.rb:19:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inblock in run’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in
busy' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inrun’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/configure_chef.rb:23:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/load_shelf.rb:28:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/set_ui.rb:12:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/env_set.rb:19:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/machine.rb:147:inaction’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/batch_action.rb:63:in
block (2 levels) in run' /Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall’
/Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
`block in create_with_logging_context’
Berkshelf::ChefConnectionError: There was an error connecting to the Chef
Server


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#4

That was it, thanks again. I do have one more question though. We have two completely separate chef environments for each of our products. I ran berks configure which indeed wrote config.json which allowed me to complete the handshake. However, that json document has information particular to only one of the environments we run in, is there some sort of ‘vm’ solution for berksfile that would allow switching between environments?

On Apr 9, 2014, at 18:50, Knox Lively klively@namimedia.com wrote:

Thanks so much, I believe this is the issue. Installed RVM the other day and got off of system ruby, hadn’t installed the berksfile gem, nor done any configuration of it. I’ll poke around with it.’

Thanks again
Knox

On Apr 9, 2014, at 18:42, Julian C. Dunn jdunn@aquezada.com wrote:

Berkshelf does not read the client.rb for its settings. Check your
$HOME/.berkshelf/config.json to see what key it is trying to use.

  • Julian

On Wed, Apr 9, 2014 at 1:53 PM, klively@namimedia.com wrote:

I can successfully run any knife command I wish (i.e. authenticates with the
chef server, returns information).

Knife reads my knife_override.rb properly, which is necessary because my
username on my box is different from my key name (see below)

knife.rb:

node_name ( ENV[‘USER’] || ENV[‘USERNAME’] ).downcase
client_key “#{home_dir}/.chef/#{node_name}.pem”

My username on my box is ‘knox’, which means that WITHOUT the knife_override my
client key would be ‘knox.pem’, which it is not. My knife override (see below)
has the correct key in it ‘klively.pem’

knife_override.rb:

node_name 'klively’
client_key ‘/Users/Knox/.chef/klively.pem’

Like I said, when I run knife commands it works just as it should. It reads my
knife_overide.rb correctly, returns data from the chef server. However, when
using Vagrant (i.e. issuing the ‘vagrant up’ command) it runs through the
recipe fine until Ridley tries to establish a connection with my chef server.
It then fails to authenticate. It seems as if it is not reading my
knife_override.rb because it is trying to use ‘knox.pem’ [which doesn’t exist]
instead of ‘klively.pem’. Which is odd…it was my believe it is the same API
being used for this connection. Hence why I came here.

Output from issuing ‘vagrant up’:

Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Clearing any previously set forwarded ports…
[Berkshelf] Uploading cookbooks to 'https://****"
[Berkshelf] Using nami-users (0.4.8) at ‘…/nami-users’
[Berkshelf] Using base (0.8.3) from metadata
[Berkshelf] Using users (1.5.2)
[Berkshelf] Using cpan (0.0.29)
[Berkshelf] Using mysql (5.1.0)
[Berkshelf] Using couchbase (1.1.0)
[Berkshelf] Using apt (2.3.8)
[Berkshelf] Using openssl (1.1.0)
[Berkshelf] Using windows (1.30.2)
[Berkshelf] Using chef_handler (1.1.5)
[Berkshelf] Using yum (3.0.6)
[Berkshelf] Using build-essential (1.4.4)
[Berkshelf] Using apache2 (1.8.14)
Ridley::Client crashed!
Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not
found at: ‘/Users/Knox/.chef/knox.pem’

/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:in
`initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`public_send’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
`dispatch’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in
`block in handle_message’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
`block in initialize’

/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in
block in create' Ridley::Errors::ClientKeyFileNotFoundOrInvalid: client key is invalid or not found at: '/Users/Knox/.chef/knox.pem' /Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley/client.rb:156:ininitialize’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in
public_send' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:indispatch’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in
dispatch' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:inblock in handle_message’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in
block in initialize' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:inblock in create’
(celluloid):0:in remote procedure call' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:invalue’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in
method_missing' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:inmethod_missing’
/Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in
_send_' /Users/Knox/.vagrant.d/gems/gems/celluloid-0.14.1/lib/celluloid.rb:129:innew’
/Users/Knox/.vagrant.d/gems/gems/ridley-1.5.3/lib/ridley.rb:27:in new' /Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:706:inridley_connection’
/Users/Knox/.vagrant.d/gems/gems/berkshelf-2.0.14/lib/berkshelf/berksfile.rb:526:in
upload' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:35:inblock in upload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:in
each' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:33:inupload’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:22:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/install.rb:33:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Users/Knox/.vagrant.d/gems/gems/vagrant-omnibus-1.3.1/lib/vagrant-omnibus/action/install_chef.rb:38:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/provision.rb:54:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/set_name.rb:19:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inblock in run’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in
busy' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:inrun’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:51:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/configure_chef.rb:23:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/load_shelf.rb:28:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Users/Knox/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/set_ui.rb:12:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/env_set.rb:19:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in
call' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:incall’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
block in run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:inbusy’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in
run' /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/machine.rb:147:inaction’
/Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/batch_action.rb:63:in
block (2 levels) in run' /Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:incall’
/Users/Knox/.vagrant.d/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in
`block in create_with_logging_context’
Berkshelf::ChefConnectionError: There was an error connecting to the Chef
Server


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#5

On Wed, Apr 9, 2014 at 10:13 PM, Knox Lively klively@namimedia.com wrote:

That was it, thanks again. I do have one more question though. We have two completely separate chef environments
for each of our products. I ran berks configure which indeed wrote config.json which allowed me to complete the
handshake. However, that json document has information particular to only one of the environments we run in, is there
some sort of ‘vm’ solution for berksfile that would allow switching between environments?

Not that I’m aware of at the moment, although you could probably cook
something up using shell aliases and symbolic links (which is
essentially what the equivalents for .chef, like chefvm, do)

I would also anticipate that as Berkshelf gets absorbed more into the
Chef ecosystem, this separate “config.json” will go away.

  • Julian


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#6

That’s exactly what I did, I asked a co-worker and he said he utilized a symlink and chefvm. He placed a config.json in each of the appropriate configuration directories and a simple symlink from his “~/.chef/config.json” (which will be changed to the appropriate chef environment each time you switch with chefvm) to “~/.berkshelf/config.json”.

Thanks.

On Apr 10, 2014, at 19:16, Julian C. Dunn jdunn@aquezada.com wrote:

On Wed, Apr 9, 2014 at 10:13 PM, Knox Lively klively@namimedia.com wrote:

That was it, thanks again. I do have one more question though. We have two completely separate chef environments
for each of our products. I ran berks configure which indeed wrote config.json which allowed me to complete the
handshake. However, that json document has information particular to only one of the environments we run in, is there
some sort of ‘vm’ solution for berksfile that would allow switching between environments?

Not that I’m aware of at the moment, although you could probably cook
something up using shell aliases and symbolic links (which is
essentially what the equivalents for .chef, like chefvm, do)

I would also anticipate that as Berkshelf gets absorbed more into the
Chef ecosystem, this separate “config.json” will go away.

  • Julian


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]