Puppet: System Administration Automated

Support

Ticket #1215 (assigned defect)

Opened 5 months ago

Last modified 4 months ago

Some syntax errors are not visible when running puppetd from the CLI

Reported by: ezralini Assigned to: andrew (accepted)
Priority: normal Milestone: 0.24.5
Component: interface Version: 0.24.4
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Easy

Description

A syntax error in the puppetmaster config, doesn't cause an error to be displayed when running puppetd --test on the CLI of a node that would be affected. I'm using 24.4 on both client and master.

When this is my node config:

node nyvl-flstg2 inherits  virtual-php-web-node {
    $custom_environment = "staging"
        include www2
    }

this is the output of puppetd --test on that node:

[root@nyvl-flstg2 ~]# puppetd  --test 
notice: Ignoring cache
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
notice: Finished catalog run in 9.98 seconds
[root@nyvl-flstg2 ~]#

Which is all to be expected, everything is working correctly. However, if this is my node config:

node nyvl-flstg2 inherits  virtual-php-web-node {
    $custom_environment = "staging"
        include www2 ?
    }

I get this in /var/log/messages on the puppetmaster:

May 6 17:14:20 nyvl-flintranet puppetmasterd[29418]: Could not parse for environment development: Syntax error at '}' at /etc/puppet/manifests/nodes/nyvl-flstg2.pp:4

Which makes sense, because of the '?' in the line that is "include www2 ?" However, if I run puppetd on the client, I have no knowledge that there is a syntax error:

[root@nyvl-flstg2 ~]# puppetd  --test 
notice: Ignoring cache
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
notice: Finished catalog run in 9.15 seconds
[root@nyvl-flstg2 ~]#

In this case, I actually don't know what config the client is using, since it can't be using the current one (there's a significant syntax error) and it is "ignoring cache". I'd expect an error to be displayed saying that there is a syntax issue.

Change History

05/07/08 13:54:26 changed by jamtur01

  • owner changed from community to luke.
  • stage changed from Unreviewed to Accepted.

Okay - that's officially odd. Luke?

05/07/08 13:54:37 changed by jamtur01

  • complexity changed from Unknown to Medium.

05/07/08 16:36:48 changed by luke

What does the catalog look like on the client?

I know this isn't happening every time, because I see syntax errors in my own code when I cause them.

05/12/08 22:51:52 changed by luke

  • stage changed from Accepted to Needs design decision.
  • milestone set to 0.24.5.

I figured it out.

What's happening here is that your server has an already-valid parser in memory, so when it encounters an error, it reuses that parser, rather than throwing exceptions, with the goal being that your clients still get their configurations even if there's a parse error.

Is this bad? Should we always propagate exceptions?

It seems like it would be less confusing, I guess.

05/12/08 23:18:02 changed by luke

I clarified the exception in [270c007].

05/16/08 06:17:58 changed by luke

  • status changed from new to assigned.
  • complexity changed from Medium to Easy.
  • stage changed from Needs design decision to Accepted.

05/26/08 07:35:28 changed by andrew

  • owner changed from luke to andrew.
  • status changed from assigned to new.

05/26/08 07:35:41 changed by andrew

  • status changed from new to assigned.