Understanding chef and git using my forks of some cookbooks


#1

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, 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:inblock 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 nfrom_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, 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


#2

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, 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.


#3

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


#4

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:inblock (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:inblock 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:ingenerate_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:ininstance_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:inrun_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:inrun_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:ineach’
/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:inblock 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:incall_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:initerate’
/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:inexecute_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:inblock 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:inconverge’
/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:inrun’
/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:infork’
/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:inblock 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:inrun_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:inloop’
/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:inrun_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