sensu-plugins / sensu-plugins-chef

This plugin provides native instrumentation for monitoring Chef, including service health checks (via chef-server-ctl) and chef node status, and a Sensu handler for removing stale Sensu clients.
http://sensu-plugins.io
MIT License
6 stars 16 forks source link

All sorts of warning messages with check-chef-nodes.rb #29

Open dsemarketer opened 7 years ago

dsemarketer commented 7 years ago

Running Sensu 0.29.0-11 on Windows, embedded Ruby (2.4.0), sensu-plugins-chef v3.0.2

When running the check the following is outputted:

c:/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:30: warning: constant ::Fixnum is deprecated
c:/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:30: warning: constant ::Fixnum is deprecated
c:/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:30: warning: constant ::Fixnum is deprecated
c:/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/faraday-0.9.2/lib/faraday/request/retry.rb:30: warning: constant ::Fixnum is deprecated
W, [2017-07-18T10:16:55.636371 #5764] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-07-18T10:16:55.686058 #5764] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-07-18T10:16:55.696250 #5764] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-07-18T10:16:55.914978 #5764] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#default defined in Hash. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-07-18T10:16:55.914978 #5764] WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#default defined in Hash. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
(Then the check's output)

This began with updating Sensu to 0.29.0-11, most likely its with their update to Ruby 2.4.0. Previously running Sensu 0.26.0 with the v0.0.6 of this plugin had no issues. 0.0.6 throws install errors now as does the 1.x and 2.x versions. Again, probably due to Ruby 2.4.0

Any way to either fix or suppress these messages?

majormoses commented 7 years ago

@dsemarketer ya this is something that has plagued many things that rely on ridley and varia. I have already suppressed several of these here: https://github.com/sensu-plugins/sensu-plugins-chef/pull/27 looks like there are more to supress, I would guess for faraday we are looking at a dependency bump. I'd like to fix this too as I also use this check (I don't have the faraday warnings because I am still on 0.26 but the other is annoying. If you can provide some sleuthing on this warning we can see if we can suppress it ourselves or even better bump a dependency to make those go away without breaking anything that would help.

facastagnini commented 6 years ago

Similar errors running Sensu 0.28.4-1 on Linux, embedded Ruby (2.3.0p0), sensu-plugins-chef v5.0.0

W, [2018-02-08T18:44:20.191609 #8204]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
W, [2018-02-08T18:44:20.191774 #8204]  WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
W, [2018-02-08T18:44:20.191856 #8204]  WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
W, [2018-02-08T18:44:20.231531 #8204]  WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#default defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
W, [2018-02-08T18:44:20.231654 #8204]  WARN -- : You are setting a key that conflicts with a built-in method VariaModel::Attributes#default defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method
facastagnini commented 6 years ago

According to https://github.com/berkshelf/berkshelf/pull/1668

Long term solution would probably be to remove buff-config/varia_model and the hashie dep in favor of Chef::Config and Chef::Mash objects.

related, replacing deprecated ridley dep #33