How to generate metadata.json


#1

Hello,

I’m getting the following error:
[Thu, 20 May 2010 17:07:17 -0700] FATAL: Cannot find a cookbook named
base; did you forget to add metadata to a cookbook?
(http://wiki.opscode.com/display/chef/Metadata)

The client tries to execute a recipe as defined in the role’s run_list.
“base” cookbook does not have a metadata.json.
There is metadata.rb, which was created with “rake new_cookbook
COOKBOOK=base”.

metadata.rb looks like this:
maintainer "Plaxo"
maintainer_email "ops@plaxo.com"
license "All rights reserved"
description "Installs/Configures base"
long_description IO.read(File.join(File.dirname(FILE), ‘README.rdoc’))
version “0.1”

%w{ redhat centos }.each do |os|
supports os
end

“rake metadata” does not seem to do anything.
“rake metadata --trace” shows:
[paulchoi@chef1 chef] rake metadata --trace (in /srv/chef) ** Invoke metadata (first_time) ** Invoke /srv/chef/site-cookbooks/sudo/metadata.json (first_time, not_needed) ** Invoke /srv/chef/site-cookbooks/sudo/metadata.rb (first_time, not_needed) ** Invoke /srv/chef/cookbooks/grub/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/grub/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/grub/metadata.json ** Invoke /srv/chef/cookbooks/chef_client/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/chef_client/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/chef_client/metadata.json ** Invoke /srv/chef/cookbooks/base/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/base/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/base/metadata.json ** Invoke /srv/chef/cookbooks/setupcore/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/setupcore/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/setupcore/metadata.json ** Invoke /srv/chef/cookbooks/yum/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/yum/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/yum/metadata.json ** Invoke /srv/chef/cookbooks/screen/metadata.json (first_time, not_needed) ** Invoke /srv/chef/cookbooks/screen/metadata.rb (first_time, not_needed) ** Invoke /srv/chef/cookbooks/perforce/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/perforce/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/perforce/metadata.json ** Invoke /srv/chef/cookbooks/daemontools/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/daemontools/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/daemontools/metadata.json ** Invoke /srv/chef/cookbooks/sudo/metadata.json (first_time, not_needed) ** Invoke /srv/chef/cookbooks/sudo/metadata.rb (first_time, not_needed) ** Invoke /srv/chef/cookbooks/setup_service/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/setup_service/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/setup_service/metadata.json ** Invoke /srv/chef/cookbooks/samba/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/samba/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/samba/metadata.json ** Invoke /srv/chef/cookbooks/dns/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/dns/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/dns/metadata.json ** Invoke /srv/chef/cookbooks/var_plaxo_dirs/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/var_plaxo_dirs/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/var_plaxo_dirs/metadata.json ** Invoke /srv/chef/cookbooks/sdev/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/sdev/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/sdev/metadata.json ** Invoke /srv/chef/cookbooks/postfix/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/postfix/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/postfix/metadata.json ** Invoke /srv/chef/cookbooks/ntp/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/ntp/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/ntp/metadata.json ** Invoke /srv/chef/cookbooks/sysctl/metadata.json (first_time) ** Invoke /srv/chef/cookbooks/sysctl/metadata.rb (first_time, not_needed) ** Execute /srv/chef/cookbooks/sysctl/metadata.json ** Execute metadata [paulchoi@chef1 chef]

But in the cookbooks that I created, metadata.json does not exist, even
if --trace says rake tries to invoke it.

With simple recipes it seems to work fine without a metadata.json. Is it
because some of my recipes have “include_recipe” dependency chains?

I’m kinda stuck, any ideas? Thanks for your help.

-Paul Choi


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there!

On May 20, 2010, at 6:11 PM, Paul Choi wrote:

But in the cookbooks that I created, metadata.json does not exist,
even if --trace says rake tries to invoke it.

With simple recipes it seems to work fine without a metadata.json.
Is it because some of my recipes have “include_recipe” dependency
chains?

I’m kinda stuck, any ideas? Thanks for your help.

What version of Chef are you using?

There was a bug0 in the metadata rake task where the .json file
wasn’t created. This has been fixed in 0.8.12+. We recommend upgrading
to 0.8.16.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkv2EKIACgkQO97WSdVpzT1sGwCgi/TSdk+0XUdJIF9mdLuTo+V7
pToAoJl9yxtbFEKqYHmzgFOOrwnC3oWt
=jahZ
-----END PGP SIGNATURE-----


#3

Hi Joshua,

Thanks for your reply. I was using 0.8.10-2 from EPEL Yum repository.
Upgrading to 0.8.16 (from ruby gem) fixed the problem.

Thanks!

-Paul

On 5/20/10 9:48 PM, Joshua Timberman wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there!

On May 20, 2010, at 6:11 PM, Paul Choi wrote:

But in the cookbooks that I created, metadata.json does not exist,
even if --trace says rake tries to invoke it.

With simple recipes it seems to work fine without a metadata.json. Is
it because some of my recipes have “include_recipe” dependency chains?

I’m kinda stuck, any ideas? Thanks for your help.

What version of Chef are you using?

There was a bug0 in the metadata rake task where the .json file
wasn’t created. This has been fixed in 0.8.12+. We recommend upgrading
to 0.8.16.


Opscode, Inc
Joshua Timberman, Senior Solutions Engineer
C: 720.334.RUBY E: joshua@opscode.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkv2EKIACgkQO97WSdVpzT1sGwCgi/TSdk+0XUdJIF9mdLuTo+V7
pToAoJl9yxtbFEKqYHmzgFOOrwnC3oWt
=jahZ
-----END PGP SIGNATURE-----