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

Bug #4142

puppet fails when metadata.json exists in module

Added by Dan Bode over 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:07/05/2010
Priority:HighDue date:
Assignee:-% Done:

0%

Category:modules
Target version:2.6.5
Affected Puppet version:2.6.0 Branch:https://github.com/jamtur01/puppet/tree/tickets/2.6.x/4142
Keywords:

We've Moved!

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

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

when I tried to run the developerbootstrap module, I ran into the following error:

puppet tests/init.pp 
uninitialized constant Puppet::Module::JSON at /usr/local/dev/puppet-dev/puppetlabs-developerbootstrap-0.0.5/tests/init.pp:1 on node puppet2.localdomain
[root@puppet2 tests]# puppet init.pp --trace
/usr/lib/ruby/site_ruby/1.8/puppet/module.rb:112:in `load_metadata'
/usr/lib/ruby/site_ruby/1.8/puppet/module.rb:59:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:81:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/node/environment.rb:81:in `module'
/usr/lib/ruby/site_ruby/1.8/puppet/module.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:20:in `find_manifests'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:45:in `import'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:82:in `load_until'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:140:in `import_if_possible'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:81:in `load_until'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:79:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:79:in `load_until'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection.rb:134:in `find_or_load'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type_collection.rb:142:in `find_hostclass'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:119:in `find_hostclass'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:150:in `evaluate_classes'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:148:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:148:in `evaluate_classes'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/include.rb:6:in `function_include'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/function.rb:40:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/function.rb:40:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:72:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:72:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type.rb:76:in `evaluate_code'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/resource.rb:74:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:311:in `evaluate_main'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:101:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:18:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:79:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:184:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:202:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:51:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:114:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:403:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in `execute'
/usr/bin/puppet:73
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:21:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:79:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:184:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:77:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:34:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:202:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:51:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:114:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:403:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:52:in `execute'
/usr/bin/puppet:73
uninitialized constant Puppet::Module::JSON at /usr/local/dev/puppet-dev/puppetlabs-developerbootstrap-0.0.5/tests/init.pp:1 on node puppet2.localdomain

I can get around the error by removing the metadata.json file.

I verified the issue also occurs with other modules.


Related issues

Related to Puppet - Bug #5214: Puppet module not synchronising when metadata.json exists Closed 11/06/2010
Duplicated by Puppet - Bug #5109: puppet-module-tool failes with .json file in directory Closed 10/27/2010

History

#1 Updated by Markus Roberts over 4 years ago

  • Status changed from Unreviewed to Closed

Fix pushed to master in commit:59718988af6c80451973c37e78c23cef7b171edc

#2 Updated by Rudy Gevaert over 4 years ago

  • Status changed from Closed to Re-opened

Markus, I’m sorry to come back onto this. I still have the same problem in 2.6 (I’m using the debian experimental package). When I delete the json file from the module I don’t have the issue any more.

I get this error: Could not retrieve catalog from remote server: Error 400 on SERVER: No source module metadata provided for collectd

I verified the source and it has PSON… in the module.rb file.

debug: catalog supports formats: b64_zlib_yaml dot marshal pson raw yaml; using pson
/usr/lib/ruby/1.8/puppet/indirector/rest.rb:57:in `deserialize'
/usr/lib/ruby/1.8/puppet/indirector/rest.rb:71:in `find'
/usr/lib/ruby/1.8/puppet/indirector/indirection.rb:193:in `find'
/usr/lib/ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/1.8/puppet/configurer.rb:225:in `retrieve_new_catalog'
/usr/lib/ruby/1.8/puppet/util.rb:414:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:413:in `thinmark'
/usr/lib/ruby/1.8/puppet/configurer.rb:224:in `retrieve_new_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:102:in `retrieve_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:143:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:101:in `with_client'
/usr/lib/ruby/1.8/puppet/agent.rb:37:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:171:in `call'
/usr/lib/ruby/1.8/puppet/application.rb:171:in `controlled_run'
/usr/lib/ruby/1.8/puppet/agent.rb:35:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:76:in `start'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `call'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `__signal__'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `each'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `__signal__'
(eval):2:in `signal'
/usr/lib/ruby/1.8/puppet/external/event-loop/event-loop.rb:313:in `sound_alarm'
/usr/lib/ruby/1.8/puppet/agent.rb:80:in `start'
/usr/lib/ruby/1.8/puppet/daemon.rb:124:in `start'
/usr/lib/ruby/1.8/puppet/application/agent.rb:132:in `main'
/usr/lib/ruby/1.8/puppet/application/agent.rb:89:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:398:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
err: Could not retrieve catalog from remote server: Error 400 on SERVER: No source module metadata provided for collectd at /etc/puppet/development/modules/collectd/manifests/client.pp:21 on node mproxyd1.ugent.be
/usr/lib/ruby/1.8/puppet/indirector/yaml.rb:22:in `find'
/usr/lib/ruby/1.8/puppet/indirector/indirection.rb:208:in `find_in_cache'
/usr/lib/ruby/1.8/puppet/indirector/indirection.rb:184:in `find'
/usr/lib/ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/1.8/puppet/configurer.rb:212:in `retrieve_catalog_from_cache'
/usr/lib/ruby/1.8/puppet/util.rb:414:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:413:in `thinmark'
/usr/lib/ruby/1.8/puppet/configurer.rb:211:in `retrieve_catalog_from_cache'
/usr/lib/ruby/1.8/puppet/configurer.rb:107:in `retrieve_catalog'
/usr/lib/ruby/1.8/puppet/configurer.rb:143:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:101:in `with_client'
/usr/lib/ruby/1.8/puppet/agent.rb:37:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:171:in `call'
/usr/lib/ruby/1.8/puppet/application.rb:171:in `controlled_run'
/usr/lib/ruby/1.8/puppet/agent.rb:35:in `run'
/usr/lib/ruby/1.8/puppet/agent.rb:76:in `start'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `call'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `__signal__'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `each'
/usr/lib/ruby/1.8/puppet/external/event-loop/signal-system.rb:95:in `__signal__'
(eval):2:in `signal'
/usr/lib/ruby/1.8/puppet/external/event-loop/event-loop.rb:313:in `sound_alarm'
/usr/lib/ruby/1.8/puppet/agent.rb:80:in `start'
/usr/lib/ruby/1.8/puppet/daemon.rb:124:in `start'
/usr/lib/ruby/1.8/puppet/application/agent.rb:132:in `main'
/usr/lib/ruby/1.8/puppet/application/agent.rb:89:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:398:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4

#3 Updated by Brandon Turner about 4 years ago

Rudy,

This may be a different issue, but check your metadata.json file for “trailing commas”:

{"cacti": {
"source": "git://www.example42.com/example42modules",
"author": "Alessandro Franceschi",
"version": "0.2",
"license": "GPL3",
"puppetversion": "0.24",
"summary": "Standard Apache module",
"description": "This module can be used for basic Apache management",
"project_page": "http://www.example42.com"    // <--- There should be no comma here!!!
}}

I was getting errors similar to what you describe on clients. The puppet master said:

err: expected next name, value pair in object at '}
'!

but gave no indication of what file the error occurred in.

#4 Updated by Rudy Gevaert about 4 years ago

sorry for the delay…

I went through my svn history and it didn’t have any trailing commas.

#5 Updated by Markus Roberts about 4 years ago

  • Status changed from Re-opened to Needs More Information
  • Affected Puppet version deleted (2.6alpha1)

Rudy —

  1. Are you sure you are running the version with the fix on both the master and the agent?
  2. What leads you to conclude it’s the same error (given that the messages are different)?
  3. Could you run the master with —debug and —trace and post the results?

If your answer to 2) is that it’s not the same issue, feel free to move to a new ticket.

— Markus

#6 Updated by Rudy Gevaert about 4 years ago

Hi, sorry I don’t have time for the moment to go into this ticket. You can close it.

#7 Updated by Kris Buytaert about 4 years ago

My take on the issue ,

Running puppet-server-2.6.3-0.3.rc2.el5 on CentOS ,

With the puppet apache module from https://github.com/ghoneycutt/puppet-apache , and the metadata.json file in place I get the

No source module metadata provided for apache at /etc/puppet/modules/apache/manifests/init.pp

Error, when I remove the file , it my catalog gets build I tried regenerating the metadata.json file , in order to be sure the issue isn’t related to an older version of puppet-module , but the problem persists.

#8 Updated by Nigel Kersten about 4 years ago

  • Status changed from Needs More Information to Accepted
  • Target version set to 69

#9 Updated by Joe Julian about 4 years ago

The problem seems to be around puppet/module.rb:113 where the PSON attributes :source, :author, :version, :license, and :puppetversion are tested for values. If those values don’t exist (except for puppetversion which does not require a value) then the error is raised.

If those are required attributes, they’re not being created by puppet-module on installation. If they’re not required attributes, then the logic needs reworked.

#10 Updated by James Turnbull almost 4 years ago

  • Target version changed from 69 to 2.6.5

#11 Updated by Ken Barber almost 4 years ago

“The problem seems to be around puppet/module.rb:113 where the PSON attributes :source, :author, :version, :license, and :puppetversion are tested for values. If those values don’t exist (except for puppetversion which does not require a value) then the error is raised.

If those are required attributes, they’re not being created by puppet-module on installation. If they’re not required attributes, then the logic needs reworked."

Thanks Joe Julian. This fixes #5214 as well – so I’m closing the other duplicate.

#12 Updated by James Turnbull almost 4 years ago

The r0.3.2 of puppet-module now creates these attributes by default.

#13 Updated by James Turnbull almost 4 years ago

  • Category set to modules
  • Status changed from Accepted to In Topic Branch Pending Review
  • Affected Puppet version set to 2.6.0
  • Branch set to https://github.com/jamtur01/puppet/tree/tickets/2.6.x/4142

#14 Updated by Joe Julian almost 4 years ago

That update works for me.

#15 Updated by Paul Berry almost 4 years ago

  • Status changed from In Topic Branch Pending Review to Rejected

Now that the module tool has been updated to generate the required attributes, there’s no advantage to update Puppet to make the attributes optional.

#16 Updated by James Turnbull almost 4 years ago

  • Status changed from Rejected to Re-opened

I disagree. The PMT isn’t the only tool used to generate these. I see this as a bug until we have valid uses/constraints for the metadata.

#17 Updated by James Turnbull almost 4 years ago

  • Status changed from Re-opened to Closed

Okay – after talking to Paul and Nick I am okay with this.

#18 Updated by Garrett Honeycutt almost 4 years ago

I would think that we would still want “valid uses/constraints for the metadata”. What changed?

#19 Updated by Matt Robinson over 3 years ago

Even though this was marked as closed, it was still driving me insane since the module tool generates a metadata.json file with an empty hash for every module. This makes it a royal pain to use module repos that have checked this file in, so I’ve modified puppet not to blow up when the metadata hash is empty.

Nick reviewed the code, I verified it worked with the modules that were failing for me, and I ran the basic idea by Jeff for soundness. It’s now merged.

commit:45b3908e03734388b6c699ffbc4223f43b44a1d5

Also available in: Atom PDF