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');
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.
Marcelo IRC:mmello also hit the same bug and assisted with providing the fix, mmello++