[chef] Re: Re: the `name' attribute is required in cookbook metadata


Chronological Thread 
  • From: AJ Christensen < >
  • To: " " < >
  • Subject: [chef] Re: Re: the `name' attribute is required in cookbook metadata
  • Date: Fri, 5 Dec 2014 23:57:59 +1300

Hello,

Chef::Exceptions::MetadataNotValid: Cookbook loaded at path(s)
[/var/etl-chef/chef-repo/cookbooks/monit] has invalid metadata: The
`name' attribute is required in cookbook metadata

Check the 'monit' cookbook at /var/etl-chef/chef-repo/cookbooks/monit
metadata.rb (it's a ruby file), or whatever is putting it there.

to fix, e.g.:
echo "name 'monit'" >> /var/etl-chef/chef-repo/cookbooks/monit/metadata.rb

You need to add the name attribute.

cheers,

--aj

On Fri, Dec 5, 2014 at 11:46 PM, Steven Danna 
< >
 wrote:
> Hi,
>
> I agree we could have a better error message, but to help right now,
> your best bet might be to use grep(1).  The -L option will print files
> without a match.  Thus, if I have 5 cookbooks:
>
>     > ls -d cookbooks/*
>     cookbooks/ckbk1 cookbooks/ckbk2 cookbooks/ckbk3 cookbooks/ckbk4
> cookbooks/ckbk5
>
>
> I can do something like:
>
>     > grep -L name cookbooks/*/metadata.rb
>     cookbooks/ckbk3/metadata.rb
>
> and it finds the cookbook without "name" in the metadata.  You might
> get some false positives if you use the word "name" elsewhere in the
> metadata.  Also, you may need to include metadata.json files as well.
>
> Hope this helps.
>
> Cheers,
>
> Steven
>
> On Fri, Dec 5, 2014 at 10:36 AM, David Montgomery
> < >
>  wrote:
>> Hi Opscode!
>>
>> How do I debug the error? the `name' attribute is required in cookbook
>> metadata
>>
>> Totally leaves me with nowhere to go. What recipe? What metadata?  What?\
>>
>> Thanks
>>
>>
>> Generated at 2014-12-05 10:29:01 +0000
>> Chef::Exceptions::MetadataNotValid: Cookbook loaded at path(s)
>> [/var/etl-chef/chef-repo/cookbooks/monit] has invalid metadata: The `name'
>> attribute is required in cookbook metadata
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook/cookbook_version_loader.rb:190:in
>> `raise_metadata_error!'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook/cookbook_version_loader.rb:79:in
>> `load'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:83:in `block in
>> load_cookbook'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:82:in `each'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:82:in
>> `load_cookbook'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:72:in `block in
>> load_cookbooks'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:71:in `each'
>> /opt/chef/embedded/apps/chef/lib/chef/cookbook_loader.rb:71:in
>> `load_cookbooks'
>> /opt/chef/embedded/apps/chef/lib/chef/policy_builder/expand_node_object.rb:61:in
>> `setup_run_context'
>> /opt/chef/embedded/apps/chef/lib/chef/client.rb:235:in `setup_run_context'
>> /opt/chef/embedded/apps/chef/lib/chef/client.rb:397:in `run'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:261:in `block in
>> fork_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in `fork'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:249:in
>> `fork_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:215:in `block in
>> run_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:in
>> `with_server_connectivity'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:201:in
>> `run_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:245:in `block in
>> interval_run_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in `loop'
>> /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:234:in
>> `interval_run_chef_client'
>> /opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:224:in
>> `run_application'
>> /opt/chef/embedded/apps/chef/lib/chef/application.rb:58:in `run'
>> /opt/chef/embedded/apps/chef/bin/chef-solo:25:in `<top (required)>'
>> /usr/bin/chef-solo:40:in `load'
>> /usr/bin/chef-solo:40:in `<main>'
>>



Archive powered by MHonArc 2.6.16.

§