What does this berkshelf error mean?


#1

Hi. I’m using Berkshelf 2.0.14 and I’m seeing this error message when
running berks install for one of my cookbooks.


==> Chef response did not contain a JSON body
Cookbook ‘chef-sugar,’ not found in any of the default locations

The source for chef-sugar is a local mirror that I have. I’ve run berks
install with the --debug flag and I can see it downloads chef-sugar.


Could not find a Chefignore at
’/root/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4’
Installing chef-sugar (1.3.0) from git:
'git@:/git/git_mirror/devops/chef_chef-sugar’
with branch: ‘master’ at ref: ‘87d5eb1b1d743eed830b329f2a6a965dad8f20e4’

I can also see the cookbook is located in the ~/.berkshelf/cookbooks folder.


ls
~/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4/
CHANGELOG.md chef-sugar.gemspec CONTRIBUTING.md Gemfile lib LICENSE
metadata.rb Rakefile README.md recipes spec

So, I don’t understand what Berkshelf is trying to tell me here and how to
fix it.

I know I should be using berkshelf 3.x, but let’s please not get into why
I’m not using 3.x yet. :slight_smile:


John Alberts


#2

Hi John,

Please note: Berkshelf 2 is no longer actively supported. I would recommend upgrading to Berkshelf 3 as soon as possible.

I would help if you including the commands you are running, your Berksfile, etc.

If you are depending on chef-sugar in a metadata location (or it’s a transitive dependency), you need to put the git location FIRST in the berksfile. Otherwise, it will try to use the chef-sugar from the community source, not your scm location.

Seth

On May 19, 2014, at 6:51 PM, John Alberts john.m.alberts@gmail.com wrote:

Hi. I’m using Berkshelf 2.0.14 and I’m seeing this error message when running berks install for one of my cookbooks.


==> Chef response did not contain a JSON body
Cookbook ‘chef-sugar,’ not found in any of the default locations

The source for chef-sugar is a local mirror that I have. I’ve run berks install with the --debug flag and I can see it downloads chef-sugar.


Could not find a Chefignore at '/root/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4’
Installing chef-sugar (1.3.0) from git: ‘git@:/git/git_mirror/devops/chef_chef-sugar’ with branch: ‘master’ at ref: ‘87d5eb1b1d743eed830b329f2a6a965dad8f20e4’

I can also see the cookbook is located in the ~/.berkshelf/cookbooks folder.


ls ~/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4/
CHANGELOG.md chef-sugar.gemspec CONTRIBUTING.md Gemfile lib LICENSE metadata.rb Rakefile README.md recipes spec

So, I don’t understand what Berkshelf is trying to tell me here and how to fix it.

I know I should be using berkshelf 3.x, but let’s please not get into why I’m not using 3.x yet. :slight_smile:


John Alberts


#3

Thanks Seth. I just found the error and was getting ready to reply to my
original email. Turns out the problem was a misplaced comma in my
metadata.rb that required chef-sugar.
I accidentally did this:
%w{chef-sugar, sensu}.each

oops. :confused:

It’s always the tiny typos like that, that are the hardest to find. :slight_smile:

John

On Tue, May 20, 2014 at 11:00 AM, Seth Vargo sethvargo@getchef.com wrote:

Hi John,

Please note: Berkshelf 2 is no longer actively supported. I would
recommend upgrading to Berkshelf 3 as soon as possible.

I would help if you including the commands you are running, your
Berksfile, etc.

If you are depending on chef-sugar in a metadata location (or it’s a
transitive dependency), you need to put the git location FIRST in the
berksfile. Otherwise, it will try to use the chef-sugar from the community
source, not your scm location.

Seth

On May 19, 2014, at 6:51 PM, John Alberts john.m.alberts@gmail.com
wrote:

Hi. I’m using Berkshelf 2.0.14 and I’m seeing this error message when
running berks install for one of my cookbooks.


==> Chef response did not contain a JSON body
Cookbook ‘chef-sugar,’ not found in any of the default locations

The source for chef-sugar is a local mirror that I have. I’ve run berks
install with the --debug flag and I can see it downloads chef-sugar.


Could not find a Chefignore at
’/root/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4’
Installing chef-sugar (1.3.0) from git: 'git@:/git/git_mirror/devops/chef_chef-sugar’
with branch: ‘master’ at ref: ‘87d5eb1b1d743eed830b329f2a6a965dad8f20e4’

I can also see the cookbook is located in the ~/.berkshelf/cookbooks
folder.


ls
~/.berkshelf/cookbooks/chef-sugar-87d5eb1b1d743eed830b329f2a6a965dad8f20e4/
CHANGELOG.md chef-sugar.gemspec CONTRIBUTING.md Gemfile lib LICENSE
metadata.rb Rakefile README.md recipes spec

So, I don’t understand what Berkshelf is trying to tell me here and how
to fix it.

I know I should be using berkshelf 3.x, but let’s please not get into
why I’m not using 3.x yet. :slight_smile:


John Alberts


John Alberts