Bug 1471702 - Updating puppet environment which is not associated with organization creates internal server error
Summary: Updating puppet environment which is not associated with organization creates...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Nikhil Kathole
URL:
Whiteboard:
: 1522974 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-17 09:32 UTC by Nikhil Kathole
Modified: 2019-04-01 20:27 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-30 14:04:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log in production.log file (16.76 KB, text/plain)
2017-07-17 09:32 UTC, Nikhil Kathole
no flags Details
screenshot of UI (22.33 KB, image/png)
2017-07-17 09:33 UTC, Nikhil Kathole
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20340 0 Normal Resolved Updating puppet environment which is not associated with organization creates internal server error 2020-07-21 15:33:41 UTC

Description Nikhil Kathole 2017-07-17 09:32:31 UTC
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:

Comment 1 Nikhil Kathole 2017-07-17 09:33:27 UTC
Created attachment 1299748 [details]
screenshot of UI

Comment 2 Marek Hulan 2017-07-17 10:06:59 UTC
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.

Comment 4 Marek Hulan 2017-07-19 08:27:46 UTC
Created redmine issue http://projects.theforeman.org/issues/20340 from this bug

Comment 5 Ondřej Pražák 2018-01-24 11:20:53 UTC
*** Bug 1522974 has been marked as a duplicate of this bug. ***

Comment 6 Ondřej Pražák 2018-01-24 11:45:31 UTC
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?

Comment 7 Nikhil Kathole 2018-01-24 12:10:45 UTC
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)

Comment 8 Bryan Kearney 2018-04-30 14:04:18 UTC
Per Commetn 7, this went out in 6.3.


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