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

Object#=~ is called on TrueClass #711

Closed
deric opened this issue Oct 5, 2022 · 10 comments
Closed

Object#=~ is called on TrueClass #711

deric opened this issue Oct 5, 2022 · 10 comments
Assignees
Labels
Milestone

Comments

@deric
Copy link
Contributor

deric commented Oct 5, 2022

I have many warnings in puppetserver logs that looks like this:

lib/puppet_x/icinga2/utils.rb:351: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:186: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:190: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:193: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:196: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:199: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:201: warning: deprecated Object#=~ is called on TrueClass; it always returns nil
lib/puppet_x/icinga2/utils.rb:204: warning: deprecated Object#=~ is called on TrueClass; it always returns nil

puppet-icinga2 version 3.3.1.

Is it possible to fix this?

One of the affected lines

      if row =~ %r{^-:(.*)$}m
        return Regexp.last_match(1)
      end

Probably we could check the row type at the beginning of the parse(row) function? It might slightly speed up parsing.

@lbetz
Copy link
Contributor

lbetz commented Oct 7, 2022

Thx. I will look at it.

@lbetz lbetz self-assigned this Oct 7, 2022
@caniwi
Copy link

caniwi commented Oct 12, 2022

I am getting this message as well. I am running icinga2 v3.4.0

@lbetz
Copy link
Contributor

lbetz commented Oct 12, 2022

What kind of puppet version you're running on the server? My 7.13.1 doesn't report that in puppetserver.log with severity INFO.

@deric
Copy link
Contributor Author

deric commented Oct 12, 2022

puppetserver in version 7.9.1-1bullseye

$ /opt/puppetlabs/puppet/bin/ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

@lbetz You're right it's not logged in puppetserver.log but systemd's journal: journalctl -e -u puppetserver

@lbetz
Copy link
Contributor

lbetz commented Oct 13, 2022

Ok, I don't have these messages on my puppetserver 7.5.0 with ruby 2.7.3p183... mybe I have to update first.
... gotcha.

@lbetz lbetz added the bug label Oct 13, 2022
@lbetz lbetz added this to the v3.4.1 milestone Oct 14, 2022
lbetz added a commit that referenced this issue Oct 14, 2022
@lbetz
Copy link
Contributor

lbetz commented Oct 14, 2022

Ok, either I have no idea how to fix it, or the cache is interfering.

lbetz added a commit that referenced this issue Oct 14, 2022
lbetz added a commit that referenced this issue Oct 14, 2022
lbetz added a commit that referenced this issue Oct 14, 2022
@lbetz
Copy link
Contributor

lbetz commented Oct 14, 2022

fixed in branch bug/711, please restart your puppetserver before testing it.

@deric
Copy link
Contributor Author

deric commented Oct 14, 2022

@lbetz So far it looks good. Thanks for the quick fix!

@lbetz
Copy link
Contributor

lbetz commented Oct 14, 2022

thx. 9 days ago, not sooo quick.

@lbetz
Copy link
Contributor

lbetz commented Oct 14, 2022

Release will come at the weekend.

@lbetz lbetz closed this as completed in 4d8fe0d Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants