Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 959528 - Foreman cannot save HostGroup
Summary: Foreman cannot save HostGroup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Ohad Levy
QA Contact: Og Maciel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-03 17:27 UTC by Jordan OMara
Modified: 2019-09-26 15:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-18 21:23:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Pry debug output, apipie (11.35 KB, application/octet-stream)
2013-05-03 22:55 UTC, Jordan OMara
no flags Details

Description Jordan OMara 2013-05-03 17:27:46 UTC
Steps to reproduce:

1. Install Foreman 1.2 Nightly on RHEL6 (Sat6/Katello not required)
2. Attempt to save hostgroup
3. See "Stack Level Too Deep" exception on saving hostgroup
4. Bug is impervious to server change (webrick or passenger), db changes (sqlite or postgres) and rails upgrades (3.2.8 -> 3.2.12)
5. Bug is NOT reproducable on a gem install, ie outside of SCL

gemset:
[root@balon ~]# scl enable ruby193 "gem list"

*** LOCAL GEMS ***
actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
ancestry (1.3.0)
apipie-rails (0.0.18)
arel (3.0.2)
audited (3.0.0)
audited-activerecord (3.0.0)
bigdecimal (1.1.0)
builder (3.0.0)
bundler (1.1.4)
bundler_ext (0.3.0)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
daemons (1.1.4)
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.4.0)
fast_gettext (0.5.10)
file-tail (1.0.5)
gettext_i18n_rails (0.2.13)
hike (1.2.1)
i18n (0.6.0)
i18n_data (0.2.7)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.0.2)
jquery-ui-rails (4.0.2)
json (1.5.4)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
net-http-persistent (2.7)
net-ldap (0.2.2)
oauth (0.4.7)
passenger (3.0.17)
pg (0.12.2)
polyglot (0.3.3)
rabl (0.7.6)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
ref (1.0.0)
rest-client (1.6.1)
ruby2ruby (2.0.1)
ruby_parser (3.1.1)
safemode (1.2.0)
sass (3.1.20)
sass-rails (3.2.5)
scoped_search (2.5.1)
sexp_processor (4.1.3)
sprockets (2.4.5)
spruz (0.2.5)
sqlite3 (1.3.6)
therubyracer (0.11.0beta5)
thin (1.3.1)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
twitter-bootstrap-rails (2.2.6)
tzinfo (0.3.33)
uglifier (1.2.6)
uuidtools (2.1.3)
will_paginate (3.0.2)

