Question

I have encountered a strange issue when trying to run a community cookbook for installing a GitLab server. The cookbook can be found here. I used Berkshelf to install all dependencies and upload ed them to my server using berks upload.

I have to make a change to the gitconfig template in the default templates directory. (I have git use https:// instead of git://.) Any time I change a file in the cookbook (even a minor change like adding a comment) I get the following error when trying to run:

[2014-07-28T19:30:50-04:00] ERROR: Exception handlers complete
[2014-07-28T19:30:50-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 23.330996387 seconds
[2014-07-28T19:30:50-04:00] ERROR: undefined method `closed?' for nil:NilClass
[2014-07-28T19:30:50-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

the stacktrace below is after making at change in default.rb, I added a comment that said "test"

here is the stacktrace:

Generated at 2014-07-28 19:54:21 -0400
NoMethodError: undefined method `closed?' for nil:NilClass
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2789:in `stream_check'
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2709:in `read_body'
/opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:2736:in `body'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_inspectors/api_error_formatting.rb:91:in `rescue in format_rest_error'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_inspectors/api_error_formatting.rb:89:in `format_rest_error'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_inspectors/api_error_formatting.rb:77:in `describe_503_error'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb:69:in `humanize_http_exception'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb:47:in `add_explanation'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/error_mapper.rb:64:in `cookbook_sync_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/formatters/base.rb:155:in `cookbook_sync_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/event_dispatch/dispatcher.rb:29:in `block in cookbook_sync_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/event_dispatch/dispatcher.rb:29:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/event_dispatch/dispatcher.rb:29:in `cookbook_sync_failed'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/cookbook/synchronizer.rb:109:in `rescue in sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/cookbook/synchronizer.rb:95:in `sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/policy_builder/expand_node_object.rb:179:in `sync_cookbooks'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/policy_builder/expand_node_object.rb:66:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:265:in `setup_run_context'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:429:in `do_run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:213:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `fork'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/client.rb:207:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:217:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:328:in `block in run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `loop'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application/client.rb:317:in `run_application'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/bin/chef-client:26:in `<top (required)>'
/usr/bin/chef-client:23:in `load'
/usr/bin/chef-client:23:in `<main>'

If I switch it back and re-upload to my server, the issue goes away. Is there a reason I cannot edit this community cookbook?

Was it helpful?

Solution

Turns out, this was a proxy issue. After digging through the output of debug I noticed that the chef client was trying to communicate with the server again after the initial connection. This time it had done a reverse lookup and due to my reverse lookup not working properly I did not have the correct domain in the no proxy settings. The error that is thrown is not very clear though. The fix was to add the other domain to the no proxy list in the client.rb file. I discovered this after deleting the cookbook I was using and moving to the official gitlab cookbook. I had to make a change in the client.rb and noticed when I added the proxy it broke the client run just like before

OTHER TIPS

test this,

-Delete all berks cache cookbooks

-Delete lockfile

-Download cookbook dependecies

-Force upload to chef-server

The steps:

rm -rf /home/your_user/.berkshelf/cookbooks/*
cd /path_to_gitlab_cookbook
rm -rf Berksfile.lock
berks install
berks upload --force

and re-run deploy

sorry for my English

Best Regards

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top