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

Illegal method definition of method 'validate_keys' on line 8' in legacy function. #1055

Closed
kscherer opened this issue Jan 25, 2019 · 3 comments · Fixed by #1056
Closed

Illegal method definition of method 'validate_keys' on line 8' in legacy function. #1055

kscherer opened this issue Jan 25, 2019 · 3 comments · Fixed by #1056

Comments

@kscherer
Copy link

Description of problem

After upgrade of puppetserver to 6.2.0, I started getting to following errors:

 Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.SecurityError: (SecurityError) Illegal method definition of method 'validate_keys' on line 8' in legacy function. See https://puppet.com/docs/puppet/latest/functions_refactor_legacy.html for more information

This was explicitly called out in the 6.2.0 Release Notes:
https://tickets.puppetlabs.com/browse/PUP-9294

The only use of validate_keys in my puppet code is in the puppet-sensu module sensu_sorted_json.rb and I was able to confirm the error was due to the puppet-sensu module by using a test environment without the sensu module which compiled successfully.

I have worked around this by adding "func3x_check = false" to the master section of puppet.conf.

I will see if I can figure out how to refactor sensu_sorted_json.rb later

Platform and version information

  • Your OS: Ubuntu 16.04
  • Your version of Puppet: 6.2.0
  • Your version of this module: v2.42.0 (sensu_sorted_json.rb file hasn't changed much since then)
@treydock
Copy link
Collaborator

It looks like the sensu_sorted_json would need to be converted to new function format introduced in Puppet 4. My read of PUP-9294 is that any legacy function that defines Ruby functions will generate an error so only way to refactor would be to move away from the legacy function and use new function format.

@treydock
Copy link
Collaborator

@kscherer Can you please try #1056 and see if that resolved your issue without the workaround of using func3x_check = false?

@kscherer
Copy link
Author

Many thanks for the quick response and fix! I was able to integrate the fix and verify that it resolved the errors I was seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants