disney / couchbase

Chef cookbook to install and configure Couchbase Server
24 stars 59 forks source link

Error executing action `modify` on resource 'couchbase_node[self]' #26

Closed mwalton236 closed 9 years ago

mwalton236 commented 10 years ago

When using this cookbook to install couchbase server enterprise 2.5.1 I get an error connection refused on the first attempt to configure the DB using the API. The stack trace is below.

I will submit a pull request shortly with some added retries which supresses the problem.

[2014-09-11T14:22:31+01:00] INFO: * Chef 11.4.4 * [2014-09-11T14:22:32+01:00] INFO: Setting the run_list to ["recipe[my-recipe]"] from JSON [2014-09-11T14:22:32+01:00] INFO: Run List is [recipe[my-recipe]] [2014-09-11T14:22:32+01:00] INFO: Run List expands to [my-recipe] [2014-09-11T14:22:32+01:00] INFO: Starting Chef Run for myhost [2014-09-11T14:22:32+01:00] INFO: Running start handlers [2014-09-11T14:22:32+01:00] INFO: Start handlers complete. [2014-09-11T14:22:40+01:00] INFO: execute[apt-get-update] ran successfully [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] created directory /var/cache/local [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] owner changed to 0 [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] group changed to 0 [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local] mode changed to 755 [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] created directory /var/cache/local/preseeding [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] owner changed to 0 [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] group changed to 0 [2014-09-11T14:22:40+01:00] INFO: directory[/var/cache/local/preseeding] mode changed to 755

[2014-09-11T14:24:06+01:00] INFO: remote_file[/var/chef/cache/couchbase-server-enterprise_2.5.1_x86_64.deb] updated [2014-09-11T14:24:35+01:00] INFO: directory[/opt/couchbase/var/lib/couchbase/data] mode changed to 755

Error executing action modify on resource 'couchbase_node[self]'

Errno::ECONNREFUSED

Connection refused - connect(2)

Cookbook Trace:

/tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/client.rb:19:in get' /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:32:innode_data' /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:27:in node_database_path' /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/libraries/node_provider.rb:13:inload_current_resource'

Resource Declaration:

In /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/recipes/server.rb

127: couchbase_node "self" do 128: database_path node['couchbase']['server']['database_path'] 129: 130: username node['couchbase']['server']['username'] 131: password node['couchbase']['server']['password'] 132: end 133:

Compiled Resource:

Declared in /tmp/vagrant-chef-2/chef-solo-1/cookbooks/couchbase/recipes/server.rb:127:in `from_file'

couchbase_node("self") do action :modify retries 0 retry_delay 2 cookbook_name :couchbase recipe_name "server" database_path "/opt/couchbase/var/lib/couchbase/data" username "rateservice" password "letmein" id "self" end

[2014-09-11T14:24:35+01:00] INFO: Running queued delayed notifications before re-raising exception [2014-09-11T14:24:35+01:00] ERROR: Running exception handlers [2014-09-11T14:24:35+01:00] ERROR: Exception handlers complete [2014-09-11T14:24:36+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [2014-09-11T14:24:36+01:00] FATAL: Errno::ECONNREFUSED: couchbase_node[self](couchbase::server line 127) had an error: Errno::ECONNREFUSED: Connection refused - connect(2)

dennyzhang commented 9 years ago

Same error to me.

Checking below code. https://github.com/urbandecoder/couchbase/blob/master/recipes/server.rb#L128-L140

I guess the reason may be this:

A quick hot fix is: change "/etc/init.d/couchbase-server", when "service couchbase-server start" return, make sure the service is up and running indeed.

Or add a blind wait before running "couchbase_node" section.

dennyzhang commented 9 years ago

Created a pull request to fix this issue.

https://github.com/urbandecoder/couchbase/pull/37

@juliandunn

mlennon3 commented 9 years ago

Still getting this error on Ubuntu 14.04, even after pull request #46. It has the same behavior

dennyzhang commented 9 years ago

@mlennon3

Same to me.

I've submitted a pull request, but it was not taken for unknown reason. https://github.com/urbandecoder/couchbase/pull/37/files

Maybe you can have a try with that.