stack:
   #0 [block]   rescue in rollback_active_record_state! <ActiveRecord::Transactions#rollback_active_recor
   #1 [method]  save <ActiveRecord::Transactions#save(*arg1)>
   #2 [method]  insert_record <ActiveRecord::Associations::HasManyAssociation#insert_record(record, valid
   #3 [block]   block (2 levels) in create_record <ActiveRecord::Associations::CollectionAssociation#crea
   #4 [method]  add_to_target <ActiveRecord::Associations::CollectionAssociation#add_to_target(record)>
   #5 [block]   block in create_record <ActiveRecord::Associations::CollectionAssociation#create_record(a
   #6 [block]   block in transaction <ActiveRecord::Associations::CollectionAssociation#transaction(*args
   #7 [method]  transaction <ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction(options=?)>
   #8 [method]  transaction <ActiveRecord::Transactions::ClassMethods#transaction(options=?, &block)>
   #9 [method]  transaction <ActiveRecord::Associations::CollectionAssociation#transaction(*args)>
   #10 [method]  create_record <ActiveRecord::Associations::CollectionAssociation#create_record(attribute
   #11 [method]  create <ActiveRecord::Associations::CollectionAssociation#create(attributes=?, options=?
   #12 [method]  create <Array#inspect()>
   #13 [block]   block in write_audit <Audited::Auditor::AuditedInstanceMethods#write_audit(attrs)>
   #14 [method]  _run__1810368630087873722__audit__709258232627691241__callbacks <Hostgroup#_run__1810368
   #15 [method]  __run_callback <ActiveSupport::Callbacks::ClassMethods#__run_callback(key, kind, object,
   #16 [method]  _run_audit_callbacks <Hostgroup#_run_audit_callbacks(key=?, &blk)>
   #17 [method]  run_callbacks <ActiveSupport::Callbacks#run_callbacks(kind, *args, &block)>
   #18 [method]  write_audit <Audited::Auditor::AuditedInstanceMethods#write_audit(attrs)>
   #19 [method]  audit_create <Audited::Auditor::AuditedInstanceMethods#audit_create()>
   #20 [method]  _run__1810368630087873722__create__709258232627691241__callbacks <Hostgroup#_run__181036
   #21 [method]  __run_callback <ActiveSupport::Callbacks::ClassMethods#__run_callback(key, kind, object,
   #22 [method]  _run_create_callbacks <ActiveRecord::Base#_run_create_callbacks(key=?, &blk)>
   #23 [method]  run_callbacks <ActiveSupport::Callbacks#run_callbacks(kind, *args, &block)>
   #24 [method]  create <ActiveRecord::Callbacks#create()>
   #25 [method]  create_or_update <ActiveRecord::Persistence#create_or_update()>
   #26 [block]   block in create_or_update <ActiveRecord::Callbacks#create_or_update()>
   #27 [method]  _run__1810368630087873722__save__709258232627691241__callbacks <Hostgroup#_run__18103686
   #28 [method]  __run_callback <ActiveSupport::Callbacks::ClassMethods#__run_callback(key, kind, object,
   #29 [method]  _run_save_callbacks <ActiveRecord::Base#_run_save_callbacks(key=?, &blk)>
   #30 [method]  run_callbacks <ActiveSupport::Callbacks#run_callbacks(kind, *args, &block)>
   #31 [method]  create_or_update <ActiveRecord::Callbacks#create_or_update()>
   #32 [method]  save <ActiveRecord::Persistence#save(*arg1)>
   #33 [method]  save <ActiveRecord::Validations#save(options=?)>
   #34 [method]  save <ActiveRecord::AttributeMethods::Dirty#save(*arg1)>
   #35 [block]   block (2 levels) in save <ActiveRecord::Transactions#save(*arg1)>
   #36 [block]   block in with_transaction_returning_status <ActiveRecord::Transactions#with_transaction_
   #37 [method]  transaction <ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction(options=?)
   #38 [method]  transaction <ActiveRecord::Transactions::ClassMethods#transaction(options=?, &block)>
   #39 [method]  with_transaction_returning_status <ActiveRecord::Transactions#with_transaction_returning
   #40 [block]   block in save <ActiveRecord::Transactions#save(*arg1)>
   #41 [method]  rollback_active_record_state! <ActiveRecord::Transactions#rollback_active_record_state!(
   #42 [method]  save <ActiveRecord::Transactions#save(*arg1)>
=> #43 [method]  create <HostgroupsController#create()>

Comment 1 Jordan OMara 2013-05-03 17:39:40 UTC
A little more information about the call:

