Bug 1247039

Summary: Creating selinux-policy manpages is broken
Product: [Fedora] Fedora Reporter: Lukas Vrabec <lvrabec>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, mgrepl, msrb, plautrba
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.4-12.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-04 19:45:22 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: 815137, 1076441    

Description Lukas Vrabec 2015-07-27 08:13:49 UTC
Description of problem:
Creating selinux-policy manpages is broken. 

Version-Release number of selected component (if applicable):
policycoreutils-2.4-5.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
1. sepolicy manpage -a


Actual results:
Cannot create manpages during selinux-policy package build process

Expected results:
Can create manpages using sepolicy generate

Additional info:
[root@rawhide selinux-policy]# sepolicy manpage -a
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 644, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 320, in manpage
    m = ManPage(domain, path, args.root,args.source_files, args.web)
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 389, in __init__
    self._gen_bools()
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 417, in _gen_bools
    domainbools, bools = get_bools(t)
  File "/usr/lib64/python3.4/site-packages/sepolicy/__init__.py", line 854, in get_bools
    for i in [x['boolean'] for x in [x for x in search([ALLOW],{'source' : setype}) if 'boolean' in x]]:
  File "/usr/lib64/python3.4/site-packages/sepolicy/__init__.py", line 854, in <listcomp>
    for i in [x['boolean'] for x in [x for x in search([ALLOW],{'source' : setype}) if 'boolean' in x]]:
TypeError: expected bytes, str found

Comment 1 Fedora Update System 2015-08-13 16:03:16 UTC
policycoreutils-2.4-9.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/policycoreutils-2.4-9.fc23

Comment 2 Fedora Update System 2015-08-15 02:19:50 UTC
Package policycoreutils-2.4-9.fc23:
* should fix your issue,
* was pushed to the Fedora 23 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing policycoreutils-2.4-9.fc23'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13499/policycoreutils-2.4-9.fc23
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2015-08-22 16:24:31 UTC
policycoreutils-2.4-10.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update policycoreutils'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-13922

Comment 4 Lukas Vrabec 2015-08-23 17:25:23 UTC
Why is this in ON_QA? 

Petr, 
Do we have any fix?

Comment 5 Lukas Vrabec 2015-08-23 18:11:47 UTC
/builddir/build/BUILDROOT/selinux-policy-3.13.1-142.fc24.x86_64/usr/share/man/man8//zos_remote_selinux.8
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 162, in convert_manpage_to_html
    shell=True)
  File "/usr/lib64/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '/usr/bin/groff -man -Thtml /builddir/build/BUILDROOT/selinux-policy-3.13.1-142.fc24.x86_64/usr/share/man/man8//naemon_selinux.8 2>/dev/null' returned non-zero exit status 127

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 647, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 325, in manpage
    HTMLManPages(manpage_roles, manpage_domains, path, args.os)
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 185, in __init__
    self.__gen_html_manpages()
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 191, in __gen_html_manpages
    self._write_html_manpage()
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 202, in _write_html_manpage
    convert_manpage_to_html((self.new_path+d.split("_selinux")[0]+".html"),self.old_path+d)
  File "/usr/lib64/python3.4/site-packages/sepolicy/manpage.py", line 164, in convert_manpage_to_html
    sys.stderr.write(e.output)
TypeError: must be str, not bytes
error: Bad exit status from /var/tmp/rpm-tmp.doXUhA (%install)
    Macro expanded in comment on line 496: # %verify(not md5 size mtime) %{_sharedstatedir}/selinux/targeted/active/modules/100/permissivedomains

    Macro expanded in comment on line 582: # %verify(not md5 size mtime) %{_sysconfdir}/selinux/minimum/modules/active/modules/permissivedomains.pp

    Bad exit status from /var/tmp/rpm-tmp.doXUhA (%install)


RPM build errors:

Comment 6 Michal Srb 2015-08-24 07:19:04 UTC
(In reply to Lukas Vrabec from comment #4)
> Why is this in ON_QA? 
> 
> Petr, 
> Do we have any fix?

The generation of man pages should be fixed in current release. However, generation of one of the man pages failed from some reason:

Command '/usr/bin/groff -man -Thtml /builddir/build/BUILDROOT/selinux-policy-3.13.1-142.fc24.x86_64/usr/share/man/man8//naemon_selinux.8 2>/dev/null' returned non-zero exit status 127

And another Py3-related bug prevent us from seeing what went wrong. I'll look into it.

Comment 7 Lukas Vrabec 2015-08-24 08:30:07 UTC
Reproducer: 

$ fedpkg clone selinux-policy
$ fedpkg mockbuild

Build ends with error from Comment 5. 

Mockbuild using following packages:

$ ls | grep policycoreutils
policycoreutils-2.4-10.fc24.x86_64.rpm
policycoreutils-devel-2.4-10.fc24.x86_64.rpm
policycoreutils-python3-2.4-10.fc24.x86_64.rpm
policycoreutils-python-utils-2.4-10.fc24.x86_64.rpm

Comment 8 Fedora Update System 2015-08-26 04:32:46 UTC
policycoreutils-2.4-10.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-09-03 22:43:31 UTC
policycoreutils-2.4-12.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15040

Comment 11 Fedora Update System 2015-09-04 07:33:02 UTC
policycoreutils-2.4-12.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update policycoreutils'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15040

Comment 12 Fedora Update System 2015-09-04 19:45:18 UTC
policycoreutils-2.4-12.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.