New issue

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

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

Already on GitHub? Sign in to your account

Trying to run Vagrant up with butcher gives problem #3

Closed
mulderp opened this Issue Jan 25, 2013 · 9 comments

Comments

Projects
None yet
2 participants
@mulderp

mulderp commented Jan 25, 2013

Hello,

I installed butcher with:

vagrant gem install vagrant-butcher

But it somehow seems that the old client is still registered:

[2013-01-25T15:59:40+00:00] INFO: *** Chef 10.16.2 ***
[2013-01-25T15:59:41+00:00] INFO: Setting the run_list to ["role[base]", "role[application]", "recipe[locomotive-cms]"] from JSON
[2013-01-25T15:59:42+00:00] INFO: Run List is [role[base], role[application], recipe[locomotive-cms]]
[2013-01-25T15:59:42+00:00] INFO: Run List expands to [apt, omnibus_updater, xml, git, nodejs, passenger_apache2, locomotive-cms]
[2013-01-25T15:59:43+00:00] ERROR: Server returned error for https://api.opscode.com/organizations/fidor/reports/nodes/patrick_web_vm_2/runs, retrying 1/5 in 4s
[2013-01-25T15:59:48+00:00] ERROR: Server returned error for https://api.opscode.com/organizations/fidor/reports/nodes/patrick_web_vm_2/runs, retrying 2/5 in 8s
[2013-01-25T15:59:57+00:00] ERROR: Server returned error for https://api.opscode.com/organizations/fidor/reports/nodes/patrick_web_vm_2/runs, retrying 3/5 in 11s
[2013-01-25T16:00:08+00:00] ERROR: Server returned error for https://api.opscode.com/organizations/fidor/reports/nodes/patrick_web_vm_2/runs, retrying 4/5 in 17s

Any idea how to fix this?

Thanks!

Patrick

@cassianoleal

This comment has been minimized.

Show comment
Hide comment
@cassianoleal

cassianoleal Jan 25, 2013

Owner

When you destroyed the VM previously, did you see the messages about the node and client being deleted?

Owner

cassianoleal commented Jan 25, 2013

When you destroyed the VM previously, did you see the messages about the node and client being deleted?

@mulderp

This comment has been minimized.

Show comment
Hide comment
@mulderp

mulderp Jan 25, 2013

Hm.. retrying now gives:

vagrant destroy web

Are you sure you want to destroy the 'web' VM? [Y/N] y
[web] Forcing shutdown of VM...
[web] Removing Chef node ""...
[web] Could not remove node : 405 "Method Not Allowed"
[web] Removing Chef client ""...
[web] Could not remove client : 404 "Not Found"
[web] Destroying VM and associated drives...

mulderp commented Jan 25, 2013

Hm.. retrying now gives:

vagrant destroy web

Are you sure you want to destroy the 'web' VM? [Y/N] y
[web] Forcing shutdown of VM...
[web] Removing Chef node ""...
[web] Could not remove node : 405 "Method Not Allowed"
[web] Removing Chef client ""...
[web] Could not remove client : 404 "Not Found"
[web] Destroying VM and associated drives...

@cassianoleal

This comment has been minimized.

Show comment
Hide comment
@cassianoleal

cassianoleal Jan 25, 2013

Owner

Do you have the host_name configured in the Vagrantfile? It should look like:

Vagrant::Config.run do |config|
  config.vm.host_name = "vagrant-vm-hostname"
end
Owner

cassianoleal commented Jan 25, 2013

Do you have the host_name configured in the Vagrantfile? It should look like:

Vagrant::Config.run do |config|
  config.vm.host_name = "vagrant-vm-hostname"
end
@mulderp

This comment has been minimized.

Show comment
Hide comment
@mulderp

mulderp Jan 25, 2013

Thanks! I'll check; I am just in a provision run, but I will insert the lines above.
Also, in my case, I don't use a host_name but IPs for connecting VMs. My Vagrantfile looks like this:

https://github.com/mulderp/learning-chef/blob/master/Vagrantfile

mulderp commented Jan 25, 2013

Thanks! I'll check; I am just in a provision run, but I will insert the lines above.
Also, in my case, I don't use a host_name but IPs for connecting VMs. My Vagrantfile looks like this:

https://github.com/mulderp/learning-chef/blob/master/Vagrantfile

@cassianoleal

This comment has been minimized.

Show comment
Hide comment
@cassianoleal

cassianoleal Jan 25, 2013

Owner

