Skip to content

Negative lookahead regex issue on node definition #9483

Open
@Cuthbert286

Description

@Cuthbert286

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:

  1. Upgrade to Puppet Server version 8.6.3 on a Debian 12 (Bookworm) system.
  2. 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)/
  3. 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).
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagedJira issue has been created for this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions