Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No resource or method named `platform_family?' for ConsulCookbook::Provider::ConsulService #414

Closed
123BLiN opened this issue Feb 16, 2017 · 4 comments · Fixed by #417
Closed
Assignees

Comments

@123BLiN
Copy link

123BLiN commented Feb 16, 2017

Chef-client version - 12.6.0
consul-cookbook - 2.3.0
Centos 7

Can someone advice what to do with such error?:

 ================================================================================
    Error executing action `enable` on resource 'consul_service[consul]'
    ================================================================================

    NoMethodError
    -------------
    No resource or method named `platform_family?' for `ConsulCookbook::Provider::ConsulService ""'

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/consul/libraries/consul_service.rb:93:in `service_options'
    /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:174:in `block in service_resource'
    /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:168:in `tap'
    /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:168:in `service_resource'
    /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:153:in `notify_if_service'
    /var/chef/cache/cookbooks/poise-service/files/halite_gem/poise_service/service_mixin.rb:88:in `action_enable'
    /var/chef/cache/cookbooks/consul/libraries/consul_service.rb:80:in `action_enable'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/consul/recipes/default.rb

     30: consul_service service_name do |r|
     31:   config_file config.path
     32:   program install.consul_program
     33:
     34:   unless node.platform_family?('windows')
     35:     user node['consul']['service_user']
     36:     group node['consul']['service_group']
     37:   end
     38:   if node['consul']['service']

@aschneid75
Copy link

I'm attempting to use 2.3.0 and having the same problem. On a Google search, it looks like an LVM cookbook was having the same problem:

sous-chefs/lvm#115

It looks like the Platform Introspection DSL needs to be added to the library:

https://github.com/chef-cookbooks/lvm/pull/116/files

I looked through this cookbook's source and I'm not seeing it. I was going to add it, but wanted to verify I wasn't doing anything wrong.

@123BLiN
Copy link
Author

123BLiN commented Feb 17, 2017

Hello again :)
In my case the problem was in the fact that I've forked the wrong cookbook version (master) instead on v2.3.0.

the problem is in that line:
https://github.com/johnbellone/consul-cookbook/blob/master/libraries/consul_service.rb#L93
vs
https://github.com/johnbellone/consul-cookbook/blob/v2.3.0/libraries/consul_service.rb#L93

thanks @maxnasonov for finding this out!

@legal90 legal90 self-assigned this Feb 17, 2017
@aschneid75
Copy link

I'm figuring that's my problem too then. Didn't even think and pulled down master to look at the cookbook and then proceeded to use it instead of the 2.3.0 branch. I'll give that a shot.

Thanks for pointing it out!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants