Bug #1389

puppetmaster completely ignores any found external nodes if any nodes are found in manifests first.

Added by Mathieu Sauve-Frankel over 3 years ago. Updated over 1 year ago.

Status:Rejected Start date:07/03/2008
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:node
Target version:0.24.5
Affected Puppet version:0.25.4 Branch:
Keywords:external LDAP node nodes
Votes: 3

Description

I discovered this while trying to set up ldap nodes and external node support. I had enabled ldap node support, but had failed to remove all of the node declarations from my on-disk manifests.

When I tried to run a node against the pupeptmaster I was receiving messages such as:

"Could not find default node or by name with '%s'"

This message is found in Puppet::Parser::Compiler::evaluate_ast_node.

After adding some Puppet.debug statements in indirector/node/ldap.rb and indirector/node/exec.rb (I tested both), I verified that indirector was indeed finding my external nodes, but the compiler was ignoring them for some reason.

Adding Puppet.debugs in evaluate_ast_node allowed me to see the contents of @parser.nodes, this is when I realized that there was still 1 node being loaded from a local manifest.

After removing this errant node statement both ldap nodes and external nodes started behaving as expected.

I think that either more information should be added to the error message, or that the parser should be fixed to either completely ignore node statements from manifests when node_terminus is set to something other than default, or that it should be fixed to respect pre 0.23 behaviour that allows nodes to be set both locally and externally at the same time.

History

Updated by Mathieu Sauve-Frankel over 3 years ago

  • Target version set to 0.24.4

Updated by James Turnbull over 3 years ago

  • Category set to node
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies
  • Target version changed from 0.24.4 to 4
  • Keywords set to external LDAP node nodes

Updated by Luke Kanies over 3 years ago

  • Status changed from Needs Decision to Rejected

This works for me, so there’s something else going on for you.

I expect that what you’re seeing is some difference between how ldap nodes and ast nodes are handled, but, first of all, ldap nodes are actually handled first, not AST nodes, so there’s no chance that finding an AST node could cause LDAP nodes not to be found.

Try it with the HEAD of 0.24.x (once James merges in the fix for 1390); if there’s still a problem, please reopen it with more information. Otherwise, I think this is fixed.

Updated by James Turnbull over 3 years ago

  • Target version changed from 4 to 0.24.5

Updated by Nicolas Szalay over 2 years ago

  • Affected Puppet version changed from 0.24.4 to 0.24.8

I don’t reopen the bug but I can reproduce the bug too with a puppetmaster & client 0.24.8.

If there is a node definition in site.pp, then external_nodes result is ignored.

Updated by Luke Kanies over 2 years ago

  • Assignee deleted (Luke Kanies)

Can you give some more information on this?

I do this in testing pretty frequently and I’ve never had problems.

Updated by Magnus Leuthner almost 2 years ago

  • Affected Puppet version changed from 0.24.8 to 0.25.4

Luke Kanies wrote:

Can you give some more information on this?

I do this in testing pretty frequently and I’ve never had problems.

I can confirm that this issue still persists as described originally by Mathieu in version 0.25.4. We are currently investigating a switch from file-based to LDAP based node configuration and are seeing the same error (“Could not find default node…”) unless no nodes are loaded through site.pp. Custom debug messages indicate that puppetmasterd does indeed find the LDAP nodes (and it’s bases).

As I understand the code, Puppet::Parser::Compiler.evaluate_ast_node only skips the check if there are no ast_nodes found (using self.ast_nodes? which returns parser.nodes?). I guess replacing the line

return unless ast_nodes?

with

return if not ast_nodes? or Puppet[:node_terminus] == "ldap"

in evaluate_ast_node (parser/compiler.rb) would be a workaround.

Updated by Russell Jackson almost 2 years ago

I’ll put in a me-too on this one.

This was driving me absolutely up the wall until I found this ticket. Grep'ing for node, I found a single def still hiding in my template.pp. Removed it, and now it’s finding the ldap nodes.

Updated by Mohit Chawla over 1 year ago

I am on 0.25.4 as well, and nodes lookup through LDAP work wehn there are no node definitions listed in nodes.pp

Updated by James Turnbull over 1 year ago

So… We think we know what’s going on here:

If you use LDAP/external nodes and AST (node {}) nodes then there must be an entry for all nodes OR a default node. The simple work-around is to specify an empty default node in all node sources, for example in AST:

node default {}

And then a default node in LDAP or your external node source.

Also available in: Atom PDF