Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1193701 - katello-installer fails with selinux enabled in Satellite 6.1.0 Beta Snap 3
katello-installer fails with selinux enabled in Satellite 6.1.0 Beta Snap 3
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: SELinux (Show other bugs)
6.1.0
Unspecified Unspecified
urgent Severity urgent (vote)
: Unspecified
: Unused
Assigned To: Lukas Zapletal
Sachin Ghai
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-17 17:35 EST by Jason Montleon
Modified: 2017-07-26 15:39 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:24:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
foreman-debug (228.13 KB, application/x-xz)
2015-02-17 17:35 EST, Jason Montleon
no flags Details
foreman debug (207.02 KB, application/x-xz)
2015-02-17 17:36 EST, Jason Montleon
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Jason Montleon 2015-02-17 17:35:04 EST
Created attachment 992929 [details]
foreman-debug

Description of problem:
foreman-rake --trace db:seed will fail with a 403 Forbidden if selinux is enabled.

Version-Release number of selected component (if applicable):
Satellite 6.1.0 Beta Snap 3

How reproducible:
Always

Steps to Reproduce:
1. Ensure selinux is in enforcing
2. Install Satellite 6.1.0 Beta Snap 3
3. Run katello-installer

Actual results:
The installer will notify you that the db:seed rake task failed

Expected results:
The installer should complete successfully.

Additional info:
It's possible this only affects RHEL 7 - during install of the pulp-selinux RPM I saw the following output as well:
  Installing : pulp-selinux-2.6.0-0.7.beta.el7sat.noarch                                                                                            379/609 
libsepol.permission_copy_callback: Module pulp-server depends on permission kill in class system, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
/usr/sbin/semodule:  Failed!
libsepol.permission_copy_callback: Module pulp-celery depends on permission kill in class system, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
/usr/sbin/semodule:  Failed!



# foreman-rake --trace db:seed
mkdir: cannot create directory '/usr/share/foreman/.cache': Permission denied
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
Apipie cache enabled but not present yet. Run apipie:cache rake task to speed up API calls.
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:abort_if_pending_migrations
Seeding /usr/share/foreman/db/seeds.d/03-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/03-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/03-roles.rb
Seeding /usr/share/foreman/db/seeds.d/04-admin.rb
rake aborted!
Task fd503b40-7d1a-4f54-89fd-e65dc861e053: RestClient::Forbidden: 403 Forbidden
/opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.12/app/models/foreman_tasks/concerns/action_triggering.rb:134:in `execute_planned_action'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.12/app/models/foreman_tasks/concerns/action_triggering.rb:111:in `block in dynflow_task_wrap'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.12/app/models/foreman_tasks/concerns/action_triggering.rb:110:in `tap'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.12/app/models/foreman_tasks/concerns/action_triggering.rb:110:in `dynflow_task_wrap'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman-tasks-0.6.12/app/models/foreman_tasks/concerns/action_triggering.rb:26:in `save'
/usr/share/foreman/db/seeds.d/04-admin.rb:26:in `block in <top (required)>'
/opt/rh/ruby193/root/usr/share/gems/gems/audited-3.0.0/lib/audited/auditor.rb:250:in `call'
/opt/rh/ruby193/root/usr/share/gems/gems/audited-3.0.0/lib/audited/auditor.rb:250:in `without_auditing'
/usr/share/foreman/db/seeds.d/04-admin.rb:21:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/usr/share/foreman/db/seeds.rb:67:in `block in <top (required)>'
/usr/share/foreman/db/seeds.rb:65:in `each'
/usr/share/foreman/db/seeds.rb:65:in `<top (required)>'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/opt/rh/ruby193/root/usr/share/gems/gems/railties-3.2.8/lib/rails/engine.rb:520:in `load_seed'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:309:in `block (2 levels) in <top (required)>'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain'
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in `invoke_task'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 levels) in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in `top_level'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in `block in run'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling'
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run'
/opt/rh/ruby193/root/usr/bin/rake:32:in `<main>'
Tasks: TOP => db:seed
Comment 1 Jason Montleon 2015-02-17 17:36:04 EST
Created attachment 992930 [details]
foreman debug
Comment 4 Brian Bouterse 2015-02-18 09:23:37 EST
I think the actual error is :

Installing : pulp-selinux-2.6.0-0.7.beta.el7sat.noarch                                                                                            379/609 
libsepol.permission_copy_callback: Module pulp-server depends on permission kill in class system, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
/usr/sbin/semodule:  Failed!
libsepol.permission_copy_callback: Module pulp-celery depends on permission kill in class system, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
/usr/sbin/semodule:  Failed!

That causes the pulp-server and pulp-celery SELinux modules contained in the pulp-selinux RPM to fail to load. Then when Pulp goes to be operated SELinux causes all sorts of denials.

There are some other bugzilla bugs that look similar.

https://bugzilla.redhat.com/show_bug.cgi?id=1149790
https://bugzilla.redhat.com/show_bug.cgi?id=1034709#c8

It looks like the recommended fix in those was to yum reinstall 'selinux-policy-targeted'. Also I think this could be a problem/difference between brew and koji builders. Those builders are where these selinux policies get compiled so something could be different there.

I don't think this is an upstream Pulp bug because on EL6 and EL7 QE has been verifying bugs with SELinux enforcing.
Comment 5 Lukas Zapletal 2015-02-20 04:09:36 EST
Hey, it is definitely not Pulp upstream bug, nobody said this. This stems from the fact we build against RHEL 7.1 while testing on RHEL 7.0.
Comment 9 Sachin Ghai 2015-03-13 07:53:51 EDT
Verified with:

sat6.1 beta snap6 compose2
Satellite-6.1.0-RHEL-6-20150311.1


Katello-installer succeed on rhel6.6 and rhel7.1 with selinux enabled.
Comment 10 Sachin Ghai 2015-03-13 08:05:01 EDT
Moving this to verified as per comment 9. Will re-open if come across same issue again.
Comment 11 Bryan Kearney 2015-08-11 09:31:01 EDT
This bug is slated to be released with Satellite 6.1.
Comment 12 errata-xmlrpc 2015-08-12 01:24:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592

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