The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #15856

Puppet fails with opaque error message due to metadata.json syntax error

Added by Alex Jurkiewicz over 3 years ago. Updated over 2 years ago.

Status:Needs DecisionStart date:08/06/2012
Priority:NormalDue date:
Assignee:J.D. Welch% Done:

0%

Category:-
Target version:-
Affected Puppet version: Branch:
Keywords:ux

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

Error message is:

Error 400 on SERVER: Could not parse for environment production: expected next name, value pair in object at '}
'! at /home/puppet/main/manifests/site.pp:3 on node hostname.fqdn

I was getting this error message generated against the second line of my site.pp until I made the following change to our Puppet code:

diff --git a/main/modules/cacti/metadata.json b/main/modules/cacti/metadata.json
index c235951..6fa36c1 100644
--- a/main/modules/cacti/metadata.json
+++ b/main/modules/cacti/metadata.json
@@ -6,5 +6,5 @@
"puppetversion": "0.24",
"summary": "Standard Apache module",
"description": "This module can be used for basic Apache management",
-  "project_page": "http://www.example42.com",
+  "project_page": "http://www.example42.com"
}}

Our site.pp looks like this.

import "sites/*.pp"
import "roles/*.pp"

import "roles/app_server/*.pp"

If I swapped the first and second lines around I received the same error (ie with the error indicating the problem was with import “roles/*.pp”).

I found the solution here and with Ryan’s help on IRC: http://projects.puppetlabs.com/issues/4142#note-3

It was introduced after updating 2.7.11 –> 2.7.18. Ryan thought it might be related to this change in 2.7.16: “Significantly improve compilation performance when using modules”

My ideal fix would be to make the error message more descriptive, not consider this trailing comma an error (like 2.7.11), and to not consider an unparseable metadata.json a critical error.


Related issues

Related to Puppet - Bug #17017: Improve puppet's error handling and exit code correctness. Accepted
Related to Puppet - Bug #20728: Invalid metadata.json in module root causes Error 400 Investigating
Related to Puppet - Bug #22818: Invalid metadata.json causes failures instead of being sk... Closed

History

#1 Updated by Alex Jurkiewicz over 3 years ago

The error seems to be generated here: “lib/puppet/external/pson/pure/parser.rb” line 247

#2 Updated by eric sorenson over 3 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Anonymous
  • Keywords set to errors

Randall — another for the UX Error hitlist. Thoughts? Suggestions? Ninja-like maneuvers?

#3 Updated by Anonymous over 3 years ago

  • Assignee changed from Anonymous to J.D. Welch

#4 Updated by eric sorenson over 3 years ago

  • Parent task set to #17017

#5 Updated by eric sorenson over 3 years ago

  • Parent task deleted (#17017)

#6 Updated by J.D. Welch over 3 years ago

  • Keywords changed from errors to errors backlog

#7 Updated by J.D. Welch over 3 years ago

  • Keywords changed from errors backlog to backlog

#8 Updated by eric sorenson over 3 years ago

  • Keywords changed from backlog to ux

Also available in: Atom PDF