elijah / chef-prometheus

Chef cookbook for Prometheus. The open source service monitoring system and time-series database.
Apache License 2.0
52 stars 93 forks source link

compatresource transitive dependency failing #51

Closed nickapos closed 7 years ago

nickapos commented 8 years ago

Hello, i am trying to use the cookbook, but unfortunately if fails at the compilation phase because one of the transitive dependencies (compat_resource), is failing. The compat_resource is a dependency of the rsyslog cookbook. The output is the following:

Recipe Compile Error in /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/libraries/autoload.rb ==> ncrcoe-prometheus-vm-centos7: ================================================================================ ==> ncrcoe-prometheus-vm-centos7: ==> ncrcoe-prometheus-vm-centos7: NoMethodError ==> ncrcoe-prometheus-vm-centos7: ------------- ==> ncrcoe-prometheus-vm-centos7: undefined method full_gem_path=' for #<Gem::Specification:0x227fc0c -> ==> ncrcoe-prometheus-vm-centos7: ==> ncrcoe-prometheus-vm-centos7: Cookbook Trace: ==> ncrcoe-prometheus-vm-centos7: --------------- ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/files/lib/compat_resource/gemspec.rb:10:inblock in module:CompatResource' ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/files/lib/compat_resource/gemspec.rb:8:in new' ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/files/lib/compat_resource/gemspec.rb:8:inmodule:CompatResource' ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/files/lib/compat_resource/gemspec.rb:7:in <top (required)>' ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/libraries/autoload.rb:15:inrequire_relative' ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/libraries/autoload.rb:15:in `<top (required)>' ==> ncrcoe-prometheus-vm-centos7: ==> ncrcoe-prometheus-vm-centos7: Relevant File Content: ==> ncrcoe-prometheus-vm-centos7: ---------------------- ==> ncrcoe-prometheus-vm-centos7: /tmp/vagrant-chef/beece1e7a10e090f42116de5cfb11692/cookbooks/compat_resource/files/lib/compat_resource/gemspec.rb: ==> ncrcoe-prometheus-vm-centos7: ==> ncrcoe-prometheus-vm-centos7: 3: end ==> ncrcoe-prometheus-vm-centos7: 4:
==> ncrcoe-prometheus-vm-centos7: 5: require_relative 'version' ==> ncrcoe-prometheus-vm-centos7: 6:
==> ncrcoe-prometheus-vm-centos7: 7: module CompatResource ==> ncrcoe-prometheus-vm-centos7: 8: GEMSPEC = Gem::Specification.new do |s| ==> ncrcoe-prometheus-vm-centos7: 9: # Gem path is cookbook root ==> ncrcoe-prometheus-vm-centos7: 10>> s.full_gem_path = File.expand_path('../../../..', FILE) ==> ncrcoe-prometheus-vm-centos7: 11: s.name = "compat_resource" ==> ncrcoe-prometheus-vm-centos7: 12: s.version = CompatResource::VERSION ==> ncrcoe-prometheus-vm-centos7: 13: s.platform = Gem::Platform::RUBY ==> ncrcoe-prometheus-vm-centos7: 14: s.summary = 'Bring some new features of Chef 12.5 to previous 12.X releases' ==> ncrcoe-prometheus-vm-centos7: 15: s.description = s.summary ==> ncrcoe-prometheus-vm-centos7: 16: s.author = 'John Keiser' ==> ncrcoe-prometheus-vm-centos7: 17: s.email = 'john@johnkeiser.com' ==> ncrcoe-prometheus-vm-centos7: 18: s.homepage = 'http://chef.io' ==> ncrcoe-prometheus-vm-centos7: 19: s.license = 'Apache 2.0'

lamont-granquist commented 7 years ago

technically this would have been a bug in compat_resource, but based on the error it looks like you're using a vagrant box with a /tmp/vagrant-chef install and not omnibus-chef which is probably chef 11.x or worse, in which case rsyslog and other community cookbooks have abandoned chef 11 support.

this cookbook should probably document that it is chef >= 12.1 only.

nickapos commented 7 years ago

Hello there, apologies for the delay in responding. In our deployment we have combination of Chef 11 and Chef 12 systems. The problem is actually not of the prometheus cookbook but of a transitive dependency. I managed to solve this by pinning the version of compat_resources to the last compatible version with early versions of chef 12. The chef version used in the particular box mentioned above is early chef 12. I could change it easily to the latest chef 12, but still the point is that we have old systems that are running chef 11 and can not be upgraded because of other cookbooks that are incompatible with chef 12. I have managed to deploy prometheus using the workaround mentioned, but please document this issue in order for people to know what they should expect if they try to use it with old versions of chef.

Thank you for your time