Bug 1103321
Summary: | Second Host Group creation fails with no UI notification and "Failed to save: Name has already been taken" in back-end | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Erik M Jacobs <ejacobs> |
Component: | WebUI | Assignee: | jmagen <jmagen> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Kedar Bidarkar <kbidarka> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.0.3 | CC: | cwelton, dcleal, jmagen, jmontleo, jsherril, kbidarka, mmccune, omaciel |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/5129 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-07-02 14:07:37 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Erik M Jacobs
2014-05-30 18:03:41 UTC
Actually, I just tested this with a different name, and got the same error: Parameters: {"utf8"=>"✓", "authenticity_token"=>"JmqrITggh5fKTK25c0uJTWHsdjeDL24FR0T5InxcnKU=", "hostgr oup"=>{"parent_id"=>"1", "name"=>"LAMP Wordpress", "environment_id"=>"6", "puppet_ca_proxy_id"=>"", "pupp et_proxy_id"=>"", "puppetclass_ids"=>["", "36"], "domain_id"=>"1", "subnet_id"=>"1", "realm_id"=>"", "arc hitecture_id"=>"1", "operatingsystem_id"=>"1", "medium_id"=>"11", "ptable_id"=>"7", "root_pass"=>"[FILTER ED]", "group_parameters_attributes"=>{"1401473078862"=>{"name"=>"kt_activation_keys", "value"=>"[FILTERED ]", "_destroy"=>"kt_activation_keys", "nested"=>""}, "1401473078878"=>{"name"=>"kt_org", "value"=>"[FILTE RED]", "_destroy"=>"kt_org", "nested"=>""}, "1401473078889"=>{"name"=>"kt_env", "value"=>"[FILTERED]", "_ destroy"=>"kt_env", "nested"=>""}, "1401473078902"=>{"name"=>"kt_cv", "value"=>"[FILTERED]", "_destroy"=> "kt_cv", "nested"=>""}}, "location_ids"=>["2", ""], "organization_ids"=>["1", ""]}, "kt_environment_id"=> "ACME_Corporation/Development", "kt_activation_keys"=>"SA2-SOE,Wordpress", "commit"=>"Submit"} Failed to save: Name has already been taken Rendered puppetclasses/_selectedClasses.html.erb (1.3ms) Rendered puppetclasses/_classes_in_groups.html.erb (0.0ms) Rendered puppetclasses/_classes.html.erb (179.4ms) Rendered puppetclasses/_class_selection.html.erb (277.5ms) Rendered common/_domain.html.erb (10.5ms) Rendered common/_domain_subnet.html.erb (17.8ms) Rendered common/os_selection/_architecture.html.erb (3.9ms) Rendered common/os_selection/_operatingsystem.html.erb (19.9ms) Rendered common/os_selection/_initial.html.erb (26.8ms) Rendered puppetclasses/_class_parameters.html.erb (29.6ms) Rendered puppetclasses/_classes_parameters.html.erb (42.5ms) Rendered common_parameters/_puppetclass_parameter.html.erb (1.6ms) Rendered common_parameters/_puppetclasses_parameters.html.erb (2.6ms) Rendered common_parameters/_parameter.html.erb (1.5ms) Rendered common_parameters/_parameter.html.erb (1.2ms) Rendered common_parameters/_parameter.html.erb (1.0ms) Rendered common_parameters/_parameter.html.erb (1.0ms) Rendered common_parameters/_parameter.html.erb (0.9ms) Rendered common_parameters/_parameters.html.erb (8.7ms) Rendered taxonomies/_loc_org_tabs.html.erb (7.1ms) Rendered hostgroups/_form.html.erb (592.0ms) Rendered hostgroups/new.html.erb within layouts/application (592.4ms) Rendered home/_submenu.html.erb (4.0ms) Rendered home/_user_dropdown.html.erb (1.2ms) Read fragment views/tabs_and_title_records-1 (0.1ms) Rendered home/_topbar.html.erb (160.9ms) Rendered layouts/base.html.erb (161.9ms) Completed 200 OK in 806ms (Views: 740.2ms | ActiveRecord: 21.0ms) Processing by Katello::Api::V2::ActivationKeysController#index as */* Parameters: {"content_view_id"=>"4", "api_version"=>"v2", "environment_id"=>"2"} Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/activation_key s/index.json.rabl within katello/api/v2/layouts/collection (212.5ms) Completed 200 OK in 231ms (Views: 210.7ms | ActiveRecord: 4.1ms) I did some more digging, and it appears that *any* host group creation will fail now. Processing by HostgroupsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"JmqrITggh5fKTK25c0uJTWHsdjeDL24FR0T5InxcnKU=", "hostgroup"=>{"parent_id"=>"", "name"=>"abcdef", "environment_id"=>"2", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "domain_id"=>"", "realm_id"=>"", "architecture_id"=>"", "root_pass"=>"[FILTERED]", "group_parameters_attributes"=>{"1401473354349"=>{"name"=>"kt_org", "value"=>"[FILTERED]", "_destroy"=>"kt_org", "nested"=>""}, "1401473354354"=>{"name"=>"kt_env", "value"=>"[FILTERED]", "_destroy"=>"kt_env", "nested"=>""}, "1401473354358"=>{"name"=>"kt_cv", "value"=>"[FILTERED]", "_destroy"=>"kt_cv", "nested"=>""}}, "location_ids"=>["", "2"], "organization_ids"=>["", "1"]}, "kt_environment_id"=>"ACME_Corporation/Library", "kt_activation_keys"=>"", "commit"=>"Submit"} Failed to save: Name has already been taken Rendered puppetclasses/_selectedClasses.html.erb (0.0ms) Rendered puppetclasses/_classes_in_groups.html.erb (0.0ms) Rendered puppetclasses/_classes.html.erb (8.1ms) Rendered puppetclasses/_class_selection.html.erb (31.2ms) Rendered common/_domain.html.erb (1.8ms) Rendered common/_domain_subnet.html.erb (6.2ms) Rendered common/os_selection/_architecture.html.erb (1.4ms) Rendered common/os_selection/_operatingsystem.html.erb (3.5ms) Rendered common/os_selection/_initial.html.erb (7.2ms) Rendered puppetclasses/_class_parameters.html.erb (0.0ms) Rendered puppetclasses/_classes_parameters.html.erb (9.8ms) Rendered common_parameters/_puppetclass_parameter.html.erb (2.3ms) Rendered common_parameters/_puppetclasses_parameters.html.erb (4.2ms) Rendered common_parameters/_parameter.html.erb (2.8ms) Rendered common_parameters/_parameter.html.erb (1.4ms) Rendered common_parameters/_parameter.html.erb (1.4ms) Rendered common_parameters/_parameter.html.erb (1.1ms) Rendered common_parameters/_parameters.html.erb (10.8ms) Rendered taxonomies/_loc_org_tabs.html.erb (169.5ms) Rendered hostgroups/_form.html.erb (275.9ms) Rendered hostgroups/new.html.erb within layouts/application (276.2ms) Rendered home/_submenu.html.erb (3.0ms) Rendered home/_user_dropdown.html.erb (1.0ms) Read fragment views/tabs_and_title_records-1 (0.1ms) Rendered home/_topbar.html.erb (5.1ms) Rendered layouts/base.html.erb (6.1ms) Completed 200 OK in 316ms (Views: 276.7ms | ActiveRecord: 11.0ms) Processing by Katello::Api::V2::ActivationKeysController#index as */* Parameters: {"content_view_id"=>"2", "api_version"=>"v2", "environment_id"=>"1"} Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/activation_keys/index.json.rabl within katello/api/v2/layouts/collection (2.1ms) Completed 200 OK in 18ms (Views: 3.1ms | ActiveRecord: 1.0ms) Original downstream issue http://projects.theforeman.org/issues/5129 There was a short term patch proposed here: https://github.com/theforeman/foreman/pull/1366 is this still open. I could not duplicate with Rails 3.2.8 Joseph, I was just able to reproduce in development on rails 3.2.8. Easiest way to reproduce: From a fresh database: 1. Create a host group with name 'test1' and paramter 'foo', value 'bar' 2. Create a 2nd host group with name 'test'2 and parameter 'foo', value 'bar2' 2 will fail. The parameters must be set from the creation screens, (not aftewards). I'm not sure if any of this matters, but: * Was using postgresql (not sqlite) * Orgs were enabled * locations were enabled * An org and 'any location' was selected I also saw this error this last Friday, May 30th, but I already had 2 HGs using different content views, activation keys, etc. When I tried to create a third one using the same information as one of the existing HGs... that's when I started seeing this BZ Was able to reproduce again with just foreman. Will upload a youtube video of reproducing. ok, I haven't been able to reproduce with just foreman. Running into problems with katello though .. showing reproduction: https://www.youtube.com/watch?v=6HKsIj_jDNc#t=231 still no success in reproducing this bug. I can't see what Justin is doing differently on the youtube demo Moving to POST since upstream bug http://projects.theforeman.org/issues/5129 has been closed Steps to reproduce Important Notes:- 1)To reproduce this issue, takeup a newly installed setup and make sure **No previous Host Group" was ever deleted on the setup. 2)While trying on a setup where a "host Group" has been deleted this fails to reproduce. 1) Create a "Host group" with any name any value and save. 2) Create another "Host group" with any name and any value. 3) Host group creation fails. 4) Now, without canceling move to "Parameters Tab" for which the Host group creation failed to notice the "Name has been taken" message. 5) I think the above 4) point could be the clue, to figuring out the exact issue. Workaround which works for me is: 1) Create a "Host group" 2) creating second "Host group" fails 3) Delete the 1) "Host group" 4) Now we don't face this issue upon creating the second "Host Group" But not sure whether this workaround would have any side effects, but looks to be working for me, for now in creating multiple "host groups" Kedar, are you sure that you have you are own a system with commit 691f0a1 I am not aware whether the commit exists, but I am sure that I am using SNAP10, which is said to contain the fix. Can you please send me the foreman server log file or set up a reproducer system where I can debug it. I checked out on gitlab branch SATELLITE-6.0.3 and don't see the changes to parameter.rb - after_initialize :set_priority + after_initialize :set_priority, :ensure_reference_nil + + # hack fix for Rails 3.2.8. Not needed for 3.2.18. + def ensure_reference_nil + self.reference_id = nil if self.new_record? && self.reference_id == 1 + end + verified with SNAP11 Now while creating 2nd Host group we no longer face this issue. This was delivered with 6.0.3, which is the Satellite 6 Beta. |