Created attachment 1299747 [details] log in production.log file Description of problem: We were trying to update the puppet environment in particular organization. But when we attempt to update environment which is not associated with organization, it redirects to error page and shows error as "something went wrong Validation failed: Name has already been taken" and /var/log/foreman/production.log shows "500 Internal Server Error" Version-Release number of selected component (if applicable): sat 6.3 snap 7.0 How reproducible: always Steps to Reproduce: 1. Create an organization 2. Navigate to Configure -> Environments 3. Click on import environment 4. Try to update environment which is not associated with particular organization Actual results: It will redirect to error page showing "something went wrong Validation failed: Name has already been taken" and produces "500 Internal Server Error" in log file. Expected results: Error should be handled without navigating to error page and without 500 internal server error. Additional info:
Created attachment 1299748 [details] screenshot of UI
Thanks for the report, please don't use WebUI component unless the subject is related to it (e.g. font size to small, WebUI unaccessible etc). Moving to puppet component. I suppose we should handle errors more gracefully or maybe even not allowing to display envs that are out of scope for current user.
Created redmine issue http://projects.theforeman.org/issues/20340 from this bug
*** Bug 1522974 has been marked as a duplicate of this bug. ***
Hi, I know this was easily reproducible on 6.3, but I do not see the errors any more. It may have been fixed as part of bz 1246865, which was dealing with Puppet imports and Organization scoping. The errors are gone, but environments have to be assigned in current Organization for any changes to take effect. Could QE verify, if the errors are still present?
VERIFIED Version tested: Satellite 6.3 snap 33 Steps: 1. Created an organization 2. Navigated to Configure -> Environments 3. Clicked on import environment 4. Tried to update environment which is not associated with created organization Displayed success message as "Successfully updated environments and Puppet classes from the on-disk Puppet installation" but didn't display environment as org was not assigned to it. 2018-01-24 07:09:19 4698e5ca [app] [I] Started POST "/environments/obsolete_and_new" for IP at 2018-01-24 07:09:19 -0500 2018-01-24 07:09:19 4698e5ca [app] [I] Processing by EnvironmentsController#obsolete_and_new as HTML 2018-01-24 07:09:19 4698e5ca [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"eX04bwPLBu/OHlAGg6gl4WjlXWczF/mjhmVMQygG2yRNadk25hetSmocS Jt9hv1SJJ9qjb7CxiUWP2h26c/udQ==", "changed"=>{"new"=>{"production"=>"{\"stdlib\":{\"new\":{}},\"stdlib::stages\":{\"new\":{}},\"foreman_scap_client \":{\"new\":{\"server\":null,\"port\":null,\"policies\":null,\"ensure\":\"present\",\"ca_file\":\"${$::foreman_scap_client::params::ca_file}\",\"ho st_certificate\":\"${$::foreman_scap_client::params::host_certificate}\",\"host_private_key\":\"${$::foreman_scap_client::params::host_private_key} \",\"foreman_repo_rel\":\"\",\"foreman_repo_key\":\"https://yum.theforeman.org/RPM-GPG-KEY-foreman\",\"foreman_repo_src\":\"\",\"foreman_repo_gpg_c hk\":false}},\"foreman_scap_client::params\":{\"new\":{}},\"access_insights_client\":{\"new\":{\"log_level\":\"\",\"auto_config\":\"True\",\"authme thod\":\"\",\"username\":\"\",\"password\":\"\",\"base_url\":\"\",\"proxy\":\"\",\"cert_verify\":\"\",\"gpg\":\"\",\"auto_update\":\"\",\"obfuscate \":\"\",\"obfuscate_hostname\":\"\",\"upload_schedule\":\"\"}}}"}}, "commit"=>"Update"} 2018-01-24 07:09:19 4698e5ca [app] [I] Current user: admin (administrator) 2018-01-24 07:09:19 4698e5ca [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms) 2018-01-24 07:09:19 4698e5ca [app] [I] Redirected to https://sgi-uv20-01.rhts.eng.bos.redhat.com/environments 2018-01-24 07:09:19 4698e5ca [app] [I] Completed 302 Found in 103ms (ActiveRecord: 16.1ms) 2018-01-24 07:09:19 39234ecf [app] [I] Started GET "/environments" for 10.65.223.187 at 2018-01-24 07:09:19 -0500 2018-01-24 07:09:19 39234ecf [app] [I] Processing by EnvironmentsController#index as HTML 2018-01-24 07:09:19 39234ecf [app] [I] Current user: admin (administrator) 2018-01-24 07:09:19 39234ecf [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered environments/index.html.erb within layouts/application (34.8ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered common/_searchbar.html.erb (3.1ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered layouts/_application_content.html.erb (3.7ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (1.4ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_user_dropdown.html.erb (4.0ms) 2018-01-24 07:09:19 39234ecf [app] [I] Read fragment views/tabs_and_title_records-3 (0.1ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_organization_dropdown.html.erb (4.9ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_location_dropdown.html.erb (4.7ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_org_switcher.html.erb (10.2ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (4.2ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (14.9ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (1.3ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (5.8ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (3.1ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (2.7ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (1.9ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_submenu.html.erb (3.7ms) 2018-01-24 07:09:19 39234ecf [app] [I] Write fragment views/tabs_and_title_records-3 (1.3ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered home/_topbar.html.erb (60.4ms) 2018-01-24 07:09:19 39234ecf [app] [I] Rendered layouts/base.html.erb (63.0ms) 2018-01-24 07:09:19 39234ecf [app] [I] Completed 200 OK in 127ms (Views: 99.3ms | ActiveRecord: 7.2ms) 2018-01-24 07:09:20 [app] [I] Current user: foreman_admin (administrator) 2018-01-24 07:09:20 [app] [I] Current user: foreman_admin (administrator) 2018-01-24 07:09:20 [app] [I] Current user: foreman_admin (administrator) 2018-01-24 07:09:20 219831e9 [app] [I] Started GET "/notification_recipients" for IP at 2018-01-24 07:09:20 -0500 2018-01-24 07:09:20 219831e9 [app] [I] Processing by NotificationRecipientsController#index as JSON 2018-01-24 07:09:20 219831e9 [app] [I] Current user: admin (administrator) 2018-01-24 07:09:20 219831e9 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.5ms) 2018-01-24 07:09:20 219831e9 [app] [I] Completed 200 OK in 11ms (Views: 0.2ms | ActiveRecord: 1.0ms)
Per Commetn 7, this went out in 6.3.