[chef] Re: Re: Re: Re: Re: $ berks upload keeps failing since yesterday


Chronological Thread 
  • From: Fabien Delpierre < >
  • To: chef < >
  • Subject: [chef] Re: Re: Re: Re: Re: $ berks upload keeps failing since yesterday
  • Date: Wed, 22 Apr 2015 15:37:19 -0400

The file name is nothing special (something.rc.erb), but that's probably irrelevant since the problem happens even when I move the template completely outside of the cookbook's directory structure.
So anyway, earlier I had a vague suspicion that maybe OS X's ubiquitous .DS_Store file might be the culprit but I didn't put the theory to the test. This time I did and deleted both .DS_Store files from the templates and templates/default directories... and lo! $ berks upload worked.
Pretty stupid.

On Wed, Apr 22, 2015 at 2:57 PM, Daniel DeLeo < " target="_blank"> > wrote:
On Wednesday, April 22, 2015 at 11:18 AM, Fabien Delpierre wrote:
> Daniel,
> Fortunately I'm only working with one template file here, so it's easy to narrow down, but I don't see what could possibly be wrong with the template: http://pastebin.com/TTLTg3Yz
> You don't have to read through it unless you feel like it, but I'm sharing it to show that that this is very, very standard/trivial stuff.
> That being said, even after moving this lone template file out of the templates/default directory of my cookbook so that it wouldn't be uploaded by Berkshelf, $ berks upload still fails in the same fashion, so that stinks.


It wouldn’t be the content in the template, but the filename that would be the issue. When you upload a cookbook, the client (knife or berks) sends the server a JSON data structure as described here: https://github.com/chef/chef/blob/44d70ba0f1b38bc3e1170ae978ad5e9a11679df3/lib/chef/cookbook_manifest.rb#L78-L112

From a quick reading of the server code https://github.com/chef/oc_erchef/blob/8a122c269746070352814fa498c57ff75eb60121/apps/chef_objects/src/chef_cookbook_version.erl#L274-L279 it is checking that each item in the templates array is a JSON object with name, path, checksum, and specificity keys (as strings) and String values.

I don’t know what the debugging options are for berks here, it would be really helpful if you could see what it was attempting to upload. Worst case scenario you can use socat as a debugging proxy. Filing a bug with berks is probably your best path forward at this point, though.

--
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§