Jira (PUP-6846) Obscure error messages caused by error in metadata.json of a module.

4 views
Skip to first unread message

Tiago TT (JIRA)

unread,
Oct 27, 2016, 10:14:03 AM10/27/16
to puppe...@googlegroups.com
Tiago TT created an issue
 
Puppet / Bug PUP-6846
Obscure error messages caused by error in metadata.json of a module.
Issue Type: Bug Bug
Affects Versions: PUP 4.3.1
Assignee: Unassigned
Components: Modules
Created: 2016/10/27 7:13 AM
Labels: module metadata
Priority: Normal Normal
Reporter: Tiago TT

Context

Introducing a new module in an existing and working puppet environment.

Symptoms

Running puppet agent fails with the following errors:

# puppet agent --test
Info: Using configured environment 'test'
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: string not matched
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Error 400 on SERVER: string not matched
Info: Retrieving plugin
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: string not matched
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 400 on SERVER: string not matched
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, string not matched at /etc/puppetlabs/code/environments/test/site.pp:8:1 on node testing.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Error messages on the server log:

# tail -f /var/log/puppetlabs/puppetserver/puppetserver.log
...
2016-10-27 12:17:07,532 ERROR [qtp350972994-25856] [puppet-server] Puppet string not matched
org/jruby/RubyString.java:3912:in `[]='
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/module.rb:158:in `load_metadata'
org/jruby/RubyArray.java:1613:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/module.rb:157:in `load_metadata'
org/jruby/RubyArray.java:1613:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/module.rb:151:in `load_metadata'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/module.rb:68:in `initialize'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node/environment.rb:292:in `modules'
org/jruby/RubyArray.java:2407:in `collect'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node/environment.rb:290:in `modules'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node/environment.rb:247:in `module'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/file_serving/mount/modules.rb:10:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/file_server.rb:29:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:134:in `do_find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:48:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:240:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:47:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `process'
org/jruby/RubyArray.java:1613:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:60:in `process'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:58:in `process'
file:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/puppet-server-lib/puppet/server/master.rb:42:in `handleRequest'
Puppet$$Server$$Master_1414315869.gen:13:in `handleRequest'
request_handler_core.clj:313:in `invoke'
request_handler_core.clj:305:in `invoke'
request_handler_core.clj:289:in `invoke'
request_handler_service.clj:35:in `handle_request'
request_handler.clj:3:in `invoke'
request_handler.clj:3:in `invoke'
core.clj:626:in `invoke'
core.clj:2468:in `doInvoke'
master_core.clj:31:in `invoke'
ring.clj:22:in `invoke'
ring.clj:13:in `invoke'
comidi.clj:267:in `invoke'
ringutils.clj:98:in `invoke'
ringutils.clj:54:in `invoke'
ringutils.clj:60:in `invoke'
ringutils.clj:110:in `invoke'
jetty9_core.clj:408:in `invoke'

Suspecting that the problem could be in the new module, I tried to build it and got this error:

$ puppet module build
Error: undefined method `split' for nil:NilClass
Error: Try 'puppet help module build' for usage

Cause

There was a structure error in the metadata.json file of the new module.
It was valid JSON but the dependencies setting was a list of strings instead of a list of hashes.

Wrong dependencies list:

  "dependencies": ["other-module"],

Solution

Fixing the structure of the module's dependencies in metadata.json made the errors go away and it all worked again.

Correct dependencies list.

  "dependencies": [
    {
      "name": "brandwatch-daemontools"
    }
  ],

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Tiago TT (JIRA)

unread,
Oct 27, 2016, 10:17:03 AM10/27/16
to puppe...@googlegroups.com
Tiago TT updated an issue
Change By: Tiago TT
h2. Context

Introducing a new module in an existing and working puppet environment.

h2. Symptoms

Running puppet agent fails with the following errors:
{code}

# puppet agent --test
Info: Using configured environment 'test'
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: string not matched
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Error 400 on SERVER: string not matched
Info: Retrieving plugin
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: string not matched
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 400 on SERVER: string not matched
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, string not matched at /etc/puppetlabs/code/environments/test/site.pp:8:1 on node testing.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
{code}


Error messages on the server log:
{code}
{code}


Suspecting that the problem could be in the new module,  I tried to build it and got this error:
{code}

$ puppet module build
Error: undefined method `split' for nil:NilClass
Error: Try 'puppet help module build' for usage
{code}

h2. Cause

There was a structure error in the metadata.json file of the new module.
It was valid JSON but the dependencies setting was a list of strings instead of a list of hashes.

Wrong dependencies list:
{code}
  "dependencies": ["other-module"],
{code}

h2. Solution

Fixing the structure of the module's dependencies in metadata.json made the errors go away and it all worked again.

Correct dependencies list.
{code}
  "dependencies": [
    {
      "name": "
brandwatch other - daemontools module "
    }
  ],
{code}

Michael Smith (JIRA)

unread,
Oct 28, 2016, 1:57:05 PM10/28/16
to puppe...@googlegroups.com
Michael Smith updated an issue
Change By: Michael Smith
Labels: maintenance metadata module

Michael Smith (JIRA)

unread,
Oct 28, 2016, 1:59:05 PM10/28/16
to puppe...@googlegroups.com

Michael Smith (JIRA)

unread,
Nov 4, 2016, 4:28:03 PM11/4/16
to puppe...@googlegroups.com

Michael Smith (JIRA)

unread,
Nov 4, 2016, 4:28:03 PM11/4/16
to puppe...@googlegroups.com
Michael Smith updated an issue
Change By: Michael Smith
Acceptance Criteria: Facter should not fail because of errors in metadata.json of some module that has no relation with facter.
The error messages should be more explicit ; specifically that metadata . json in a module does not match an expected format/schema. This is not related to Facter (though from the output you can be mislead into believing it is).

Maggie Dreyer (JIRA)

unread,
May 16, 2017, 5:15:07 PM5/16/17
to puppe...@googlegroups.com

Maggie Dreyer (JIRA)

unread,
May 16, 2017, 5:15:07 PM5/16/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: maintenance metadata module  triaged

Lindsey Smith (JIRA)

unread,
Nov 27, 2017, 2:22:03 PM11/27/17
to puppe...@googlegroups.com
Lindsey Smith updated an issue
Change By: Lindsey Smith
Priority: Normal Minor
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 5, 2020, 1:22:04 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-6846
 
Re: Obscure error messages caused by error in metadata.json of a module.

puppet module build was removed in puppet 6 and has been replaced by the pdk. As this hasn't seen any activity in 2+ years, I'm going to close it. Please reopen a new ticket against the pdk if it is still an issue.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages