facebook/grocery-delivery

grocery fails to delete cookbooks when you have multiple versions

elthariel opened this issue · 2 comments

Deleting one of the two versions allowed the process to resume

Here's a trace :

grocery-delivery[8434]: WARN: Attempting to acquire lock
grocery-delivery[8434]: WARN: Lock acquired
grocery-delivery[8434]: WARN: Updating repo
grocery-delivery[8434]: WARN: Determing changes... from a to b
grocery-delivery[8434]: WARN: Added cookbooks: [“xxxxxx”]
grocery-delivery[8434]: WARN: Deleted cookbooks: ["simple_iptables"]
grocery-delivery[8434]: WARN: Added roles: []
grocery-delivery[8434]: WARN: Deleted roles: []
grocery-delivery[8434]: WARN: Added databags: []
grocery-delivery[8434]: WARN: Deleted databags: []
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:267:in `invalid!'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.0/lib/mixlib/shellout.rb:254:in `error!'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/between_meals-0.0.4/lib/between_meals/util.rb:42:in `exec!'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/between_meals-0.0.4/lib/between_meals/knife.rb:86:in `block in cookbook_delete'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/between_meals-0.0.4/lib/between_meals/knife.rb:85:in `each'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/between_meals-0.0.4/lib/between_meals/knife.rb:85:in `cookbook_delete'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/grocery_delivery-0.0.4/bin/grocery-delivery:122:in `partial_upload'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/grocery_delivery-0.0.4/bin/grocery-delivery:149:in `upload_changed'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/grocery_delivery-0.0.4/bin/grocery-delivery:258:in `<top (required)>'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/bin/grocery-delivery:23:in `load'
grocery-delivery[8434]: ERROR: /opt/chef/embedded/bin/grocery-delivery:23:in `<main>'
rocery-delivery[8434]: WARN: Expected process to exit with [0], but received '100'#012---- Begin output of /opt/chef/bin/knife cookbook delete simple_iptables --purge --yes -c /root/.chef/knife.rb ----#012STDOUT: Which version(s) do you want to delete?#0121. simple_iptables 0.6.0#0122. simple_iptables 0.2.3#0123. All versions#012STDERR: ERROR: EOFError: end of file reached#012---- End output of /opt/chef/bin/knife cookbook delete simple_iptables --purge --yes -c /root/.chef/knife.rb ----#012Ran /opt/chef/bin/knife cookbook delete simple_iptables --purge --yes -c /root/.chef/knife.rb returned 100

We probably just want to add '-a' to the knife command line to fix it,

Makes sense to me, g_d expects that you aren't using versions so its fine to assume killing any we find is probably just cleaning up an accident. I think there's a similar potential error if g_d tries to delete a cookbook that vcs says needs to be deleted but already doesn't exist for some reason.