Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-2818

ENC endpoint is called twice per Puppet run

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
    • Template:
    • Acceptance Criteria:
      Hide

      When running the reproducer:

      [root@centos8 ~]# tail -f /tmp/enc &
      [root@centos8 ~]# puppet agent -t --verbose --server $HOSTNAME
      PUPPET ENC SCRIPT Tue Jun 2 13:04:45 UTC 2020 centos8.wisse.example.com
      Warning: Unable to fetch my node definition, but the agent run will continue:
      Warning: Find /puppet/v3/node/centos8.wisse.example.com resulted in 404 with the message: {"message":"Not Found: Could not find node centos8.wisse.example.com","issue_kind":"RESOURCE_NOT_FOUND"}
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Retrieving locales
      PUPPET ENC SCRIPT Tue Jun 2 13:04:46 UTC 2020 centos8.wisse.example.com
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find node 'centos8.wisse.example.com'; cannot compile
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run
      

      Note how it outputs the ENC script twice. Since our ENC script calls a HTTP API, this increases the server load.

      Show
      When running the reproducer: [root@centos8 ~]# tail -f /tmp/enc & [root@centos8 ~]# puppet agent -t --verbose --server $HOSTNAME PUPPET ENC SCRIPT Tue Jun 2 13:04:45 UTC 2020 centos8.wisse.example.com Warning: Unable to fetch my node definition, but the agent run will continue: Warning: Find /puppet/v3/node/centos8.wisse.example.com resulted in 404 with the message: {"message":"Not Found: Could not find node centos8.wisse.example.com","issue_kind":"RESOURCE_NOT_FOUND"} Info: Retrieving pluginfacts Info: Retrieving plugin Info: Retrieving locales PUPPET ENC SCRIPT Tue Jun 2 13:04:46 UTC 2020 centos8.wisse.example.com Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find node 'centos8.wisse.example.com'; cannot compile Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run Note how it outputs the ENC script twice. Since our ENC script calls a HTTP API, this increases the server load.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When configuring Puppetserver as an ENC script (using node_terminus = exec + external_nodes), that script is called twice for every Puppet run.

      https://puppet.com/docs/puppet/latest/nodes_external.html#merging-classes-from-multiple-sources states:
      > This behavior isn’t mimicked when calling an ENC, which is invoked only once with the agent’s full node name.

      Later on it again states:
      > Unlike regular node definitions, where a node can match a less specific definition if an exactly matching definition isn’t found (depending on Puppet’s strict_hostname_checking setting), an ENC is called only once, with the node’s full name.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            ekohl Ewoud Kohl van Wijngaarden
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support