[61] pry(#<ActiveRecord::Associations::HasManyAssociation>)> down

Frame number: 1/140
Frame type: method

From: /opt/rh/ruby193/root/usr/local/share/gems/gems/activerecord-3.2.13/lib/active_record/transactions.rb @ line 258 ActiveRecord::Transactions#save:

    257: def save(*) #:nodoc:
 => 258:   rollback_active_record_state! do
    259:     with_transaction_returning_status { super }
    260:   end
    261: end

[62] pry(#<Audited::Adapters::ActiveRecord::Audit>)> self
=> #<Audited::Adapters::ActiveRecord::Audit id: nil, auditable_id: 1, auditable_type: "Hostgroup", user_id: nil, user_type: nil, username: "Admin User", action: "create", audited_changes: {"name"=>"asdf2", "environment_id"=>1, "operatingsystem_id"=>nil, "architecture_id"=>nil, "medium_id"=>nil, "ptable_id"=>nil, "root_pass"=>nil, "puppet_ca_proxy_id"=>nil, "use_image"=>nil, "image_file"=>nil, "ancestry"=>nil, "vm_defaults"=>nil, "subnet_id"=>nil, "domain_id"=>nil, "puppet_proxy_id"=>nil, "label"=>nil}, version: 0, comment: nil, associated_id: nil, associated_type: nil, created_at: nil, remote_address: nil, auditable_name: nil, associated_name: nil>

Comment 2 Jordan OMara 2013-05-03 20:18:12 UTC
Removing 'audited' calls in hostgroup & hostgroup_class allows me to save Hostgroup records from rails console, but will not allow me to view them in the UI.

Comment 3 Jordan OMara 2013-05-03 22:55:33 UTC
Created attachment 743397 [details]
Pry debug output, apipie

Did more diving today and I think the next step might be related to ApiPie - see attached log

Comment 4 Ohad Levy 2013-05-06 06:04:54 UTC
fixed upstream at http://projects.theforeman.org/issues/2455

for running installations, it might be required to execute:

RAILS_ENV=production rake db:migrate:redo VERSION=20130409081924

Comment 5 Sam Kottler 2013-05-23 23:40:51 UTC
Moving to ON_QA for drop 2.

Comment 6 Og Maciel 2013-05-28 21:34:02 UTC
Verified:
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.8.9-1.el6_4.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.8.9-1.el6_4.noarch
* candlepin-tomcat6-0.8.9-1.el6_4.noarch
* elasticsearch-0.19.9-8.el6sat.noarch
* foreman-1.1.10002-40.noarch
* foreman-installer-puppet-concat-0-2.d776701.el6sat.noarch
* foreman-installer-puppet-dhcp-0-5.3a4a13c.el6sat.noarch
* foreman-installer-puppet-dns-0-7.fcae203.el6sat.noarch
* foreman-installer-puppet-foreman-0-6.568c5c4.el6sat.noarch
* foreman-installer-puppet-foreman_proxy-0-8.bd1e35d.el6sat.noarch
* foreman-installer-puppet-puppet-0-3.ab46748.el6sat.noarch
* foreman-installer-puppet-tftp-0-5.ea6c5e5.el6sat.noarch
* foreman-installer-puppet-xinetd-0-50a267b8.git.0.44aca6a.el6sat.noarch
* foreman-postgresql-1.1.10002-40.noarch
* foreman-proxy-1.1.10001-1.el6sat.noarch
* foreman-proxy-installer-1.0.1-7.f5ae2cd.el6sat.noarch
* katello-1.4.2-7.el6sat.noarch
* katello-all-1.4.2-7.el6sat.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-2.el6sat.noarch
* katello-cli-1.4.2-6.el6sat.noarch
* katello-cli-common-1.4.2-6.el6sat.noarch
* katello-common-1.4.2-7.el6sat.noarch
* katello-configure-1.4.3-10.el6sat.noarch
* katello-configure-foreman-1.4.3-10.el6sat.noarch
* katello-foreman-all-1.4.2-7.el6sat.noarch
* katello-glue-candlepin-1.4.2-7.el6sat.noarch
* katello-glue-elasticsearch-1.4.2-7.el6sat.noarch
* katello-glue-pulp-1.4.2-7.el6sat.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.4.3-3.el6sat.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-rpm-plugins-2.1.1-1.el6sat.noarch
* pulp-selinux-2.1.1-1.el6sat.noarch
* pulp-server-2.1.1-1.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.1.7-3.el6sat.noarch
* ruby193-rubygem-net-ldap-0.2.2-7.el6_4.noarch
* signo-0.0.12-1.el6sat.noarch
* signo-katello-0.0.12-1.el6sat.noarch

Comment 7 Mike McCune 2013-07-18 21:23:15 UTC
mass move to CLOSED:CURRENTRELEASE since MDP1 has been released.


Note You need to log in before you can comment on or make changes to this bug.