Bug #953
closedProblem with rdoc:generate
Description
Dear all.
While generating the documentation for the Puppet class browser I run into an issue.
The following command generates an error message in my case: 'RAILS_ENV=production rake puppet:rdoc:generate'
Since ohadlevy helped me with this problem I unfortunately can not reproduce the error message.
He provided me an "semi broken" patch for the puppetclass.rb (/usr/share/foreman/app/models/puppetclass.rb):
http://www.pastie.org/1996984
Thank you very much for looking into this issue.
Kind regards,
mayak
PS. I will update this issue as soon as I can reproduce the error.
Updated by Paul Kelly over 13 years ago
I have had a look at this issue and I find that there is no problem with running sh "cmd" do end. I will need the error message to know where to start.
Updated by may ak over 13 years ago
Dear Paul,
unfortunately I couldn't reproduce this issue. At the moment it works with the default and the modified 'puppetclass.rb'.
Tomorrow I am going to setup a new Foreman from scratch.
I'll let you know if the problem reoccurs. Otherwise I will close this ticket/bug.
It's quite possible that the cause of this issue is my system (e.g. puppet modules, settings.yaml...).
Thank you for taking note.
Kind regards,
mayak
Updated by Ohad Levy over 13 years ago
- Assignee changed from Ohad Levy to Paul Kelly
@paul, i think that the issue here is around a ruby specific version.
using the sh methods (or block) is restricted to rake tasks, rather then extended for Object itself.
I'm guessing that rhel/centos 5 with older version of ruby has this issue.
Updated by may ak over 13 years ago
Dear Paul,
I was finally able to "reproduce" the problem on the same server.
Well actually I am not quite sure how I managed to break my foreman again.
Since I've updated some of my Puppet Classes (more precisely the classes documentation) I run the following command:rake puppet:import:puppet_classes RAILS_ENV=production
After this I executed the following command:rake puppet:rdoc:generate RAILS_ENV=production --trace 2>&1 | less
Please follow this link to find the error message:
http://pastie.org/2031319
When I exchange the 'puppetclass.rb
' with the "semi broken" one of Ohad the following error occurred:
http://www.pastie.org/2031411
In both cases I cleaned the respective directory:/usr/share/foreman/public/puppet/rdoc/production/
Please let me know if you need more precise information.
Thank you for your efforts!
Cheers, mayak
-
System Information:
CentOS release 5.6 (Final)
foreman-0.3rc2-2
httpd-2.2.3-45.el5.centos.1
mysql-server-5.0.77-4.el5_6.6
puppet-2.6.6-1.el5
puppet-server-2.6.6-1.el5
libselinux-ruby-1.33.4-5.7.el5
ruby-1.8.5-5.el5_4.8
ruby-augeas-0.4.1-1.el5
ruby-devel-1.8.5-5.el5_4.8
ruby-docs-1.8.5-5.el5_4.8
ruby-irb-1.8.5-5.el5_4.8
ruby-libs-1.8.5-5.el5_4.8
ruby-mysql-2.7.3-1.el5
ruby-rdoc-1.8.5-5.el5_4.8
ruby-ri-1.8.5-5.el5_4.8
ruby-shadow-1.4.1-7.el5
rubygems-1.3.1-1.el5
rubygem-fastthread-1.0.7-1.el5
rubygem-json-1.4.3-3.el5.1
rubygem-mime-types-1.16-3.el5
rubygem-passenger-2.2.2-1
rubygem-rake-0.8.7-2.el5
rubygem-rest-client-1.6.1-2.el5
rubygem-sqlite3-ruby-1.2.4-1.el5
Updated by Paul Kelly over 13 years ago
Mayak,
It appears that you are using the prepare phase and this is causing the problem. The prepare phase is supposed to return the root directory of the relocated manifest tree. In your case the prepare operation is returning "". This breaks the relocation phase later in the build. Could you post your script/rdoc_prepare_script.rb file?
Updated by may ak over 13 years ago
Dear Paul,
Thank you for looking into this issue.
My script/rdoc_prepare_script.rb
is actually empty:
#!/usr/bin/ruby
When I tried to configure the Puppet class browser I followed the Foreman Wiki which says:
Most sites will not require a scripts/rdoc_prepare_script.rb file.
I am sorry if I've misunderstood the instructions and did not configure this file at all.
In the meantime I have extended my Puppet with a production and testing environment.
It seems that I should reconfigure my Foreman before importing 'puppet_classes' or generating 'rdoc'.
I received the following message when running: rake puppet:import:puppet_classes RAILS_ENV=production
Proceed with these modifications? <yes|no> yes Problems were detected during the execution phase [...] production is used by hostname.domain.tld [...] Import failed
So I will need to reconfigure my Foreman first. I will come back to you asap. Sorry.
Kind regards,
mayak
Updated by Paul Kelly over 13 years ago
On the first point
My apologies, the wiki is not clear.
If you do not need a rdoc_prepare_script.rb then it should not exist. An empty script will cause an error. Please remove this file and try again.
Please open a new ticket with the second point as otherwise we are not able to track issues properly
Updated by Paul Kelly over 13 years ago
Mayak, Is it OK to close this ticket now?
Updated by may ak over 13 years ago
- Status changed from Feedback to Closed
Dear Paul
Since you've explained how to solve this problem, I will close this ticket
Many thanks for looking in to this issue and solving it.
Kind regards,
mayak