Open
Description
Describe the Bug
When upgrading to Puppet Server version 8.6.3, certain node regex patterns stop functioning correctly. Specifically, regex patterns that use negative lookahead (?!
) no longer match nodes as expected. Instead, the Puppet agent throws an error when attempting to retrieve the catalog.
Expected Behavior
The regex patterns should continue to match nodes as defined, including those using negative lookahead assertions, and the catalog should be successfully retrieved.
Steps to Reproduce
Steps to reproduce the behavior:
- Upgrade to Puppet Server version 8.6.3 on a Debian 12 (Bookworm) system.
- Use a node block with a regex pattern that includes negative lookahead, such as:
node /^aws-server\d{2}-(af|ap|ca|eu|me|sa|us)-(central|(north|south)?(east|west)?)-\d(?!\.test)/
- Attempt to classify a node matching this pattern, e.g., aws-server01-us-west-1.domain.com (which should match) and aws-server01-us-west-1.test.domain.com (which should not match).
- Observe that the Puppet agent on the node that should match (e.g., aws-server01-us-west-1.domain.com) throws the following error:
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Cannot find definition Node on node aws-server01-us-west-1.domain.com
Environment
- Version 8.6.3
- Platform Debian 12 (Bookworm)
Additional Context
This issue only seems to occur after upgrading to Puppet Server 8.6.3. Previous versions did not experience this problem. The issue appears related to the handling of negative lookahead (?!
) within the regex engine used by Puppet Server.