Project

General

Profile

Bug #11037

Puppet class importer crashes with ruby stack trace trying to import an environment named: new

Added by Jason Smith about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet integration
Target version:
Difficulty:
easy
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

I have Foreman 1.8.2 installed on a RHEL6 server and am using OS Puppet 3.8.1. If I have a Puppet directory environment named "new" and try to run the foreman puppet:import:puppet_classes rake task, then it crashes with the following ruby stack trace:

2015-07-07 11:42:39 [W] Failed to refresh puppet classes: Validation failed: Friendly is reserved
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:41:in `create!'
/usr/share/foreman/app/services/puppet_class_importer.rb:272:in `find_or_create_env'
/usr/share/foreman/app/services/puppet_class_importer.rb:192:in `add_classes_to_foreman'
/usr/share/foreman/app/services/puppet_class_importer.rb:59:in `block in obsolete_and_new'
/usr/share/foreman/app/services/puppet_class_importer.rb:57:in `each'
/usr/share/foreman/app/services/puppet_class_importer.rb:57:in `obsolete_and_new'
/usr/share/foreman/lib/tasks/puppet.rake:127:in `block (3 levels) in <top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in `invoke_task'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 levels) in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in `top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in `block in run'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run'
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'


Related issues

Related to Foreman - Bug #11999: Foreman Puppet Class Import for Specific Environment Failing Due to Malformed Environment Name in API QueryClosed2015-09-29
Related to Foreman - Bug #12004: API: cannot query environments by nameClosed2015-09-30

Associated revisions

Revision 8387eb79 (diff)
Added by Shlomi Zadok almost 4 years ago

fixes #11037 - Add ByIdName to environment model

Revision 8639cb1c (diff)
Added by Shlomi Zadok almost 4 years ago

fixes #11037 - Add ByIdName to environment model

(cherry picked from commit 8387eb79d86947a63b3856c5ce64936f39c2a9a0)

History

#1 Updated by Dominic Cleal about 4 years ago

  • Category set to Puppet integration
  • Difficulty set to easy

Looks like friendly_id, I guess because /new would be a valid route and shouldn't be the name of an environment.

Probably just changing Parameterizable::ByName to ByIdName in the Environment model would be sufficient.

#2 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2710 added
  • Pull request deleted ()

#3 Updated by Dominic Cleal almost 4 years ago

  • Assignee set to Shlomi Zadok
  • Legacy Backlogs Release (now unused) set to 88

#4 Updated by Shlomi Zadok almost 4 years ago

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

#5 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #11999: Foreman Puppet Class Import for Specific Environment Failing Due to Malformed Environment Name in API Query added

#6 Updated by Dominic Cleal almost 4 years ago

  • Related to Bug #12004: API: cannot query environments by name added

Also available in: Atom PDF