Project

General

Profile

Actions

Bug #1556

closed

Puppet rdoc generation is broken in Foreman

Added by Eduardas Jarusevicius about 12 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Puppet integration
Target version:
Fixed in Releases:
Found in Releases:

Description

Hello,

I am using following foreman and foreman-proxy versions:

foreman: pre-0.5 (last git commit: dda8e2b951d52a5bfff13317f0b34a9a3c479574)
foreman-proxy: last git commit (aa0a791aa817b0a6a911fa3abe3341a3967dd698)

I tried to generate puppet class documentation according to http://theforeman.org/projects/foreman/wiki/Puppet_class_browser
It fails with the trace output:

** Invoke puppet:rdoc:generate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke puppet:rdoc:prepare (first_time)
** Invoke environment 
** Execute puppet:rdoc:prepare
** Execute puppet:rdoc:generate
rake aborted!
undefined method `id2name' for "testing":String
/opt/foreman/app/models/puppetclass.rb:83:in `rdoc'
/opt/foreman/app/models/puppetclass.rb:79:in `each'
/opt/foreman/app/models/puppetclass.rb:79:in `rdoc'
/opt/foreman/lib/tasks/puppet.rake:17
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/opt/foreman/vendor/ruby/1.8/gems/rake-0.9.2.2/bin/rake:33
/opt/foreman/vendor/ruby/1.8/bin/rake:19:in `load'
/opt/foreman/vendor/ruby/1.8/bin/rake:19
Tasks: TOP => puppet:rdoc:generate

I suspected that env is a simple string in puppetclass.rb on line 83, so id2name method doesn't belong there. Tried to remove it - no more complains about it and output path for puppetdoc appears to be correct. Yet generation fails with another problems:

** Invoke puppet:rdoc:generate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke puppet:rdoc:prepare (first_time)
** Invoke environment 
** Execute puppet:rdoc:prepare
** Execute puppet:rdoc:generate
*********Proccessing environment devel *************
puppetdoc --output /opt/foreman/public/puppet/rdoc/devel --modulepath xinetd::paramsxinetd::configxinetdnetwork::paramsnetwork::confignetworksudo::paramssudo::configsudouserssnmp::paramssnmp::configsnmpssh::paramsssh::configsshmunin::node::paramsmunin::node::configmunin::nodemunin::node::paramsmunin::master::configmunin::mastermuninamanda::paramsamanda::configamandantp::paramsntp::configntpbase::snmpbase::amandabase::muninbase::networkbase::sshbase::ntpbase::usersbase::sudobase -m rdoc
puppetdoc --output /opt/foreman/public/puppet/rdoc/devel --modulepath xinetd::paramsxinetd::configxinetdnetwork::paramsnetwork::confignetworksudo::paramssudo::configsudouserssnmp::paramssnmp::configsnmpssh::paramsssh::configsshmunin::node::paramsmunin::node::configmunin::nodemunin::node::paramsmunin::master::configmunin::mastermuninamanda::paramsamanda::configamandantp::paramsntp::configntpbase::snmpbase::amandabase::muninbase::networkbase::sshbase::ntpbase::usersbase::sudobase -m rdoc
RDoc::RDocError is deprecated and will be removed in RDoc 4
Could not generate documentation: uninitialized constant RDoc::RDoc::Generator
Failed to process puppetdocs for /opt/foreman/public/puppet/rdoc/devel while executing puppetdoc --output /opt/foreman/public/puppet/rdoc/devel --modulepath xinetd::paramsxinetd::configxinetdnetwork::paramsnetwork::confignetworksudo::paramssudo::configsudouserssnmp::paramssnmp::configsnmpssh::paramsssh::configsshmunin::node::paramsmunin::node::configmunin::nodemunin::node::paramsmunin::master::configmunin::mastermuninamanda::paramsamanda::configamandantp::paramsntp::configntpbase::snmpbase::amandabase::muninbase::networkbase::sshbase::ntpbase::usersbase::sudobase -m rdoc

Unitialized constant maybe is my environment problem, but are those modulepaths normal?


Related issues 5 (0 open5 closed)

Related to Foreman - Bug #11615: Puppet class index "Environment and Documentaion" links brokenClosedTomer Brisker08/30/2015Actions
Related to Foreman - Bug #1189: Example rdoc_prepare_script fails on RHEL 5Resolved09/28/2011Actions
Related to Foreman - Bug #14106: Remove puppetclass no_route pageClosedDaniel Lobato Garcia03/08/2016Actions
Is duplicate of Foreman - Bug #1405: puppet classed rdoc viewer links are brokenDuplicateOhad Levy12/19/2011Actions
Has duplicate Foreman - Bug #6666: foreman-rake puppet:rdoc:generate doesn't work with puppet 3.6Duplicate07/17/2014Actions
Actions #1

Updated by Ohad Levy almost 12 years ago

  • Status changed from New to Duplicate
Actions #2

Updated by Ohad Levy almost 12 years ago

  • Status changed from Duplicate to New
Actions #3

Updated by Ohad Levy almost 12 years ago

  • Difficulty set to easy
Actions #4

Updated by Ohad Levy almost 12 years ago

  • Target version deleted (1.0)

Yes, I can confirm this bug, it seems that when we moved the class importer to the proxy, we broke this feature.

I'm in mixed feelings of how to continue, as for 1.0, we no longer need the manifest checked out on foreman (e.g. master(s) and foreman could be on different servers), but if we generate the docs on the proxy, foreman would need to relay the request (e.g. users might need to access the proxy).

or maybe we could simply offer a script for the users to run on their masters and sync the rdoc content into foreman public/puppet directory?

Actions #5

Updated by Brian Gupta over 11 years ago

To be clear what is now broken? Could we access Puppet docs from within Foreman in the past? If so that sounds like a cool feature we would want to support, I think. Perhaps in addition to importing classes, the puppet proxy could be extended to allow "import docs"?

Actions #6

Updated by Ohad Levy over 11 years ago

Brian Gupta wrote:

To be clear what is now broken? Could we access Puppet docs from within Foreman in the past? If so that sounds like a cool feature we would want to support, I think. Perhaps in addition to importing classes, the puppet proxy could be extended to allow "import docs"?

puppetdoc generates a set of html, describing the puppet classes etc.
at the past, we generated the the html using puppetdoc (reading the manifests from the foreman server) and then put the output in public, so you could view it from foreman directly.

now that the manifest is no longer on the same host, puppetdoc would run on the proxy and then somehow you would need to reach the content.

i think the right way to solve it, is to allow the proxy to generate response (ideally in json) that is equiv to puppetdoc, and then we could always get the latest set of docs?

Actions #7

Updated by Lee Lowder over 11 years ago

Looking at the error output, and based on the errors I see when I call puppet doc directly, this also seems to be a problem with the version of the rdoc gem that is installed.

According to http://projects.puppetlabs.com/issues/11786 puppet doc does not play nicely with rdoc 2.x or 3.x, and the 1.x gems are not available via 'gem install'.

Actions #8

Updated by Lee Lowder over 11 years ago

I did some more testing on this, and installing foreman from git, and using bundler with the --path vendor option allows puppet doc to continue to work on it's own.

If you ALSO adjust <foremandir>/app/models/puppetclass.rb, line 83 to remove the .id2name as per the OP, the rake task will work.

This is because of the puppet bug mentioned in my prior comment.

Actions #9

Updated by Lee Lowder over 11 years ago

I have submitted a pull request to fix one of the problems identified with this ticket.

https://github.com/theforeman/foreman/pull/135

Actions #10

Updated by Greg Sutcliffe over 11 years ago

  • Target version set to Bug scrub
Actions #11

Updated by Greg Sutcliffe over 10 years ago

  • Target version deleted (Bug scrub)
Actions #12

Updated by Dominic Cleal over 10 years ago

  • Description updated (diff)

There aren't any immediate plans to resolve this because we've removed the Puppet dependency from core Foreman for other reasons, which makes it harder to implement. It'll need reimplementing in a different way if it's re-added.

Actions #13

Updated by Dominic Cleal over 9 years ago

  • Has duplicate Bug #6666: foreman-rake puppet:rdoc:generate doesn't work with puppet 3.6 added
Actions #14

Updated by Bryan Kearney over 9 years ago

  • Bugzilla link set to 1120698
Actions #15

Updated by Jason Antman over 9 years ago

Given the current state of `puppet doc` in general (specifically citing https://tickets.puppetlabs.com/browse/PUP-2708) I'd say this isn't a big issue... there was a discussion (on puppet-dev I think, I can't seem to find a pointer to it at the moment) that made it seem like PL knows `puppet doc` is really broken with modern versions of the language, but there's no current plan to fix it.

Actions #16

Updated by Bougacha Malik almost 9 years ago

I tried today to run the puppet doc command, which worked quite well on my setup.
I then tried to generate the doc in the correct with:

foreman-rake puppet:rdoc:generate

it crashed with the following stacktrace:


NoMethodError: undefined method `keys' for ["stdlib", stdlib]:Array
/usr/share/foreman/app/models/environment.rb:43:in `block (2 levels) in puppetEnvs'
/usr/share/foreman/app/models/environment.rb:42:in `each'
/usr/share/foreman/app/models/environment.rb:42:in `map'
/usr/share/foreman/app/models/environment.rb:42:in `block in puppetEnvs'
/usr/share/foreman/app/models/environment.rb:41:in `map'
/usr/share/foreman/app/models/environment.rb:41:in `puppetEnvs'
/usr/share/foreman/app/models/puppetclass.rb:129:in `rdoc'
/usr/share/foreman/lib/tasks/puppet.rake:17:in `block (3 levels) in <top (required)>'
Tasks: TOP => puppet:rdoc:generate
Actions #17

Updated by Ohad Levy over 8 years ago

  • Assignee deleted (Ohad Levy)
  • Difficulty deleted (easy)
Actions #18

Updated by Tomer Brisker over 8 years ago

  • Related to Bug #11615: Puppet class index "Environment and Documentaion" links broken added
Actions #19

Updated by Greg Sutcliffe about 8 years ago

  • Related to Bug #1189: Example rdoc_prepare_script fails on RHEL 5 added
Actions #20

Updated by Dominic Cleal about 8 years ago

  • Related to Bug #14106: Remove puppetclass no_route page added
Actions #21

Updated by Ohad Levy over 7 years ago

  • Bugzilla link changed from 1120698 to 1243586
Actions #22

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/4058 added
Actions #23

Updated by Anonymous over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #24

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release set to 189
Actions #25

Updated by The Foreman Bot over 7 years ago

  • Pull request https://github.com/theforeman/foreman/pull/4064 added
Actions #26

Updated by Daniel Lobato Garcia over 7 years ago

  • Target version set to 1.4.3
Actions

Also available in: Atom PDF