I see. I don't use the hostnames to connect to the VMs either, but chef takes the hostname and uses it as the node name.
Currently, vagrant-butcher uses env[:vm].config.vm.host_name as the node and client name that will be passed to Chef for deletion. In your case, it finds no hostname and tries to delete node and client "" form the server, which is why you got the messages you mentioned when destroying.
After you set the hostname in your Vagrantfile, you don't need the chef.node_name anymore.
I see that you're using multi-VM Vagrantfiles, so make sure that you assign a different hostname for each VM the same you way you did chef.node_name.
I'll close this issue for now, but feel free to drop a line if you stumble into any other trouble!

Owner

cassianoleal commented Jan 25, 2013

I see. I don't use the hostnames to connect to the VMs either, but chef takes the hostname and uses it as the node name.
Currently, vagrant-butcher uses env[:vm].config.vm.host_name as the node and client name that will be passed to Chef for deletion. In your case, it finds no hostname and tries to delete node and client "" form the server, which is why you got the messages you mentioned when destroying.
After you set the hostname in your Vagrantfile, you don't need the chef.node_name anymore.
I see that you're using multi-VM Vagrantfiles, so make sure that you assign a different hostname for each VM the same you way you did chef.node_name.
I'll close this issue for now, but feel free to drop a line if you stumble into any other trouble!

@mulderp

This comment has been minimized.

Show comment
Hide comment
@mulderp

mulderp Jan 25, 2013

indeed setting the host_name solves the problem. thanks! it's an interesting approach to use vagrant and hosted chef.

mulderp commented Jan 25, 2013

indeed setting the host_name solves the problem. thanks! it's an interesting approach to use vagrant and hosted chef.

@cassianoleal

This comment has been minimized.

Show comment
Hide comment
@cassianoleal

cassianoleal Jan 25, 2013

Owner

Cool, I'm glad it's working for you.

Usually, unless an isolated cookbook actually requires using a chef server, I try to use chef solo for my development cycles since it allows me to do much faster iterations.

I use vagrant mostly with an open source chef server that I installed in one of my local servers. It helps me test cookbooks against a chef server as opposed to using them on chef solo only. I also use vagrant to do integration tests of my cookbooks, and I like to have an environment as close to production as possible, and that involves the use of chef-client.

When I have the time I'll check the feasibility of using the actual chef node name instead of relying on the hostname.

Owner

cassianoleal commented Jan 25, 2013

Cool, I'm glad it's working for you.

Usually, unless an isolated cookbook actually requires using a chef server, I try to use chef solo for my development cycles since it allows me to do much faster iterations.

I use vagrant mostly with an open source chef server that I installed in one of my local servers. It helps me test cookbooks against a chef server as opposed to using them on chef solo only. I also use vagrant to do integration tests of my cookbooks, and I like to have an environment as close to production as possible, and that involves the use of chef-client.

When I have the time I'll check the feasibility of using the actual chef node name instead of relying on the hostname.

@mulderp

This comment has been minimized.

Show comment
Hide comment
@mulderp

mulderp Jan 26, 2013

Wow, good to hear about the different setups strategies. I've tried chef-solo too, but I haven't yet a feeling for why/how it's giving faster feedback than chef-server.

Right now, I am writing my first cookbook; maybe I take the discussion to the chef mailing list, since I am having some questions: https://github.com/mulderp/learning-chef/tree/cms_role (app instance seems not to connect mongo instance)

mulderp commented Jan 26, 2013

Wow, good to hear about the different setups strategies. I've tried chef-solo too, but I haven't yet a feeling for why/how it's giving faster feedback than chef-server.

Right now, I am writing my first cookbook; maybe I take the discussion to the chef mailing list, since I am having some questions: https://github.com/mulderp/learning-chef/tree/cms_role (app instance seems not to connect mongo instance)

@cassianoleal

This comment has been minimized.

Show comment
Hide comment
@cassianoleal

cassianoleal Jan 28, 2013

Owner

To me, the use of chef server when developing a cookbook slows me down on two points. The first one is because I use Berkshelf for cookbook dependency management: every time I do a vagrant up or vagrant provision, it uploads every single cookbook dependency to the server, which in some cases takes up to 4 or 5 minutes.
The second point of slowness is during node conversion, as it reports each step to the server and requests new info. This one depends a lot on how quick the server is responding, but doesn't usually cause a noticeable slowdown.

Owner

cassianoleal commented Jan 28, 2013

To me, the use of chef server when developing a cookbook slows me down on two points. The first one is because I use Berkshelf for cookbook dependency management: every time I do a vagrant up or vagrant provision, it uploads every single cookbook dependency to the server, which in some cases takes up to 4 or 5 minutes.
The second point of slowness is during node conversion, as it reports each step to the server and requests new info. This one depends a lot on how quick the server is responding, but doesn't usually cause a noticeable slowdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment