# Understanding chef and git using my forks of some cookbooks

**URL:** <https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881>\
**Category:** Chef Infra (archive)\
**Created:** [February 29, 2016, 10:17am UTC](https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881 "2016-02-29T10:17:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vertical](https://avatars.discourse-cdn.com/v4/letter/v/e8c25b/32.png) [@vertical](https://discourse.chef.io/u/vertical)\
**Post date:** [February 29, 2016, 10:17am UTC](https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881/1 "2016-02-29T10:17:40Z")

</div>

Hi,

I am new to chef and until yet I got up and running a chef server and a developer box using vagrant to spin up machines using chef client.

After forking all git repos that are required for a swift server (cluster) here [https://github.com/lollisoft/swift](https://github.com/lollisoft/swift), I was able to upload all cookbooks swift depends on.

After all I was not able to get rid of the following error:

# ==\> default: ===================================================================

# ==\> default: Recipe Compile Error in /var/chef/cache/cookbooks/swift/recipes/man agement-server.rb ==\> default: ===================================================================

==\> default: NoMethodError  
==\> default: -------------  
==\> default: undefined method `[]' for nil:NilClass ==> default: Cookbook Trace: ==> default: --------------- ==> default: /var/chef/cache/cookbooks/swift/recipes/common.rb:70:in`block in  
from\_file’  
==\> default: /var/chef/cache/cookbooks/swift/recipes/common.rb:64:in `from_fil e' ==> default: /var/chef/cache/cookbooks/swift/recipes/management-server.rb:21:i n`from\_file’  
==\> default: Relevant File Content:  
==\> default: ----------------------  
==\> default: /var/chef/cache/cookbooks/swift/recipes/common.rb:  
==\> default: 63: # drop a ring puller script so we can dsh ring pulls  
==\> default: 64: template “/etc/swift/pull-rings.sh” do  
==\> default: 65: source “pull-rings.sh.erb”  
==\> default: 66: owner “swift”  
==\> default: 67: group “swift”  
==\> default: 68: mode “0700”  
==\> default: 69: variables({  
==\> default: 70\>\> :builder\_ip =\> git\_service[“host”],  
==\> default: 71: :service\_prefix =\> platform\_options[“service\_pr  
efix”]  
==\> default: 72: })  
==\> default: 73: only\_if “/usr/bin/id swift”  
==\> default: 74: end  
==\> default: 75:  
==\> default: 76: execute “/etc/swift/pull-rings.sh” do  
==\> default: 77: cwd “/etc/swift”  
==\> default: 78: only\_if “[-x /etc/swift/pull-rings.sh]”  
==\> default: 79: end  
==\> default: Running handlers:  
==\> default: [2016-02-29T02:08:04-08:00] ERROR: Running exception handlers  
==\> default: Running handlers complete  
==\> default: [2016-02-29T02:08:04-08:00] ERROR: Exception handlers complete  
==\> default: Chef Client failed. 0 resources updated in 11 seconds  
==\> default: [2016-02-29T02:08:04-08:00] FATAL: Stacktrace dumped to /var/chef/c  
ache/chef-stacktrace.out  
==\> default: [2016-02-29T02:08:04-08:00] FATAL: Please provide the contents of t  
he stacktrace.out file if you file a bug report  
==\> default: [2016-02-29T02:08:04-08:00] ERROR: undefined method `[]’ for nil:Ni  
lClass  
==\> default: [2016-02-29T02:08:04-08:00] FATAL: Chef::Exceptions::ChildConvergeE  
rror: Chef run process exited unsuccessfully (exit code 1)  
Chef never successfully completed! Any errors should be visible in the  
output above. Please fix your recipes so that they properly complete.

As of the maintainer of that swift cookbook mentioned the usage of ansible and do no longer support chef, I am set up.

One solution would propably using another swift cookbook from here:  
[https://github.com/openstack/cookbook-openstack-object-storage](https://github.com/openstack/cookbook-openstack-object-storage), but I like to understand the  
error first.

Do I miss something?

Is there any other swift repo supported by Chef (may be cookbook-openstack-object-storage)?

Any help is welcome!

Thanks, Lothar

---

<div class="post-metadata">

**Author:** ![jjasghar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jjasghar/32/1691_2.png) [@jjasghar](https://discourse.chef.io/u/jjasghar)\
**Post date:** [February 29, 2016, 3:45pm UTC](https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881/2 "2016-02-29T15:45:18Z")

</div>

Hi there Lothar!

Yep, so the openstack cookbooks are designed to work together to build an openstack cloud.

I was going to suggest that you join us in #openstack-chef on freenode, bit i think you’ve already asked your question there.

You may want to try out the [openstack-dev][chef] mailing list, on [lists.openstack.org](http://lists.openstack.org), I know we have a handful of people leveraging chef to build out their swift clusters there.

If you have more questions don’t hesitate to reach out to me on IRC at `j^2` and i can help direct you to the resources you may need.

---

<div class="post-metadata">

**Author:** ![vertical](https://avatars.discourse-cdn.com/v4/letter/v/e8c25b/32.png) [@vertical](https://discourse.chef.io/u/vertical)\
**Post date:** [February 29, 2016, 3:51pm UTC](https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881/3 "2016-02-29T15:51:51Z")

</div>

Thanks for your suggestion at freenode. I am online there. Actually I got much further with the mentioned Swift cookbook. Struggling with the chef encryption file. It is transferred, but not wich expected name.

I am Monitoring for you (my nick there is lollisoft)

Thanks

---

<div class="post-metadata">

**Author:** ![vertical](https://avatars.discourse-cdn.com/v4/letter/v/e8c25b/32.png) [@vertical](https://discourse.chef.io/u/vertical)\
**Post date:** [March 1, 2016, 3:10pm UTC](https://discourse.chef.io/t/understanding-chef-and-git-using-my-forks-of-some-cookbooks/7881/4 "2016-03-01T15:10:13Z")

</div>

Hi,

actually I got much further in my provisioning of a swift cluster. My first step - when I do understand that correctly - is to install a management-Server. While the installing, I get the following error in the step that tries to generate the rings.

TypeError: openstack\_object\_storage\_ring\_script[/etc/Swift/ring-Workspace/generate-rings.sh] (openstack-object-storage::ring-repo line 162) had an error: TypeError: no implicit conversion of Symbol into integer

I yet have only created the secret data bags as follows (very secret data :-)):

mkdir data\_bags\secrets  
echo { “id”: “swift\_hash\_path\_prefix”, “swift\_hash\_path\_prefix”: “SOME\_PREFIX” } \> data\_bags\secrets\swift\_hash\_path\_prefix.json  
echo { “id”: “swift\_hash\_path\_suffix”, “swift\_hash\_path\_suffix”: “SOME\_SUFFIX” } \> data\_bags\secrets\swift\_hash\_path\_suffix.json

echo { “id”: “swift\_authkey”, “swift\_authkey”: “Key4All” } \> data\_bags\secrets\swift\_authkey.json  
echo { “id”: “dispersion\_auth\_user”, “dispersion\_auth\_user”: “user” } \> data\_bags\secrets\dispersion\_auth\_user.json  
echo { “id”: “dispersion\_auth\_key”, “dispersion\_auth\_key”: “key” } \> data\_bags\secrets\dispersion\_auth\_key.json

start chef exec knife data bag create secrets

sleep 15

start chef exec knife data bag from file secrets swift\_hash\_path\_prefix.json --secret-file .chef/openstack\_data\_bag\_secret  
start chef exec knife data bag from file secrets swift\_hash\_path\_suffix.json --secret-file .chef/openstack\_data\_bag\_secret

start chef exec knife data bag from file secrets swift\_authkey.json --secret-file .chef/openstack\_data\_bag\_secret  
start chef exec knife data bag from file secrets dispersion\_auth\_user.json --secret-file .chef/openstack\_data\_bag\_secret  
start chef exec knife data bag from file secrets dispersion\_auth\_key.json --secret-file .chef/openstack\_data\_bag\_secret

What do I miss to get a management-Server running?

Is there another order required in the nodes (and their roles)?

Here is the stacktrace for the failing script:

Generated at 2016-03-01 06:48:32 -0800  
TypeError: openstack\_object\_storage\_ring\_script[/etc/swift/ring-workspace/generate-rings.sh] (openstack-object-storage::ring-repo line 162) had an error: TypeError: no implicit conversion of Symbol into Integer  
/var/chef/cache/cookbooks/openstack-object-storage/providers/ring\_script.rb:79:in `[]' /var/chef/cache/cookbooks/openstack-object-storage/providers/ring_script.rb:79:in`block (2 levels) in generate\_script’  
/var/chef/cache/cookbooks/openstack-object-storage/providers/ring\_script.rb:78:in `each' /var/chef/cache/cookbooks/openstack-object-storage/providers/ring_script.rb:78:in`block in generate\_script’  
/var/chef/cache/cookbooks/openstack-object-storage/providers/ring\_script.rb:38:in `each' /var/chef/cache/cookbooks/openstack-object-storage/providers/ring_script.rb:38:in`generate\_script’  
/var/chef/cache/cookbooks/openstack-object-storage/providers/ring\_script.rb:272:in `block in class_from_file' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider/lwrp_base.rb:87:in`instance\_eval’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider/lwrp\_base.rb:87:in `block in action' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider.rb:144:in`run\_action’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource.rb:596:in `run_action' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:73:in`run\_action’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in `block (2 levels) in converge' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in`each’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:105:in `block in converge' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/resource_list.rb:83:in`block in execute\_each\_resource’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource\_collection/stepable\_iterator.rb:116:in `call' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:116:in`call\_iterator\_block’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource\_collection/stepable\_iterator.rb:85:in `step' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/stepable_iterator.rb:104:in`iterate’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource\_collection/stepable\_iterator.rb:55:in `each_with_index' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource_collection/resource_list.rb:81:in`execute\_each\_resource’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/runner.rb:104:in `converge' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:668:in`block in converge’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:663:in `catch' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:663:in`converge’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:702:in `converge_and_save' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/client.rb:280:in`run’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:270:in `block in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:258:in`fork’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:258:in `fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:223:in`block in run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/local\_mode.rb:44:in `with_server_connectivity' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:211:in`run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:433:in `block in interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:423:in`loop’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:423:in `interval_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application/client.rb:412:in`run\_application’  
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/application.rb:58:in `run' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/bin/chef-client:26:in`\<top (required)\>’  
/usr/bin/chef-client:50:in `load’

Thanks, Lothar
