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

undefined method `match' for nil:NilClass (NoMethodError) #202

Closed
maxadamo opened this issue May 17, 2021 · 6 comments · Fixed by #203 · May be fixed by #232
Closed

undefined method `match' for nil:NilClass (NoMethodError) #202

maxadamo opened this issue May 17, 2021 · 6 comments · Fixed by #203 · May be fixed by #232
Assignees
Labels
bug Something isn't working

Comments

@maxadamo
Copy link
Contributor

maxadamo commented May 17, 2021

Affected Puppet, Ruby, OS, and module versions/distributions

  • Puppet: N/A
  • Ruby: N/A
  • Distribution: N/A
  • Module version: 0.15

How to reproduce (e.g Puppet code you use)

this is happening when the key ensure in the JSON catalog does not exist.
My guess is that when the package resource is used without ensure, the default key "present", is not being added to the catalog. For instance: package { 'my-package': } will not create a proper entry in the catalog

What are you seeing

on some servers I am seeing this error:

Traceback (most recent call last):
	2: from -e:1:in `<main>'
	1: from -e:1:in `select'
-e:1:in `block in <main>': undefined method `match' for nil:NilClass (NoMethodError)

What behavior did you expect instead

Please check the PR #203 for a possible solution.
We need to ensure that the key exists before attempting to match the digits.

@maxadamo
Copy link
Contributor Author

My guess is probably correct.
In the following line you see a piece of code that is causing me the issue that I was describing:
https://github.com/maxadamo/galera_proxysql/blob/master/manifests/galera/install.pp#L28

@albatrossflavour albatrossflavour linked a pull request May 21, 2021 that will close this issue
@albatrossflavour albatrossflavour self-assigned this May 21, 2021
@albatrossflavour albatrossflavour added the bug Something isn't working label May 21, 2021
@albatrossflavour
Copy link
Owner

Fixed as part of #203

@maxadamo
Copy link
Contributor Author

@albatrossflavour it seems that version 0.16 does not include this change

@FrankVanDamme
Copy link

This piece of code doesn't seem to be in 0.19 and adding it manually does not fix the error for me (message remains the same). Puppet 7.23, puppetserver 7.9.5.

@albatrossflavour
Copy link
Owner

Hmmm, odd. Can you share any steps to reproduce it?

@FrankVanDamme
Copy link

I figured it out. I have packages with no parameters whatso-ever so also inserting a check "and r['parameters']" fixes it (for me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants