After installing a module, you run Puppet and get an Error 500... while evaluating a resource statement error
. You can avoid this error and other unexpected module issues by using Puppet Development Kit (PDK) to test your custom modules and by checking module dependencies when you install or upgrade modules.
Error messages
After installing a module, you run Puppet and get an Error 500...while evaluating a Resource Statement
:
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown function: 'pe_event_forwarding::base_path'. (file: /etc/puppetlabs/code/environments/production/modules/<NAME OF MODULE>/manifests/init.pp, line: 234, column: 28) on node puppet.example.com
This error message indicates that you might have a module dependency issue.
Version and installation information
PE version: All supported
Solution
To avoid unexpected issues with modules in Puppet Enterprise, make sure to:
-
Test custom modules in PDK
You can use PDK to validate module code, unit test it, and to help you create classes, defined types, and tasks in your modules.
-
When installing or upgrading any module, check for dependencies in the module documentation on Puppet Forge.
When you use a Puppetfile to manage your code repos, you must also declare required dependent modules. Dependencies for modules are not automatically resolved. If you don’t resolve them, you might have errors or unexpected issues with modules.
Use PDK to test modules
Use the open source Puppet Development Kit (PDK) to write and validate Puppet code and modules. PDK includes a complete module skeleton, testing tools and all dependencies needed for its use. You can also convert an existing module to a standardized PDK module with an infrastructure for testing it. This allows you to use PDK tools for creating classes, defined types, and tasks in your module, as well as validating and unit testing it.
Check and resolve module dependencies
-
For information on dependencies for each module, check each module’s documentation on the Forge or the module’s repository (for non-Forge modules).
-
You can also check for dependency issues by running
puppet module list --debug
on the primary server or automatically by using thepuppetlabs-pe_status_check
module. -
If you find dependency issues, update your Puppetfile to fix them.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles