apache2 resource not found?

Hello,

I’ve just started getting this error when I do a run of a cookbook that had
been working (albeit before a hefty refactor) I’ve tried to undo all of the
things, but can’t seem to get this error to go away… what seems most odd
here is that it appears to originate from the apache2 cookbook itself, but
I know that it sets itself up as a service because it’s there when I ssh in.

[2014-12-23T00:59:02+00:00] ERROR: chaucer_service_php[auth]
(auth::developer line 15) had an error: Chef::Exceptions::ResourceNotFound:
resource template[/etc/apache2/mods-available/php5.conf] is configured to
notify resource service[apache2] with action reload, but service[apache2]
cannot be found in the resource collection.
template[/etc/apache2/mods-available/php5.conf] is defined in
/tmp/kitchen/cache/cookbooks/apache2/definitions/apache_mod.rb:21:in `block
in from_file’

any ideas how I can get around this?

TIA,

  • Michael

define the resource service[apache2] at some time prior to the
auth::developer line 15 code running.

does your apache2 cookbook declare one? it looks like you might be
running the apache_mod definition before running whatever recipe sets
up the service resource.

cheers,

--aj

On Tue, Dec 23, 2014 at 2:16 PM, Michael Lindsay mlindsay@metrodigi.com wrote:

Hello,

I've just started getting this error when I do a run of a cookbook that had
been working (albeit before a hefty refactor) I've tried to undo all of the
things, but can't seem to get this error to go away... what seems most odd
here is that it appears to originate from the apache2 cookbook itself, but I
know that it sets itself up as a service because it's there when I ssh in.

[2014-12-23T00:59:02+00:00] ERROR: chaucer_service_php[auth]
(auth::developer line 15) had an error: Chef::Exceptions::ResourceNotFound:
resource template[/etc/apache2/mods-available/php5.conf] is configured to
notify resource service[apache2] with action reload, but service[apache2]
cannot be found in the resource collection.
template[/etc/apache2/mods-available/php5.conf] is defined in
/tmp/kitchen/cache/cookbooks/apache2/definitions/apache_mod.rb:21:in `block
in from_file'

any ideas how I can get around this?

TIA,

  • Michael

Hey Michael,

I'm one of the maintainers of the apache2 cookbook, and if you'd like to go over some of the changes to the cookbook, I'd be happy to chat with you a bit. The apache2 cookbook has gone through quite a few major changes recently so it's not surprising things aren't working like they used to before!

Just send me a note off-list if you want to chat.

--
Taylor

On Dec 22, 2014, at 6:19 PM, AJ Christensen aj@junglistheavy.industries wrote:

define the resource service[apache2] at some time prior to the
auth::developer line 15 code running.

does your apache2 cookbook declare one? it looks like you might be
running the apache_mod definition before running whatever recipe sets
up the service resource.

cheers,

--aj

On Tue, Dec 23, 2014 at 2:16 PM, Michael Lindsay mlindsay@metrodigi.com wrote:
Hello,

I've just started getting this error when I do a run of a cookbook that had
been working (albeit before a hefty refactor) I've tried to undo all of the
things, but can't seem to get this error to go away... what seems most odd
here is that it appears to originate from the apache2 cookbook itself, but I
know that it sets itself up as a service because it's there when I ssh in.

[2014-12-23T00:59:02+00:00] ERROR: chaucer_service_php[auth]
(auth::developer line 15) had an error: Chef::Exceptions::ResourceNotFound:
resource template[/etc/apache2/mods-available/php5.conf] is configured to
notify resource service[apache2] with action reload, but service[apache2]
cannot be found in the resource collection.
template[/etc/apache2/mods-available/php5.conf] is defined in
/tmp/kitchen/cache/cookbooks/apache2/definitions/apache_mod.rb:21:in `block
in from_file'

any ideas how I can get around this?

TIA,

  • Michael