Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1496143

Summary: Sync page returns ISE / missing SELinux rules for spacewalk_log_t
Product: [Community] Spacewalk Reporter: Michal Middleton <jafa81>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.7CC: jdostal, john.paul, tigalch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-20 12:31:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1564160    

Description Michal Middleton 2017-09-26 14:35:42 UTC
Description of problem:
Accessing Repositories / Sync page returns Internal Server Error

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Install Spacewalk 2.7 on CentOS 7.4
2. Add a repo
3. Add a channel, link with existing repo
4. Go to Sync page (https://alnqa1swlk01.gdsxqa.int/rhn/channels/manage/Sync.do?cid=<repoid>) (page still works ok at this time)
5. Request a one time repo sync
6. Wait a few seconds for the sync to begin refresh. You will get ISE


Actual results:
Web server returns ISE

Expected results:
Get sync status

Additional info:
Found this message in Tomcat log (/var/log/tomcat/localhost.2017-09-26.log): 
Sep 26, 2017 2:27:05 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [action] in context with path [/rhn] threw exception [java.lang.RuntimeException: File not found: /var/log/rhn/reposync/test-channel1.log] with root cause
java.lang.RuntimeException: File not found: /var/log/rhn/reposync/test-channel1.log

I traced this problem to a missing SELinux rules. Here is a TE that solved this issue:

---cut---
module spacewalk-fix 1.3;

require {
	type tomcat_t;
	type spacewalk_log_t;
	class dir { getattr search };
	class file { getattr open read };
}

#============= tomcat_t ==============
allow tomcat_t spacewalk_log_t:dir { getattr search };
allow tomcat_t spacewalk_log_t:file { getattr open read };
---cut---

Comment 1 Jan Dobes 2017-10-27 12:31:25 UTC
*** Bug 1497050 has been marked as a duplicate of this bug. ***

Comment 2 John Paul 2017-12-21 08:16:18 UTC
Hi, 
I've a similar comportment.
I used "spacewalk-repo-sync -c <myrepo>" from command line to check if myrepo can be synchronized or not. In my case, it worked well but once I clicked on Sync to schedule the synchronisation, I got "Internal Server Error".

For now, I disable SElinux with setenforce O.

Comment 3 John Paul 2017-12-21 08:26:55 UTC
Thanks Michal for the fix, it works for me too.

Comment 4 Jiří Dostál 2018-03-26 14:10:11 UTC
Should be resolved by https://github.com/spacewalkproject/spacewalk/pull/631

Comment 5 Jiří Dostál 2018-04-20 12:31:39 UTC
Spacewalk 2.8 has been released.
https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes28