hectcastro / chef-statsd

A Chef cookbook to install StatsD.
Apache License 2.0
38 stars 50 forks source link

ResourceNotFound on runit_service notification #20

Closed hectcastro closed 11 years ago

hectcastro commented 11 years ago

@rafaelmagu states:

While I support the use of runit, it seems the current implementation of the runit service in this cookbook is broken. I'm getting the following error when trying to include statsd in my recipe:

[2013-06-17T23:06:56+00:00] FATAL: Chef::Exceptions::ResourceNotFound: resource git[/usr/share/statsd] is configured to notify resource runit_service[statsd] with action restart, but runit_service[statsd] cannot be found in the resource collection. git[/usr/share/statsd] is defined in /var/cache/chef/cookbooks/statsd/recipes/default.rb:5:infrom_file'`

I have already verified that I have depends "runit" in my own metadata and even tried forking this cookbook and moving the order of the statements around to define the service before the notify statement, all to no avail.

Running Chef 10.24.0 on Ubuntu Precise (12.04).

Any clues? The guys on #chef could not figure it out either.

hectcastro commented 11 years ago

I could not reproduce this locally using Ubuntu 12.04 x64 and Chef 10.24.0. @rafaelmagu, can you look at see what I may have done differently?

$ kitchen converge ubuntu
-----> Starting Kitchen (v1.0.0.alpha.7)
-----> Creating <default-ubuntu-1204>
       [kitchen::driver::vagrant command] BEGIN (vagrant up --no-provision)
       Bringing machine 'default' up with 'virtualbox' provider...
       [default] Importing base box 'opscode-ubuntu-12.04'...
       [default] Matching MAC address for NAT networking...
       [default] Setting the name of the VM...
       [default] Clearing any previously set forwarded ports...
       [Berkshelf] Skipping Berkshelf with --no-provision
       [default] Creating shared folders metadata...
       [default] Clearing any previously set network interfaces...
       [default] Preparing network interfaces based on configuration...
       [default] Forwarding ports...
       [default] -- 22 => 2222 (adapter 1)
       [default] Running any VM customizations...
       [default] Booting VM...
       [default] Waiting for VM to boot. This can take a few minutes.
       [default] VM booted and ready for use!
       [default] Setting hostname...
       [default] Configuring and enabling network interfaces...
       [default] Mounting shared folders...
       [default] -- /vagrant
       [kitchen::driver::vagrant command] END (0m33.17s)
       [kitchen::driver::vagrant command] BEGIN (vagrant ssh-config)
       [kitchen::driver::vagrant command] END (0m1.52s)
       Vagrant instance <default-ubuntu-1204> created.
       Finished creating <default-ubuntu-1204> (0m38.18s).
-----> Converging <default-ubuntu-1204>
-----> Installing Chef Omnibus (10.24.0)
--2013-06-18 12:21:28--  https://www.opscode.com/chef/install.sh
Resolving www.opscode.com (www.opscode.com)... 184.106.28.83
Connecting to www.opscode.com (www.opscode.com)|184.106.28.83|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6510 (6.4K) [application/x-sh]
Saving to: `STDOUT'

100%[======================================>] 6,510       --.-K/s   in 0s

2013-06-18 12:21:28 (1.35 GB/s) - written to stdout [6510/6510]

Downloading Chef 10.24.0 for ubuntu...
Installing Chef 10.24.0
Selecting previously unselected package chef.
(Reading database ... 53291 files and directories currently installed.)
Unpacking chef (from .../chef_10.24.0_amd64.deb) ...
Setting up chef (10.24.0-1.ubuntu.11.04) ...
Thank you for installing Chef!
       [local command] BEGIN (if ! command -v berks >/dev/null; then exit 1; fi)
       [local command] END (0m0.01s)
       [local command] BEGIN (berks install --path /var/folders/19/t498ml0j4w54c3hwvrk5ysb00000gn/T/default-ubuntu-1204-cookbooks20130618-121-jhxczm)
       Using statsd (1.0.0) at path: '/Users/hector/Sites/chef-statsd'
       Using apt (1.9.2)
       Using yum (2.2.2)
       Using minitest-handler (0.2.1)
       Installing nodejs (0.1.0) from github: 'hectcastro/chef-nodejs' with branch: 'v0.1.0' over protocol: 'git'
       Using git (2.5.0)
       Using dmg (1.1.0)
       Using build-essential (1.4.0)
       Using windows (1.8.10)
       Using chef_handler (1.1.4)
       Using runit (1.1.4)

...

[2013-06-18T12:27:30+00:00] INFO: Chef Run complete in 336.102811199 seconds
[2013-06-18T12:27:30+00:00] INFO: Running report handlers
Run options: -v --seed 46028

# Running tests:

nodejs::default#test_0001_installs the nodejs dependency packages = 0.04 s = .
nodejs::default#test_0002_creates the node binary file = 0.12 s = .
nodejs::default#test_0003_creates the npm binary file = 0.00 s = .
statsd::default#test_0005_runs as a daemon = 0.04 s = .
statsd::default#test_0003_creates the configuration file = 0.00 s = .
statsd::default#test_0004_creates a daemon user = 0.00 s = .
statsd::default#test_0001_creates the share directory = 0.00 s = .
statsd::default#test_0006_accepts connections = 0.00 s = .
statsd::default#test_0002_creates the configuration directory = 0.00 s = .

Finished tests in 0.229313s, 39.2477 tests/s, 39.2477 assertions/s.

9 tests, 9 assertions, 0 failures, 0 errors, 0 skips
[2013-06-18T12:27:30+00:00] INFO: Report handlers complete
       Finished converging <default-ubuntu-1204> (6m2.62s).
-----> Kitchen is finished. (6m42.87s)
rafaelmagu commented 11 years ago

Just spotted this:

       Using runit (1.1.4)

But mine appears as:

       Using runit (0.16.0)

Updating my repo so I can test against that cookbook. Had to put runit into my Berksfile. Not sure why Berkshelf didn't update it.

rafaelmagu commented 11 years ago

I can confirm the problem was solved by downloading the most current (1.1.7) version of the runit cookbook from https://github.com/opscode-cookbooks/runit