chef / chef-zero

Simple, easy-run, fast-start in-memory Chef server for testing and solo purposes
Apache License 2.0
532 stars 98 forks source link

WARN: Child with name $node.json found in multiple directories #127

Closed Joseph-R closed 8 years ago

Joseph-R commented 9 years ago

I see a lot of warnings when I run chef-client -z $recipe.rb along these lines:

WARN: Child with name 'ip-10-0-1-54.ec2.internal.json' found in multiple directories: /Users/jreid/repo/chef-repo/nodes/ip-10-0-1-54.ec2.internal.json and /Users/jreid/repo/chef-repo/nodes/ip-10-0-1-54.ec2.internal.json

That's weird both because a) there is only one version of that file and b) both full paths listed in the error output point to the exact same place.

For the full trace, please see this Gist.

Versions:

chef (12.2.1)
chef-dk (0.5.0.rc.5)
chef-provisioning (1.0.1)
chef-provisioning-aws (1.0.4, 1.0.3)
chef-provisioning-azure (0.3.2)
chef-provisioning-fog (0.13.2)
chef-provisioning-vagrant (0.8.3)
chef-vault (2.4.0)
chef-zero (4.2.1, 1.5.6)
cheffish (1.1.2, 1.1.0)
chefspec (4.2.0) 
lantrix commented 9 years ago

I get the same thing with chef-zero. Duplicate nodes, duplicate repos, duplicate data_bags etc. all with the duplicate as the same path:

[2015-05-19T14:38:56+10:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /Users/lantrix/chef, /Users/lantrix/chef
  One version per cookbook

[2015-05-19T14:38:56+10:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 12.3.0
[2015-05-19T14:38:56+10:00] INFO: *** Chef 12.3.0 ***
[2015-05-19T14:38:56+10:00] INFO: Chef-client pid: 40327
[2015-05-19T14:38:58+10:00] WARN: Child with name 'bootstrap.json' found in multiple directories: /Users/lantrix/chef/nodes/bootstrap.json and /Users/lantrix/chef/nodes/bootstrap.json
[2015-05-19T14:38:58+10:00] WARN: Run List override has been provided.
[2015-05-19T14:38:58+10:00] WARN: Original Run List: []
[2015-05-19T14:38:58+10:00] WARN: Overridden Run List: [recipe[aws_ha_chef::metal_create]]
[2015-05-19T14:38:58+10:00] INFO: Run List is [recipe[aws_ha_chef::metal_create]]
[2015-05-19T14:38:58+10:00] INFO: Run List expands to [aws_ha_chef::metal_create]
[2015-05-19T14:38:58+10:00] INFO: Starting Chef Run for bootstrap
[2015-05-19T14:38:58+10:00] INFO: Running start handlers
[2015-05-19T14:38:58+10:00] INFO: Start handlers complete.
[2015-05-19T14:38:58+10:00] INFO: HTTP Request Returned 404 Not Found: Object not found: 
resolving cookbooks for run list: ["aws_ha_chef::metal_create"]
[2015-05-19T14:38:58+10:00] INFO: Loading cookbooks [aws_ha_chef@1.1.4, lvm@1.3.6, hostnames@0.3.6, hostsfile@2.4.5]
[2015-05-19T14:38:58+10:00] INFO: Skipping removal of obsoleted cookbooks from the cache
Synchronizing Cookbooks:
[2015-05-19T14:38:58+10:00] INFO: Storing updated cookbooks/aws_ha_chef/recipes/metal_create.rb in the cache.
  - aws_ha_chef
  - lvm
  - hostnames
  - hostsfile
Compiling Cookbooks...
[2015-05-19T14:38:58+10:00] WARN: Child with name 'awsha' found in multiple directories: /Users/lantrix/chef/data_bags/awsha and /Users/lantrix/chef/data_bags/awsha
[2015-05-19T14:38:58+10:00] WARN: Child with name 'talent' found in multiple directories: /Users/lantrix/chef/data_bags/talent and /Users/lantrix/chef/data_bags/talent
[2015-05-19T14:38:58+10:00] WARN: Child with name 'tomcat_users' found in multiple directories: /Users/lantrix/chef/data_bags/tomcat_users and /Users/lantrix/chef/data_bags/tomcat_users

Maybe it's the client config pointing to two places...

Joseph-R commented 9 years ago

We are not configuring a client.rb. Should I be? I guess the default that is being generated is using duplicate paths?

The contents of my .chef directory:

$ ls -al .chef
total 8
drwxr-xr-x+  4 jreid  staff   136 May  5 12:55 .
drwxr-xr-x+ 23 jreid  staff   782 May 19 10:51 ..
-rw-r--r--+  1 jreid  staff  1027 May  5 12:55 knife.rb
drwxr-xr-x+  3 jreid  staff   102 Apr 11 17:41 local-mode-cache

And here are the contents of my knife.rb:

current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "jreid.local"
chef_zero.enabled        true
local_mode               true
client_key               "/Users/jreid/.ssh/korrelate2012.pem"
chef_server_url          "http://localhost:8889"
cache_type               'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path            [ "/Users/jreid/repo/chef-repo/cookbooks", "/Users/jreid/repo/chef-repo/site-cookbooks", "/Users/jreid/repo/chef-repo/berks-cookbooks" ]

# Amazon AWS
knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY']
knife[:aws_secret_access_key] = ENV['AWS_SECRET_KEY']

# Client version
knife[:bootstrap_version] = "12.2.1"

# Bootstrap with Chef-Zero
knife[:ssh_user] = "ec2-user"
chef_zero[:port] = "8889"
Joseph-R commented 9 years ago

Hey guys. Any input here?

lukas0krupa commented 9 years ago

I am getting similar warning. I noticed that in all cases are paths exactly same. Is this king of bug ?

I can see it in your snippet as well.

Child with name 'awsha' found in multiple directories: 
/Users/lantrix/chef/data_bags/awsha
and 
/Users/lantrix/chef/data_bags/awsha

EDIT: I did some checks and for some reason root directory (of chef repository) is examined twice. You can check it in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.4.1/lib/chef/chef_fs/file_system/multiplexed_dir.rb

thommay commented 8 years ago

This was actually a bug in chef not chef-zero and should be resolved in newer versions. Apologies for the delay in looking at this.

manzoorulhassan commented 7 years ago

I am still having this issue. Below are the various versions that I am using.

$ chef --version Chef Development Kit Version: 1.0.3 chef-client version: 12.16.42 delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103) berks version: 5.2.0 kitchen version: 1.13.2