Project

General

Profile

Actions

Bug #2321

closed

Fail trying to create a new puppet class

Added by Joost Ringoot almost 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Puppet integration
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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'


Related issues 1 (0 open1 closed)

Has duplicate Foreman - Feature #6951: remove new puppet creation optionDuplicateOhad Levy08/06/2014Actions
Actions #1

Updated by Joost Ringoot almost 12 years ago

I can not even see if there are still other classes (I think not) and I can't retry.
I always get the above error on this:
https://geppetto.oma.be/puppetclasses

Actions #2

Updated by Greg Sutcliffe almost 12 years ago

That log seems to imply your have a class called "Centos 6.3 desktop" - is that true?

Actions #3

Updated by Joost Ringoot almost 12 years ago

yes "Centos 6.3 desktop"

Actions #4

Updated by Joost Ringoot almost 12 years ago

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

Actions #5

Updated by Joost Ringoot almost 12 years ago

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)

Actions #6

Updated by Dominic Cleal almost 12 years ago

  • 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.

Actions #7

Updated by Greg Sutcliffe over 11 years ago

  • 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.

Actions #8

Updated by Ohad Levy over 11 years ago

  • 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...)

Actions #9

Updated by Greg Sutcliffe over 11 years ago

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.

Actions #10

Updated by Ohad Levy over 11 years ago

afair, its removed already

Actions #11

Updated by Greg Sutcliffe over 11 years ago

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.

Actions #12

Updated by Dominic Cleal over 11 years ago

  • Target version changed from 1.2.0 to 1.3.0
Actions #13

Updated by Lukas Zapletal over 11 years ago

  • Target version changed from 1.3.0 to 1.4.0
Actions #14

Updated by Greg Sutcliffe about 11 years ago

  • Target version deleted (1.4.0)
Actions #15

Updated by Dominic Cleal over 10 years ago

  • Has duplicate Feature #6951: remove new puppet creation option added
Actions #16

Updated by The Foreman Bot over 10 years ago

  • 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
Actions #17

Updated by Dominic Cleal over 10 years ago

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

Actions #18

Updated by Anonymous over 10 years ago

  • Target version changed from 1.7.5 to 1.7.4
Actions #19

Updated by Anonymous over 10 years ago

  • Target version changed from 1.7.4 to 1.7.3
Actions #20

Updated by Dominic Cleal about 10 years ago

  • Target version changed from 1.7.3 to 1.7.2
Actions #21

Updated by Ohad Levy about 10 years ago

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

Updated by Daniel Lobato Garcia about 10 years ago

  • Translation missing: en.field_release set to 21
Actions

Also available in: Atom PDF