Bug #2321
closed
Fail trying to create a new puppet class
Added by Joost Ringoot almost 12 years ago.
Updated over 6 years ago.
Category:
Puppet integration
|
Description
Oops, we're sorry but something went wrong
x No route matches {:action=>"edit", :controller=>"puppetclasses", :id=>#<Puppetclass id: 1, name: "Centos 6.3 desktop", created_at: "2013-03-14 14:51:24", updated_at: "2013-03-14 14:51:24">}
If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
ActionController::RoutingError
No route matches {:action=>"edit", :controller=>"puppetclasses", :id=>#<Puppetclass id: 1, name: "Centos 6.3 desktop", created_at: "2013-03-14 14:51:24", updated_at: "2013-03-14 14:51:24">}
app/helpers/application_helper.rb:110:in `link_to_if_authorized'
app/views/puppetclasses/index.html.erb:16:in `_app_views_puppetclasses_index_html_erb___2117896054_70066023223940_0'
app/views/puppetclasses/index.html.erb:14:in `_app_views_puppetclasses_index_html_erb___2117896054_70066023223940_0'
lib/foreman/thread_session.rb:31:in `clear_thread'
That log seems to imply your have a class called "Centos 6.3 desktop" - is that true?
Yes Greg, like you told me on irc, it is most likely a input parser issue: should not allow spaces in classes.
For completeness, this is what is in the puppetclasses table is
[root@geppetto ~]# sqlite3 /usr/share/foreman/db/production.sqlite3
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from puppetclasses;
1|Centos 6.3 desktop|2013-03-14 14:51:24.285593|2013-03-14 14:51:24.285593
2|Centos 6.4 desktop|2013-03-14 15:02:00.350424|2013-03-14 15:02:00.350424
sqlite>
I understand, this is most likely bad puppet coding, I am just starting with it.
I thought
This resolved it greg, like you said: removing the spaces from the class names
sqlite> UPDATE puppetclasses SET name='Centos6base' WHERE id='1';
sqlite> UPDATE puppetclasses SET name='Centos6desktop' WHERE id='2';
(It took me so long because I had to RTFM sqlite3, to know what command I needed)
- Status changed from New to Closed
Thanks for confirming. I'm going to close this, since spaces aren't supported in class names in Puppet.
- Status changed from Closed to New
- Target version set to 1.2.0
@Dominic - since they're not supported, we shouldn't allow a class to be manually created with a space in - i.e, we need to either drop manaul class creation entirely, or add validations to the class names. Right now it's possible to totally break your classes page by creating a badly named class. Re-opening.
- Assignee deleted (
Ohad Levy)
I didnt know we allow manually to create classes any more... but it does make sense to add more validation rules to the name (might slow down the slow importer as well...)
To be honest, I'm fine with removing the manual class creation - it's so limited compared to the class importer, and the class needs to exist for puppet to apply it, so you may as well import it.
afair, its removed already
I can still create classes in the UI on latest develop. We need to either drop the "New Puppetclass" button/functionality or validate the class name in the same way as puppet does.
- Target version changed from 1.2.0 to 1.3.0
- Target version changed from 1.3.0 to 1.4.0
- Target version deleted (
1.4.0)
- Has duplicate Feature #6951: remove new puppet creation option added
- Status changed from New to Ready For Testing
- Target version set to 1.7.5
- Pull request https://github.com/theforeman/foreman/pull/1655 added
For the record, a conversation on #theforeman about retaining the functionality due to poor import performance:
105713 < deu_> Dominic: many thanks for advice, importing the classes from puppet fixed the issue and created 25k records in environment_classes. now, will i be able to still add a puppetclass via gui/api that will work manually without import ? import process takes too long
105759 < Dominic> the API will probably still continue to work, but the environment list in the UI is greyed out IIRC and may be removed entirely in 1.7
110240 < deu_> Dominic: i have tested adding a bogus class, and it create record in puppetclasses, but not environment_classes did not add a record so that means a new class wont be functional. is this really intended ? it seems quite a bug to me, or i missed something ?
110340 < Dominic> maybe, but the UI isn't really intended for use (which is why it's being removed). You should be able to specify environments on the API if you want to use that, which I think should create environment_classes.
111230 < deu_> Dominic: Interesting news and thanks for clarification. We can stick with curl or hammer for adding a puppet classes (because import from puppetmaster takes too long), but GUI is still convenient for some so in my opinion should still function for such basic functionality
- Target version changed from 1.7.5 to 1.7.4
- Target version changed from 1.7.4 to 1.7.3
- Target version changed from 1.7.3 to 1.7.2
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 21
Also available in: Atom
PDF