Bug 1131611 - After upgrading to 6.0.4 and 'katello-service restart' or upgrading the schema satellite removes foreman_admin, and foreman_api_admin are removed from satellite's database
Summary: After upgrading to 6.0.4 and 'katello-service restart' or upgrading the sche...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: 6.0.4
Hardware: All
OS: Linux
high
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2014-08-19 16:29 UTC by Aaron Thomas
Modified: 2017-02-23 21:04 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-04 13:50:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Aaron Thomas 2014-08-19 16:29:12 UTC
Description of problem:
-----------------------------------------
After upgrading to the nightly build and 'katello-service restart' or upgrading the schema satellite removes the users foreman_admin, and foreman_api_admin from the database. 


Version-Release number of selected component (if applicable):
-----------------------------------------
- 6.0.4 (http://satellite6.lab.eng.rdu2.redhat.com/devel/candidate-trees/Satellite/latest-stable-Satellite-6.0-RHEL-6/compose/Satellite/x86_64/os/)



How reproducible:
-----------------------------------------
- Highly reproducible 



Steps to Reproduce:
-----------------------------------------
 1. Upgrade satellite 6 with yum
 2. # foreman-rake db:migrate or # katello-service restart
 3. # foreman-rake db:seed



After the users foreman_admin and foreman_api_admin are removed: /var/log/foreman/production.log
-----------------------------------------
Processing by UsersController#login as HTML
  Rendered users/login.html.erb within layouts/login (1.4ms)
  Rendered layouts/base.html.erb (0.7ms)
Completed 200 OK in 4ms (Views: 2.9ms | ActiveRecord: 0.0ms)
Processing by UsersController#login as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"48OkM9b8oKQtf6H3+BkDMSs2dNtKNaqmNp3gI33E7fQ=", "login"=>{"login"=>"admin", "password"=>"[FILTERED]"}, "commit"=>"Login"}
Operation FAILED: ERF42-7495 [Foreman::Exception]: Cannot find user foreman_admin when switching context
  Rendered common/500.html.erb within layouts/application (3.0ms)
  Rendered layouts/base.html.erb (0.9ms)


WebGUI message:
-----------------------------------------
Oops, we're sorry but something went wrong

Error

ERF42-7495 [Foreman::Exception]: Cannot find user foreman_admin when switching context
If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.



Expected results:
-----------------------------------------
The users are not removed the database, satellite is upgraded, and is fully functional. 



Adding the users to satellite's database fixes the issues:
-----------------------------------------
# su - postgres 

# psql foreman

foreman=# insert into users (login, firstname, lastname, admin, created_at, updated_at) values ('foreman_admin', 'Anonymous', 'Admin', False, '2014-08-12 19:12:03.910693', '2014-08-12 19:12:03.910693');

foreman=# insert into users (login, firstname, lastname, admin, created_at, updated_at) values ('foreman_api_admin', 'API', 'Admin', False, '2014-08-12 19:12:03.910693', '2014-08-12 19:12:03.910693');

Comment 2 RHEL Program Management 2014-08-19 16:43:06 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Aaron Thomas 2014-08-19 17:17:02 UTC
Marcelo IRC:mmello also hit the same bug and assisted with providing the fix, mmello++


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